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

This commit is contained in:
Robin Bygrave
2016-02-13 00:43:47 +13:00
parent 62aca1e77b
commit 8a8b36ec1e
12 changed files with 68 additions and 29 deletions
@@ -108,13 +108,14 @@ public final class BeanMapHelp<T> implements BeanCollectionHelp<T> {
}
@Override
public void add(BeanCollection<?> collection, EntityBean bean) {
public void add(BeanCollection<?> collection, EntityBean bean, boolean withCheck) {
if (bean == null) {
((BeanMap<?, ?>) collection).internalPutNull();
} else {
Object keyValue = beanProperty.getValueIntercept(bean);
((BeanMap<?, ?>) collection).internalPut(keyValue, bean);
BeanMap<?, ?> map = ((BeanMap<?, ?>) collection);
map.internalPutWithCheck(keyValue, bean);
}
}