/** * Register all the assoc many properties on this bean that are not populated with the load context. * <p> * This provides further lazy loading via the load context. * </p> */ public void lazyLoadRegister(String prefix, EntityBeanIntercept ebi, EntityBean bean, LoadContext loadContext) { // load the List/Set/Map proxy objects (deferred fetching of lists) BeanPropertyAssocMany<?>[] manys = propertiesMany(); for (BeanPropertyAssocMany<?> many : manys) { if (!ebi.isLoadedProperty(many.getPropertyIndex())) { BeanCollection<?> ref = many.createReferenceIfNull(bean); if (ref != null && !ref.isRegisteredWithLoadContext()) { String path = SplitName.add(prefix, many.getName()); loadContext.register(path, ref); } } } }
public static void load(BeanDescriptor<?> desc, EntityBean bean, CachedBeanData cacheBeanData, PersistenceContext context) { EntityBeanIntercept ebi = bean._ebean_getIntercept(); BeanProperty idProperty = desc.getIdProperty(); if (desc.getInheritInfo() != null) { desc = desc.getInheritInfo().readType(bean.getClass()).desc(); } if (idProperty != null) { // load the id property loadProperty(bean, cacheBeanData, ebi, idProperty, context); } // load the non-many properties for (BeanProperty prop : desc.propertiesNonMany()) { loadProperty(bean, cacheBeanData, ebi, prop, context); } for (BeanPropertyAssocMany<?> prop : desc.propertiesMany()) { if (prop.isElementCollection()) { loadProperty(bean, cacheBeanData, ebi, prop, context); } else { prop.createReferenceIfNull(bean); } } ebi.setLoadedLazy(); }
/** * Register all the assoc many properties on this bean that are not populated with the load context. * <p> * This provides further lazy loading via the load context. * </p> */ public void lazyLoadRegister(String prefix, EntityBeanIntercept ebi, EntityBean bean, LoadContext loadContext) { // load the List/Set/Map proxy objects (deferred fetching of lists) BeanPropertyAssocMany<?>[] manys = propertiesMany(); for (BeanPropertyAssocMany<?> many : manys) { if (!ebi.isLoadedProperty(many.getPropertyIndex())) { BeanCollection<?> ref = many.createReferenceIfNull(bean); if (ref != null && !ref.isRegisteredWithLoadContext()) { String path = SplitName.add(prefix, many.getName()); loadContext.register(path, ref); } } } }
public static void load(BeanDescriptor<?> desc, EntityBean bean, CachedBeanData cacheBeanData, PersistenceContext context) { EntityBeanIntercept ebi = bean._ebean_getIntercept(); BeanProperty idProperty = desc.getIdProperty(); if (desc.getInheritInfo() != null) { desc = desc.getInheritInfo().readType(bean.getClass()).desc(); } if (idProperty != null) { // load the id property loadProperty(bean, cacheBeanData, ebi, idProperty, context); } // load the non-many properties for (BeanProperty prop : desc.propertiesNonMany()) { loadProperty(bean, cacheBeanData, ebi, prop, context); } for (BeanPropertyAssocMany<?> prop : desc.propertiesMany()) { if (prop.isElementCollection()) { loadProperty(bean, cacheBeanData, ebi, prop, context); } else { prop.createReferenceIfNull(bean); } } ebi.setLoadedLazy(); }