@Override public Object getCacheDataValue(EntityBean bean) { Object ap = getValue(bean); if (ap == null) { return null; } if (embedded) { return targetDescriptor.cacheEmbeddedBeanExtract((EntityBean) ap); } else { return targetDescriptor.getIdProperty().getCacheDataValue((EntityBean) ap); } }
BeanProperty property = beanDescriptor.propertyByIndex(i); if (property.isCacheDataInclude()) { Object val = property.getCacheDataValue(bean); changes.put(property.getName(), val); if (property.isNaturalKey()) {
public static CachedBeanData extract(BeanDescriptor<?> desc, EntityBean bean) { EntityBeanIntercept ebi = bean._ebean_getIntercept(); Map<String, Object> data = new LinkedHashMap<>(); BeanProperty idProperty = desc.getIdProperty(); if (idProperty != null) { int propertyIndex = idProperty.getPropertyIndex(); if (ebi.isLoadedProperty(propertyIndex)) { data.put(idProperty.getName(), idProperty.getCacheDataValue(bean)); } } BeanProperty[] props = desc.propertiesNonMany(); // extract all the non-many properties for (BeanProperty prop : props) { if (ebi.isLoadedProperty(prop.getPropertyIndex())) { data.put(prop.getName(), prop.getCacheDataValue(bean)); } } for (BeanPropertyAssocMany<?> prop : desc.propertiesMany()) { if (prop.isElementCollection()) { data.put(prop.getName(), prop.getCacheDataValue(bean)); } } long version = desc.getVersion(bean); EntityBean sharableBean = createSharableBean(desc, bean, ebi); return new CachedBeanData(sharableBean, desc.getDiscValue(), data, version); }
@Override public Object getCacheDataValue(EntityBean bean) { Object ap = getValue(bean); if (ap == null) { return null; } if (embedded) { return targetDescriptor.cacheEmbeddedBeanExtract((EntityBean) ap); } else { return targetDescriptor.getIdProperty().getCacheDataValue((EntityBean) ap); } }
BeanProperty property = beanDescriptor.propertyByIndex(i); if (property.isCacheDataInclude()) { Object val = property.getCacheDataValue(bean); changes.put(property.getName(), val); if (property.isNaturalKey()) {
public static CachedBeanData extract(BeanDescriptor<?> desc, EntityBean bean) { EntityBeanIntercept ebi = bean._ebean_getIntercept(); Map<String, Object> data = new LinkedHashMap<>(); BeanProperty idProperty = desc.getIdProperty(); if (idProperty != null) { int propertyIndex = idProperty.getPropertyIndex(); if (ebi.isLoadedProperty(propertyIndex)) { data.put(idProperty.getName(), idProperty.getCacheDataValue(bean)); } } BeanProperty[] props = desc.propertiesNonMany(); // extract all the non-many properties for (BeanProperty prop : props) { if (ebi.isLoadedProperty(prop.getPropertyIndex())) { data.put(prop.getName(), prop.getCacheDataValue(bean)); } } for (BeanPropertyAssocMany<?> prop : desc.propertiesMany()) { if (prop.isElementCollection()) { data.put(prop.getName(), prop.getCacheDataValue(bean)); } } long version = desc.getVersion(bean); EntityBean sharableBean = createSharableBean(desc, bean, ebi); return new CachedBeanData(sharableBean, desc.getDiscValue(), data, version); }