| Summary: | EclipseLink converter validation appearing on xml, when converter defined in java | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] Dali JPA Tools | Reporter: | Karen Butzke <karenfbutzke> | ||||||
| Component: | JPA | Assignee: | Nan Li <nan.n.li> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | jolene.moffitt, neil.hauge | ||||||
| Version: | 3.1 | Flags: | karenfbutzke:
review+
|
||||||
| Target Milestone: | 3.2 M7 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | fix_ready | ||||||||
| Attachments: |
|
||||||||
This is either a regression or an improvement, depends on how you look at it. In 3.0 we just didn't validate the java converter at all in this situation. I think we need to be a little more deliberate in setting the target object of the message to the IResource. Currently in JpaValidator.adjustMessage(), we find the IResource from the targetObject set in the message. Our implementation of IResourcePart.getResource() on AbstractJpaNode just goes up the parental hierarchy. In this case the Java converter has a hierarchy that includes the GenericOrmXml which overrides getResource() and returns the orm.xml file. Created attachment 211770 [details]
proposed patch
Nan, this patch doesn't compile, it is missing the interface ParentAdapter Created attachment 212921 [details]
Proposed Patch
Karen, I have no idea what happened with last patch. Lots of code I already put there lost. Anyway, try this new one and let me know if any further problem. Thanks!
checked in for M7 Verified in Build I-3.4.0-20120402231106 Verified the error appears in problems pane for the entity and not the eclipselink-orm.xml file See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.2_M7 |
The Employee java entity defines a converter on an id mapping. The Employee entity is overridden in the orm.xml. The FooConverter class does not implement the Converter interface. The validation error appears on the orm.xml file, but the text range is being derived from the java. I think the point here was to have the validation error be added to the java file, not the orm.xml file. @Entity public class Employee { @Id @Converter(name = "asdf", converterClass=FooConverter.class) private int id; } <entity class="Employee"> </entity>