#115 - Mapping - Add support for @ElementCollection enhancement

Add element collection notification - combine into preUpdate/postUpdate of the bean
This commit is contained in:
Rob Bygrave committed 2018-03-28 17:31:53 +13:00
1 parent 57870aaa05
commit 07946cd505
7 files changed
+193 -13

No files matched your search

@@ -29,10 +29,9 @@ class SaveManyElementCollectionMap extends SaveManyBase {
}
Object parentId = request.getBeanId();
SpiEbeanServer server = request.getServer();
if (!insertedParent) {
request.preElementCollectionUpdate();
SqlUpdate sqlDelete = many.deleteByParentId(parentId, null);
server.execute(sqlDelete, transaction);
}
@@ -51,5 +50,8 @@ class SaveManyElementCollectionMap extends SaveManyBase {
transaction.depth(-1);
resetModifyState();
if (!insertedParent) {
request.postElementCollectionUpdate();
}
}
}