datanucleus-core
datanucleus-core copied to clipboard
Enhancement contract : Embedded PK has incomplete dnCopyKeyFieldsXXX methods
When enhancing a class marked as @Embeddable the class is enhanced, however its jdoCopyKeyFieldsXXX methods are not set (empty body) and so the key fields are not copied.
This is tested by "test.jpa.general" EmbeddedTest. When calling clean(...) this tries to use the SQL DELETE FROM ... WHERE ... = ... yet the PK values are not set. This is because AppIDObjectIdFieldConsumer is created and passed to Department.jdoCopyKeyFieldsFromObjectId, which calls AppIDObjectIdFieldConsumer.storeObjectField(...) with the DepartmentPK. This then calls DepartmentPK.jdoCopyKeyFieldsFromObjectId(...) which does nothing!