« Previous | Next » 

Revision ced3a39c

IDced3a39c19c6774cb0fddf362de7f197c8f06c67
Parent 808784f6
Child d553c5e6

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