« Previous | Next » 

Revision 9eb75a41

ID9eb75a41db4843fca81e3e702715b0bf5db7d793
Parent e596bf70
Child dbe71474

Added by Christian Müller about 7 years ago

[BUGFIX] PersistentObjectConverter works with "immutable" properties

The PersistentObjectConverter sets convertedChildProperties on the
object after it was created (either newly constructed or
hydrated from persistance). Creating a new object will filter
constructor arguments from the convertedChildProperties but
if the object already existed that does not happen.
This poses a problem for objects that accept arguments in the
constructor that are not settable afterwards. So those properties are
considered "immutable".
In cases where you cannot be sure if an object already exists and you
give the identity and all properties of an object with "immutable"
properties the property mapping will fail if the object already existed
as the converter tries to set the "immutable" properties as well.

With this change we check for this kind of properties and compare the
given value with the already set value. In case they are identical
we ignore the given value and proceed with the property mapping. In
case they differ there is an inconsistency in your data that we cannot
handle and so throw an exception.
This is not breaking as before in all cases an exception would be thrown.

Change-Id: I972018b058823b565d682fd07598d8f8262c119b
Releases: master, 2.3, 2.2, 2.1
Fixes: NEOS-937

  • added
  • modified
  • copied
  • renamed
  • deleted