@Override public void loadMany(BeanCollection<?> bc, boolean onlyIds) { synchronized (this) { boolean useCache = context.hitCache && !onlyIds; if (useCache) { EntityBean ownerBean = bc.getOwnerBean(); BeanDescriptor<?> parentDesc = context.desc.getBeanDescriptor(ownerBean.getClass()); Object parentId = parentDesc.getId(ownerBean); if (parentDesc.cacheManyPropLoad(context.property, bc, parentId, context.parent.isReadOnly())) { // we loaded the bean collection from cache so remove it from the buffer for (int i = 0; i < list.size(); i++) { // find it using instance equality - avoiding equals() and potential deadlock issue if (list.get(i) == bc) { list.remove(i); return; } } return; } } // Should reduce the list by checking each beanCollection in the L2 first before executing the query LoadManyRequest req = new LoadManyRequest(this, onlyIds, useCache); context.parent.getEbeanServer().loadMany(req); } }
readOnly = Boolean.TRUE; if (parentDesc.cacheManyPropLoad(many, beanCollection, parentId, readOnly)) { return;
@Override public void loadMany(BeanCollection<?> bc, boolean onlyIds) { synchronized (this) { boolean useCache = context.hitCache && !onlyIds; if (useCache) { EntityBean ownerBean = bc.getOwnerBean(); BeanDescriptor<?> parentDesc = context.desc.getBeanDescriptor(ownerBean.getClass()); Object parentId = parentDesc.getId(ownerBean); if (parentDesc.cacheManyPropLoad(context.property, bc, parentId, context.parent.isReadOnly())) { // we loaded the bean collection from cache so remove it from the buffer for (int i = 0; i < list.size(); i++) { // find it using instance equality - avoiding equals() and potential deadlock issue if (list.get(i) == bc) { list.remove(i); return; } } return; } } // Should reduce the list by checking each beanCollection in the L2 first before executing the query LoadManyRequest req = new LoadManyRequest(this, onlyIds, useCache); context.parent.getEbeanServer().loadMany(req); } }
readOnly = Boolean.TRUE; if (parentDesc.cacheManyPropLoad(many, beanCollection, parentId, readOnly)) { return;