| Summary: | [EclipseLink] default 1-1 derived id mapping appears as an id mapping, causes invalid validation | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Karen Butzke <karenfbutzke> | ||||||
| Component: | JPA | Assignee: | Paul Fullbright <paul.fullbright> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | major | ||||||||
| Priority: | P2 | CC: | jolene.moffitt, neil.hauge | ||||||
| Version: | 3.0.1 | ||||||||
| Target Milestone: | 3.3 M2 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows Mobile 5.0 | ||||||||
| Whiteboard: | fix_ready | ||||||||
| Attachments: |
|
||||||||
|
Description
Karen Butzke
Created attachment 206330 [details]
example project
@Entity
public class Administrator {
@Id
protected Employee emp;
}
@Entity
public class Employee {
@Id
protected Integer id;
}
The problem is this: - The determination of whether a mapping is specified "id" depends on the default mapping (and whether it is default 1-1). - The determination of whether a mapping is default 1-1 depends on the model being interconnected (a target entity must be resolveable.) - When we initialize the attribute, we only initialize the specified mapping information. - When we update, we only update the default mapping information if it is not a specified mapping, which it is from the initialized. We do not re-evaluate the specified mapping based on the new (potentially) default mapping information, and we do not re-evaluate the default mapping, because the mapping is already determined to be specified. In other words, it's fairly complicated. Deferring to 3.2 for these reasons: - see above (it's complicated) - it's not a regression (this exists in previous release) - this only exists for EclipseLink 2.0 + platforms, and then only in this particular case. - there is a very good workaround: simply add the @OneToOne annotation. Created attachment 214729 [details]
patch
The code actually simplifies a bit when you're checking both the default and specified mapping in the same method. All tests pass (including added test case) and Karen can't break it.
Given possible risk associate with this fix, and given that it has not been reported in the field, I think it is best if we defer this to 3.3 M1. committed fix for 3.3 M1. Verified in build I-3.5.0-20130212155715 that when you Import the attached project the mapping show correctly as one-to-one. To view steps to verify this issue go to http://wiki.eclipse.org/Dali_3.3_M2_Release |