| Summary: | stack overflow in the update if you set an IdClass to an Entity that contains an IdClass | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Karen Butzke <karenfbutzke> | ||||||||
| Component: | General | Assignee: | Nan Li <nan.n.li> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | major | ||||||||||
| Priority: | P3 | CC: | neil.hauge | ||||||||
| Version: | 3.0 | Flags: | neil.hauge:
review+
|
||||||||
| Target Milestone: | 3.0 M7 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows XP | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
Created attachment 194168 [details]
Proposed Patch
The fixes are
1. if the given id class is mapped as an entity, embeddable or mapped superclass, we don't build the id class.
2. if the given id class is mapped as an entity, embeddable or mapped superclass, we give an error message saying id class should not be mapped.
Two additional message were added for the orm id class:
1. If the given class is an empty string, we give an error message saying id class has an empty name.
2. If the given class is nonexistent, we give an error message saying id class does not exist on the project classpath.
We didn't add the similar validation for the java id class because the existing validation of annotation and Eclipse can already do the same job.
Created attachment 194173 [details]
Additional Files
This patch includes the missing part of the previous one.
Created attachment 194220 [details]
Additional File
Missing "JptUiValidationPreferenceMessages"
Patch committed to head. |
The following Entity will result in a neverending update thread that eventually results in a stack overflow exception. You can see the update job running in eclipse and if you put a breakpoint in AbstractJpaNode.stateChanged() you will see the never ending building of an Entity with an IdClass reference that is an Entity with an IdClass reference... If you realize what is wrong you can edit the code to remove the IdClass annotation and the update will stop. @Entity @IdClass(Address.class) public class Address { }