Community
Participate
Working Groups
Build Identifier: Eclipse Platform Version: 3.6.0.v20100602-9gF78GpqFt6trOGhL60z0oEx3fz-JKNwxPY Build id: I20100608-0911 After importing and building workspace its throwing errors in problems view i.e Description Resource Path Location Type An ancestor of this class has already defined the primary key. Primary key attributes may not be defined here. Productresources.java /OrderHandlingDBAccess/src/com/ibm/websphere/icp/telecom/reference/dynamicorderfulfillment line 24 Validation Message This class has a composite primary key. It must use an ID class. Productresources.java /OrderHandlingDBAccess/src/com/ibm/websphere/icp/telecom/reference/dynamicorderfulfillment line 22 Validation Message Attaching the issue Reproducible: Always Steps to Reproduce: 1.Launch Eclipse 2.Import attached PI file( JPA-project-PI.zip ) 3.Build the workspace and verify for any errors.
Created attachment 187857 [details] Its a Project Interchange file This issue was never there in earlier version i.e Eclipse Platform Version: 3.4.2.R342_v20090122-9I96EiWElHi8lheoJKJIvhM3JfVsYbRrgVIWL Build id: M20091008-1320 But this issue popped up from version Eclipse Platform Version: 3.6.0.v20100602-9gF78GpqFt6trOGhL60z0oEx3fz-JKNwxPY Build id: I20100608-0911 This is blocking our module to build.
Created attachment 187858 [details] Screenshot of error
Taking a look...may be related to bug 334134.
So there are a couple of issues here. The "ancestor" message is informing you that the key is being redefined in this class, which is not allowed in standard JPA as per the spec: The primary key must be defined on the entity class that is the root of the entity hierarchy or on a mapped superclass that is a (direct or indirect) superclass of all entity classes in the entity hierarchy. The primary key must be defined exactly once in an entity hierarchy. Various platforms may allow this configuration. The platform extension in Dali allows adopters to customize this validation if it is different than what the spec allows. For the "Generic" platform, this behavior is as designed. The "composite primary key" message is being applied incorrectly in this case, as there aren't multiple, simple primary keys defined in this entity, but rather a redefined simple primary key. This message would not appear once the patch for bug 334134 is applied, but that would only be coincidental as we will ignore this error until the PK redefined error is addressed. I am curios as to why you are redefining the primary key in the Productresources entity. Looking at the model this would appear to be unnecessary, and a bit confusing. If this redefinition of the PK was removed, both of the reported errors would also be removed. If you really needed to redefine the Id in this entity for some reason, the Dali JPA Platform extension that you are using "webSpherePlatform" would need to be updated to override the behavior of the validation logic contained in the Generic platform code. (This would require a separate bug against the WebSphere Tools) The Dali team would also need to address the bug in our composite primary key validation. The last resort option is disabling the JPA Validator in the project properties. Changing severity level of bug as there are several possible workarounds to allow for builds to continue.
Any feedback? Is there a request for this to be included in the Indigo maintenance line?
(In reply to comment #5) > Any feedback? Is there a request for this to be included in the Indigo > maintenance line? This should have said the *Helios* maintenance stream.
*** Bug 338737 has been marked as a duplicate of this bug. ***
Moving JPA specific bugs to new JPA component in bugzilla.
Targeting to Juno release.