Hi Tom,
To address issue "702 - Can't update a primary key of a composite key",
I added validation preventing updates to primary key fields.
I've changed DeferredChangeDetectionPolicy to call
DatabaseMapping.calculateValidatedChange instead of
DatabaseMapping.compareForChange directly.
DatabaseMapping.calculateValidatedChange calls compareForChange to
prepare the ChangeRecord for the field, and than does the validation, if
the ChangeRecord is not null (= the field has been set or updated). Any
updates to primary key fields are disallowed. Setting primary key fields
for inserts is allowed, of course! I added a ValidationException and
changed ValidationExceptionResource for that purpose.
EntityManagerJUnitTestSuite now has two new tests:
a) that the correct exception if thrown in case of a primary key update
b) that updating a primary key field with the same value is allowed
The entity-persistence-tests pass on Oracle. Please do the code-review.
Thank you!
-- markus.