public void setUnmappedJson(EntityBean bean, Map<String, Object> unmappedProperties) { if (unmappedJson != null) { unmappedJson.setValueIntercept(bean, unmappedProperties); } }
/** * Copy/set the property value from the draft bean to the live bean. */ public void publish(EntityBean draftBean, EntityBean liveBean) { if (!version && !draftOnly) { // set property value from draft to live Object value = getValueIntercept(draftBean); setValueIntercept(liveBean, value); } }
/** * Load the given value into the property. */ public void load(BeanProperty target, Object dbVal) { if (!refreshLoading) { target.setValue(bean, dbVal); } else { target.setValueIntercept(bean, dbVal); } } }
@Override public Object convertSetId(Object idValue, EntityBean bean) { if (!idValue.getClass().equals(expectedType)) { idValue = scalarType.toBeanType(idValue); } if (bean != null) { // support PropertyChangeSupport idProperty.setValueIntercept(bean, idValue); } return idValue; }
@Override public void pathSet(Object bean, Object value) { if (bean != null) { Object logicalVal = convertToLogicalType(value); setValueIntercept((EntityBean) bean, logicalVal); } }
/** * Set the version value returning it in primitive long form. */ @SuppressWarnings("unchecked") public long setVersion(EntityBean entityBean, Object versionValue) { versionProperty.setValueIntercept(entityBean, versionValue); return versionProperty.scalarType.asVersion(versionValue); }
/** * Set the value of all the 'reset properties' to null on the draft bean. */ public boolean draftReset(T draftBean) { EntityBean draftEntityBean = (EntityBean) draftBean; if (draftDirty != null) { // set @DraftDirty property to false draftDirty.setValueIntercept(draftEntityBean, false); } // set to null on all @DraftReset properties for (BeanProperty resetProperty : resetProperties) { resetProperty.setValueIntercept(draftEntityBean, null); } // return true if the bean is dirty (and should be persisted) return draftEntityBean._ebean_getIntercept().isDirty(); }
/** * If there is a @DraftDirty property set it's value on the bean. */ public void setDraftDirty(EntityBean entityBean, boolean value) { if (draftDirty != null) { // check to see if the dirty property has already // been set and if so do not set the value if (!entityBean._ebean_getIntercept().isChangedProperty(draftDirty.getPropertyIndex())) { draftDirty.setValueIntercept(entityBean, value); } } }
public void setUnmappedJson(EntityBean bean, Map<String, Object> unmappedProperties) { if (unmappedJson != null) { unmappedJson.setValueIntercept(bean, unmappedProperties); } }
/** * Copy/set the property value from the draft bean to the live bean. */ public void publish(EntityBean draftBean, EntityBean liveBean) { if (!version && !draftOnly) { // set property value from draft to live Object value = getValueIntercept(draftBean); setValueIntercept(liveBean, value); } }
public Object load(BeanProperty prop) { if (!rawSql && !prop.isLoadProperty(ctx.isDraftQuery())) { return null; } if ((bean == null) || (lazyLoading && ebi.isLoadedProperty(prop.getPropertyIndex())) || (type != null && !prop.isAssignableFrom(type))) { // ignore this property // ... null: bean already in persistence context // ... lazyLoading: partial bean that is lazy loading // ... type: inheritance and not assignable to this instance prop.loadIgnore(ctx); return null; } try { Object dbVal = prop.read(ctx); if (!refreshLoading) { prop.setValue(bean, dbVal); } else { prop.setValueIntercept(bean, dbVal); } return dbVal; } catch (Exception e) { bean._ebean_getIntercept().setLoadError(prop.getPropertyIndex(), e); ctx.handleLoadError(prop.getFullBeanName(), e); return prop.getValue(bean); } }
@Override public Object convertSetId(Object idValue, EntityBean bean) { if (!idValue.getClass().equals(expectedType)) { idValue = scalarType.toBeanType(idValue); } if (bean != null) { // support PropertyChangeSupport idProperty.setValueIntercept(bean, idValue); } return idValue; }
@Override public void pathSet(Object bean, Object value) { if (bean != null) { Object logicalVal = convertToLogicalType(value); setValueIntercept((EntityBean) bean, logicalVal); } }
/** * Set the version value returning it in primitive long form. */ @SuppressWarnings("unchecked") public long setVersion(EntityBean entityBean, Object versionValue) { versionProperty.setValueIntercept(entityBean, versionValue); return versionProperty.scalarType.asVersion(versionValue); }
/** * Load the given value into the property. */ public void load(BeanProperty target, Object dbVal) { if (!refreshLoading) { target.setValue(bean, dbVal); } else { target.setValueIntercept(bean, dbVal); } } }
/** * Set the value of all the 'reset properties' to null on the draft bean. */ public boolean draftReset(T draftBean) { EntityBean draftEntityBean = (EntityBean) draftBean; if (draftDirty != null) { // set @DraftDirty property to false draftDirty.setValueIntercept(draftEntityBean, false); } // set to null on all @DraftReset properties for (BeanProperty resetProperty : resetProperties) { resetProperty.setValueIntercept(draftEntityBean, null); } // return true if the bean is dirty (and should be persisted) return draftEntityBean._ebean_getIntercept().isDirty(); }
/** * If there is a @DraftDirty property set it's value on the bean. */ public void setDraftDirty(EntityBean entityBean, boolean value) { if (draftDirty != null) { // check to see if the dirty property has already // been set and if so do not set the value if (!entityBean._ebean_getIntercept().isChangedProperty(draftDirty.getPropertyIndex())) { draftDirty.setValueIntercept(entityBean, value); } } }
public Object load(BeanProperty prop) { if (!rawSql && !prop.isLoadProperty(ctx.isDraftQuery())) { return null; } if ((bean == null) || (lazyLoading && ebi.isLoadedProperty(prop.getPropertyIndex())) || (type != null && !prop.isAssignableFrom(type))) { // ignore this property // ... null: bean already in persistence context // ... lazyLoading: partial bean that is lazy loading // ... type: inheritance and not assignable to this instance prop.loadIgnore(ctx); return null; } try { Object dbVal = prop.read(ctx); if (!refreshLoading) { prop.setValue(bean, dbVal); } else { prop.setValueIntercept(bean, dbVal); } return dbVal; } catch (Exception e) { bean._ebean_getIntercept().setLoadError(prop.getPropertyIndex(), e); ctx.handleLoadError(prop.getFullBeanName(), e); return prop.getValue(bean); } }