#819 - Fix for bug in @ManyToOne relations with enabled soft-deletes

This commit is contained in:
Robin Bygrave
2016-08-31 23:03:00 +12:00
parent a0e927d353
commit d218fff374
2 changed files with 13 additions and 15 deletions
@@ -169,8 +169,13 @@ public class LoadBeanRequest extends LoadRequest {
EntityBeanIntercept ebi = batch.get(i);
Object id = desc.getId(ebi.getOwner());
if (!loadedIds.contains(id)) {
logger.info("Lazy loading unsuccessful for type:" + desc.getName() + " id:" + id + " - expecting when bean has been deleted");
ebi.setLazyLoadFailure(id);
if (desc.isSoftDelete()) {
// assume this is logically deleted (hence not found)
desc.setSoftDeleteValue(ebi.getOwner());
} else {
logger.info("Lazy loading unsuccessful for type:" + desc.getName() + " id:" + id + " - expecting when bean has been deleted");
ebi.setLazyLoadFailure(id);
}
}
}
}