Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 359690

Summary: [EclipseLink] converter validation too strict if converters are named the same but not in conflict
Product: [WebTools] Dali JPA Tools Reporter: Karen Butzke <karenfbutzke>
Component: JPAAssignee: Nan Li <nan.n.li>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: neil.hauge
Version: 3.0Flags: neil.hauge: review+
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed Patch
none
Proposed Patch neil.hauge: iplog+

Description Karen Butzke CLA 2011-10-03 07:43:30 EDT
If you define the same converter in multiple locations in your object model you get a validation error saying that they are duplicate. EclipseLink only says they are duplicate if the definition is actually different. So if it is a different type of converter or the converter class that it points to is different. We need to loosen up our validation for this case.

	@Converter(
	name="booleanConverter",	
	converter=BooleanConverter.class)

Workaround is to remove the converter definition from all locations in the java source and define it instead in the persistence unit defaults of an orm.xml file.
Comment 1 Nan Li CLA 2011-10-14 17:46:10 EDT
Created attachment 205237 [details]
Proposed Patch

The validation works as the following:

1. No message is given with identical converters
2. An information message is given with identical generators and queries. The  message says something like Identical ... defined in this persistence unit, which may not be portable
Comment 2 Nan Li CLA 2011-10-20 16:49:10 EDT
Created attachment 205677 [details]
Proposed Patch

Added comments to the validation methods
Comment 3 Neil Hauge CLA 2011-10-21 16:01:29 EDT
Patch applied to head.