Issue Details (XML | Word | Printable)

Key: NUCAPIJDO-76
Type: Task Task
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus API JDO

If a user has a PK class using javax.jdo.XXXIdentity as part of a compound id, this fails on enhancement

Created: 10/Jun/14 05:04 PM   Updated: 11/Nov/14 04:19 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide
Since we use the DN-internal single field id PK classes now, this is failing a check at
org.datanucleus.metadata.AbstractClassMetaData.validateObjectIdClass

The simple workaround is to specify DN-specific PK fields, or provide an objectIdClass for the object that makes up the PK.


The stack trace with v4.0.3 is as follows

Class "mydomain.model.CompoundTarget" has been specified with an object-id class mydomain.model.CompoundTarget$Id which has a field source. The field mydomain.model.CompoundTarget$Id.source has type javax.jdo.identity.LongIdentity but should be org.datanucleus.identity.LongId. All non static fields of an objectId class must include the names of the primary key fields in the JDO class, and the types of the corresponding fields must be identical.
org.datanucleus.metadata.InvalidPrimaryKeyException: Class "mydomain.model.CompoundTarget" has been specified with an object-id class mydomain.model.CompoundTarget$Id which has a field source. The field mydomain.model.CompoundTarget$Id.source has type javax.jdo.identity.LongIdentity but should be org.datanucleus.identity.LongId. All non static fields of an objectId class must include the names of the primary key fields in the JDO class, and the types of the corresponding fields must be identical.
    at org.datanucleus.api.jdo.JDOAdapter.processPrimaryKeyClass(JDOAdapter.java:551)
    at org.datanucleus.api.jdo.JDOAdapter.isValidPrimaryKeyClass(JDOAdapter.java:464)
    at org.datanucleus.metadata.AbstractClassMetaData.validateObjectIdClass(AbstractClassMetaData.java:1442)

Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.