Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315411 - Improve the defaults for join column referenced-column-name where inheritance pk-join-columns are involved
Summary: Improve the defaults for join column referenced-column-name where inheritance...
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.3   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nan Li CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-02 11:18 EDT by Karen Butzke CLA
Modified: 2013-09-11 15:02 EDT (History)
1 user (show)

See Also:


Attachments
example JPA project (6.44 KB, application/zip)
2010-06-02 11:18 EDT, Karen Butzke CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2010-06-02 11:18:44 EDT
Created attachment 170817 [details]
example JPA project

In bug 315292 we removed the validation for a join-column referenced-column-name that is defaulted.

We need to sort out what the default referenced-column-name is for EclipseLink and for Generic. Also what column choices do we give the user when selecting a referenced-column-name using code-assist or a drop-down.


Here is an email from Doug:

When a user is creating a relationship mapping into an inheritance hierarchy I believe the most intuitive configuration is to map to the PK column(s) of the target class. In the case described where the 1:1 is from Employee to Address I would expect to specify column names as mapped in Address. The fact that the runtime translates this into the corresponding PK column should not matter to the user.

It is very odd to setup a mapping where the target is Address and then reference a column in ContactPoint without having to more specifically indicate the table. I guess this is more of a spec issue then anything we have to handle at the moment.

Some ideas to address the current issue in Dali.

1. In the case of a single column FK/PK we should not do any validation in the case where the join-column does not have a referenced-column-name specified. Currently Dali makes an assumption about what the value defaults to and then compares it with the target and decides there is an issue. 

2. In the case where the referenced-column-name is specified Dali should accept the PK column name(s) of the inheritance root or the corresponding values specified in <primary-key-join-column> which maps a sub-class PK column to the parent/root.

For Helios I would simply like to see us address #1 so at least I can have AllState remove the unnecessary referenced-column-name configuration in their single PK column model and avoid the unnecessary warning. Scenario #2 and additionally more complex scenarios involving multiple level inheritance using primary-key-join-column and multi-column PK can be deferred until the next release.
Comment 1 Neil Hauge CLA 2011-05-10 16:46:18 EDT
Moving to Juno to resolve item number 2.
Comment 2 Neil Hauge CLA 2011-07-01 16:25:22 EDT
Moving JPA specific bugs to new JPA component in bugzilla.
Comment 3 Neil Hauge CLA 2011-10-07 12:51:43 EDT
Targeting to Juno release.
Comment 4 Karen Butzke CLA 2012-05-02 16:29:27 EDT
moving to 3.3, I think this is going to be too complicated to fix at this point in Juno.
Comment 5 Nan Li CLA 2013-08-14 22:38:39 EDT
To summarize, two issues need to be addressed here:

1. When Join strategy and PK join column are involved, the columns of the parent entity should be included in the column choices when using code-assist and drop down.

2. When Join strategy and PK join column are involved, the validation for a join column referenced-column-name should accept the PK column name(s) of the inheritance root or the corresponding values specified in <primary-key-join-column> which maps a sub-class PK column to the parent/root. (Scenario #2)