« Previous | Next » 

Revision a31b73e6

IDa31b73e6e9de06606c6ab28d1a24958546fbfbbb
Parent 1d7f93e6
Child e5b43b36

Added by Christian Müller almost 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