#592 - Fetched empty collection of null child of parent entity

This commit is contained in:
Robin Bygrave
2016-03-14 20:10:07 +13:00
parent b99f002968
commit 0ca4f92b26
5 changed files with 198 additions and 1 deletions
@@ -24,7 +24,9 @@ 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, false);
if (contextParent != null) {
manyProp.addBeanToCollectionWithCreate(contextParent, detailBean, false);
}
return detailBean;
}