Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315292 - incorrect join column referenced column name with JOINED inheritance
Summary: incorrect join column referenced column name with JOINED inheritance
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: General (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: 2.3 RC4   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-01 16:15 EDT by Karen Butzke CLA
Modified: 2010-06-04 10:39 EDT (History)
5 users (show)

See Also:
david_williams: pmc_approved+
raghunathan.srinivasan: pmc_approved+
neil.hauge: pmc_approved? (naci.dai)
neil.hauge: pmc_approved? (deboer)
neil.hauge: pmc_approved+
neil.hauge: pmc_approved? (kaloyan)
neil.hauge: review+


Attachments
example JPA project (6.44 KB, application/zip)
2010-06-02 11:07 EDT, Karen Butzke CLA
no flags Details
proposed patch against head (2.39 KB, patch)
2010-06-02 11:19 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-06-01 16:15:35 EDT
The attached example project has multiple validation errors for join column referenced columns that don't resolve. Dali is correctly defaulting the referenced column name to be the target entity id, but we are validating it against the wrong table.  We validate it against the target entity table instead of the primary table of the inheritance hierarchy.  In this case a parent entity defines the id and defines JOINED inheritance, so that table should be used for the validation.
Comment 1 Karen Butzke CLA 2010-06-01 16:18:28 EDT
Only workaround for this is to turn off the validation for 'join column referenced column name cannot be resolved'. Specifying the referenced column will still result in an incorrect validation error.
Comment 2 Neil Hauge CLA 2010-06-01 17:15:32 EDT
Investigate for RC4 given severity.
Comment 3 Karen Butzke CLA 2010-06-02 11:07:57 EDT
Created attachment 170813 [details]
example JPA project
Comment 4 Karen Butzke CLA 2010-06-02 11:19:21 EDT
Created attachment 170818 [details]
proposed patch against head

This patch removes the validation error for a join-column when the referenced-column-name is not specified.  This particular validation is redundant with the the pk-join-column validation that should occur on the target entity. We will still have validation if the referenced-column-name is specified.

This is a low-risk fix for this bug for the Helios release.  We need to further address this and correctly handle the default referenced-column-name for EclipseLink, these remaining issues will dealt with in bug 315411.
Comment 5 Karen Butzke CLA 2010-06-02 11:36:41 EDT
I have tested with xml and java specification and also with AssociationOverrides, the referenced-column-name is only validated if it is specified.
Comment 6 Neil Hauge CLA 2010-06-02 12:55:25 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. 

This bug produces invalid errors on valid mapping metadata.

* Is there a work-around? If so, why do you believe the work-around is insufficient? 

The only workaround is to disable this validation message in the problem preferences, but this will also eliminate this validation in cases where it is correctly identifying a problem.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added? 

The fix has been manually tested by Karen and myself.  See comment #5.

* Give a brief technical overview. Who has reviewed this fix? 

See comment #4.  I have reviewed the fix and can confirm that this is minimal and isolated fix.

* What is the risk associated with this fix? 

Risk is very low, as we have further restricted the case where validation is added in this scenario.  I think the very low risk of the fix warrants addressing this issue in RC4.
Comment 7 David Williams CLA 2010-06-02 18:13:03 EDT
Looks small enough. And false alarm validation message are pretty bad (and in some cases can prevent deployment, etc. not sure if that's true here)
Comment 8 Neil Hauge CLA 2010-06-02 18:17:00 EDT
Approving this so we can go ahead and get it released for tonight's build.
Comment 9 Tran Le CLA 2010-06-02 19:47:22 EDT
Patch checked in and released.
Comment 10 Karen Butzke CLA 2010-06-04 10:39:36 EDT
verified fixed in build WTP-S-3.2.0RC4-20100603065347