Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 371112 - EclipseLink converter validation appearing on xml, when converter defined in java
Summary: EclipseLink converter validation appearing on xml, when converter defined in ...
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M7   Edit
Assignee: Nan Li CLA
QA Contact:
URL:
Whiteboard: fix_ready
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 12:39 EST by Karen Butzke CLA
Modified: 2012-04-09 14:25 EDT (History)
2 users (show)

See Also:
karenfbutzke: review+


Attachments
proposed patch (12.78 KB, patch)
2012-02-28 19:34 EST, Nan Li CLA
no flags Details | Diff
Proposed Patch (42.62 KB, patch)
2012-03-20 11:17 EDT, Nan Li CLA
karenfbutzke: iplog+
karenfbutzke: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karen Butzke CLA 2012-02-09 12:39:27 EST
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>
Comment 1 Karen Butzke CLA 2012-02-09 13:06:18 EST
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.
Comment 2 Nan Li CLA 2012-02-28 19:34:51 EST
Created attachment 211770 [details]
proposed patch
Comment 3 Karen Butzke CLA 2012-03-20 09:32:46 EDT
Nan, this patch doesn't compile, it is missing the interface ParentAdapter
Comment 4 Nan Li CLA 2012-03-20 11:17:17 EDT
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!
Comment 5 Karen Butzke CLA 2012-03-21 13:01:23 EDT
checked in for M7
Comment 6 Jolene Moffitt CLA 2012-04-09 14:25:45 EDT
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