| Summary: | [Validation] Embeddable class contained within an element collection must not a contain an element collection | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Karen Butzke <karenfbutzke> | ||||||||||||||
| Component: | JPA | Assignee: | Leslie Davis <les.davis> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | enhancement | ||||||||||||||||
| Priority: | P3 | CC: | neil.hauge | ||||||||||||||
| Version: | 3.0 | Keywords: | plan | ||||||||||||||
| Target Milestone: | 3.2 M6 | Flags: | karenfbutzke:
review+
|
||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows XP | ||||||||||||||||
| Whiteboard: | JPA2.0 fix_ready | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Karen Butzke
Created attachment 190194 [details]
proposed bug fix patch
Attached a proposed bug fix for this issue.
Created attachment 190850 [details]
test project
I have attached a test project that should have a validation error when this bug is fixed. Les, your current patch does not give a validation error. I'm not sure why I didn't attach this project when I wrote up the bug in the first place
Not sure if this matters, but EclipseLink is considering this a fringe case and has targeted it to future. they do not have a validation error for it, and ddl generation fails with an odd exception, see bug 324770 Created attachment 190910 [details]
patch with additional recommended changes
Added validation for mapped key embeddedable
Neil and I have come up with some changes to the validation messages. My element collection mapping testing looks good so far, will continue testing the relationship mapping use case.
Mapping contains an embeddable \"{0}\" with a prohibited mapping "\"{1}\". Element collections may not contain embeddables with element collection mappings.
Mapping contains an embeddable \"{0}\" with a prohibited mapping "\"{1}\". Embeddables in element collections may only contain many-to-one or one-to-one mappings and must be on the \"owning\" side of the relationship.
Created attachment 191033 [details]
patch with additional recommended changes
Deferring since this is considered a fringe case. This should be checked in after branching for 3.1. Moving JPA specific bugs to new JPA component in bugzilla. These validation messages need corresponding virtual validation messages. If you add the PropertyRecord entity to an orm.xml file and don't specify the attribute mappings, you will see the same validation message and you can't tell which attribute it is referring to. Also need to add the validation messages to the validation preferences (see JpaProblemSeveritiesPage) This example is from bug 347368, we need to cover this case with validation as well. 1. Define type mappings as the following: @Entity public class Phone { @Id private String type; private Integer num; } @Embeddable public class EmbeddableType { @JoinTable(name= "Emp_Phone") <- uses JoinTable strategy @ManyToOne private Phone phone; } @Entity public class Employee { @ElementCollection private Collection<EmbeddableType> emType; } Created attachment 211360 [details]
proposed patch
Added virtual validation messages, problems preferences, and addition validation case for JoinTable.
Created attachment 211374 [details]
updated patch
checked in for M6 |