#767 - Query.setDisableLazyLoading(true) ... not disabling lazy loading on @OneToMany

This commit is contained in:
Robin Bygrave
2016-07-11 12:28:31 +12:00
parent 4be703ff6e
commit 3b7f5496a8
2 changed files with 5 additions and 1 deletions
@@ -374,7 +374,8 @@ public class SqlTreeNodeBean implements SqlTreeNode {
if (ref != null) {
if (disableLazyLoad) {
ref.setDisableLazyLoad(true);
} else if (!ref.isRegisteredWithLoadContext()) {
}
if (!ref.isRegisteredWithLoadContext()) {
ctx.register(manys[i].getName(), ref);
}
}
@@ -94,6 +94,9 @@ public class TestQueryJoinToAssocOne extends BaseTestCase {
// normally invokes lazy loading
orderDetail.getShipQty();
// normally invokes lazy loading
order.getShipments().size();
List<String> loggedSql = LoggedSqlCollector.stop();
assertThat(loggedSql).hasSize(2);