#894 - ENH: Add support for @OneToMany orphanRemoval = true (which is the same as @PrivateOwned)

This commit is contained in:
Rob Bygrave
2016-11-24 02:21:54 +13:00
parent b4a0d9f5ea
commit 81d829f74e
2 changed files with 5 additions and 4 deletions
@@ -55,6 +55,10 @@ class AnnotationAssocManys extends AnnotationParser {
OneToMany oneToMany = get(prop, OneToMany.class);
if (oneToMany != null) {
readToOne(oneToMany, prop);
if (oneToMany.orphanRemoval()) {
prop.setModifyListenMode(ModifyListenMode.REMOVALS);
prop.getCascadeInfo().setDelete(true);
}
PrivateOwned privateOwned = get(prop, PrivateOwned.class);
if (privateOwned != null) {
prop.setModifyListenMode(ModifyListenMode.REMOVALS);