DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to.
DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued

Use of @EmbeddedId (composite) and relation fields results in exception

See test.jpa.general RelationshipsTest where there is a test with @EmbeddedId and with the owning class also having a join table 1-N relation. When the persist is attempted it tries to insert into the join table with null for the owner PK fields. The problem is likely the internally selected objectId class (ObjectIdentity) which doesn't allow for fields that are persistable in their own right. The workaround would be for the user to define their own @IdClass.

Description

See test.jpa.general RelationshipsTest where there is a test with @EmbeddedId and with the owning class also having a join table 1-N relation. When the persist is attempted it tries to insert into the join table with null for the owner PK fields. The problem is likely the internally selected objectId class (ObjectIdentity) which doesn't allow for fields that are persistable in their own right. The workaround would be for the user to define their own @IdClass.

Andy Jefferson added a comment - 08/Jun/10 03:02 PM Likely due to the @EmbeddedId class being set with nondurable identity and AppIdObjectIdConsumer doesn't handle that case (needs to use all fields of the class, instead of the PK fields)