Bug #45640
Every relation is set to cascade=all if the related entity is no aggregate root
Status: | New | Start date: | 2013-02-20 | |
---|---|---|---|---|
Priority: | Could have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | Persistence | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | Git master |
Description
Example structure:
Product => OneToMany => Variant
BasketItem => ManyToOne => Variant
If Variant is no aggregate root it is deleted when BasketItem is deleted because cascade=all is automatically set in
TYPO3\Flow\Persistence\Doctrine\Mapping\Driver\FlowAnnotationDriver per default.
Around line 540.
This (IMHO not very helpful) default behavior cannot be overwritten by the annotation because cascade={} throws errors.
History
#1 Updated by Benno Weinzierl over 2 years ago
As discussed in the IRC channel this case according to DDD should not happen.
Still it would be nice to overwrite this behavior by providing cascade={}
#2 Updated by Adrian Föder over 2 years ago
- Priority changed from Must have to Could have
- Target version deleted (
2.0)