mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +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:
@@ -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