« Previous | Next » 

Revision 786d002b

Parent 10e8a7f7
Child b087d60f

Added by Alexander Berl about 6 years ago

[BUGFIX] Value objects get cascade deleted by default

Value objects are by nature not bound to single parent entities and exist by their own.
Currently, Flow automatically annotates relations to value objects as cascade='all' and
orphanRemoval=true. Doctrine itself states that orphanRemoval should only be set when
the related object is privately owned and not reused by other entities, which is not
generally true for value objects.
See http://doctrine-orm.readthedocs.org/en/latest/reference/working-with-associations.html#orphan-removal

This leads to exceptions when entities with a relation to an value object are deleted.

This change addresses that by setting cascading to 'persist' only for value objects and
not setting orphanRemoval on relations to value objects by default.

Change-Id: I236bc9dc0f92f3c775203e292bd0bc44a532324b
Fixes: FLOW-296
Releases: master, 3.0

  • added
  • modified
  • copied
  • renamed
  • deleted