mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#767 - Query.setDisableLazyLoading(true) ... not disabling lazy loading on @OneToMany
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user