mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#1568 - @OneToMany with orphanRemoval=true ... with @Cache (and not a @ManyToOne) doesn't remove orphans after cache hit
This commit is contained in:
1 parent
6d5e0c4766
commit
315b39813b
4 files changed
+175
-1
No files matched your search
@@ -344,7 +344,7 @@ class SaveManyBeans extends SaveManyBase {
|
||||
for (Object removedBean : modifyRemovals) {
|
||||
if (removedBean instanceof EntityBean) {
|
||||
EntityBean eb = (EntityBean) removedBean;
|
||||
if (eb._ebean_getIntercept().isLoaded()) {
|
||||
if (!eb._ebean_getIntercept().isNew()) {
|
||||
// only delete if the bean was loaded meaning that it is known to exist in the DB
|
||||
persister.deleteRequest(persister.createPublishRequest(removedBean, transaction, PersistRequest.Type.DELETE, request.getFlags()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user