#768 - Query.setDisableLazyLoading(true) ... not disabling lazy loading on @ManyToOne reference bean

This commit is contained in:
Robin Bygrave committed 2016-07-11 15:09:59 +12:00
1 parent 3b7f5496a8
commit 2991cb9ad1
16 files changed
+160 -69

No files matched your search

@@ -46,9 +46,11 @@ abstract class AssocOneHelp {
return existing;
}
Object ref = target.contextRef(pc, ctx.isReadOnly(), id);
EntityBeanIntercept ebi = ((EntityBean) ref)._ebean_getIntercept();
ctx.register(property.name, ebi);
boolean disableLazyLoading = ctx.isDisableLazyLoading();
Object ref = target.contextRef(pc, ctx.isReadOnly(), disableLazyLoading, id);
if (!disableLazyLoading) {
ctx.register(property.name, ((EntityBean) ref)._ebean_getIntercept());
}
return ref;
}