#462 - When fetching, collections can get populated with too many entities - Fix

This commit is contained in:
Robin Bygrave committed 2016-02-13 00:43:47 +13:00
1 parent 62aca1e77b
commit 8a8b36ec1e
12 files changed
+68 -29

No files matched your search

@@ -399,7 +399,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
}
// add the loadedBean to the appropriate collection of lazyLoadParentBean
lazyLoadManyProperty.addBeanToCollectionWithCreate(lazyLoadParentBean, bean);
lazyLoadManyProperty.addBeanToCollectionWithCreate(lazyLoadParentBean, bean, true);
}
}
@@ -542,7 +542,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
while (hasNext()) {
EntityBean bean = next();
help.add(collection, bean);
help.add(collection, bean, false);
}
updateExecutionStatistics();
@@ -347,7 +347,7 @@ public class SqlTreeNodeBean implements SqlTreeNode {
return localBean;
} else {
if (lazyLoadParentId != null && newBean) {
if (lazyLoadParentId != null) {
ctx.setLazyLoadedChildBean(contextBean, lazyLoadParentId);
}
return contextBean;
@@ -24,7 +24,7 @@ public final class SqlTreeNodeManyRoot extends SqlTreeNodeBean {
// being set to the parentBean directly
EntityBean detailBean = super.load(cquery, null, null);
// initialise the collection and add detailBean if it is not null
manyProp.addBeanToCollectionWithCreate(contextParent, detailBean);
manyProp.addBeanToCollectionWithCreate(contextParent, detailBean, false);
return detailBean;
}