@Override public boolean visitAttribute(AttributeProperty property) { snapshot.put(property.getName(), property.readProperty(object)); return true; }
@Override public void write(DataObject target, Object value) { Object oldValue = property.readProperty(target); property.writeProperty(target, oldValue, value); }
public void injectValueHolder(Object object) throws PropertyException { delegate.injectValueHolder(object); }
public boolean visitAttribute(AttributeProperty property) { property.writePropertyDirectly(to, property.readPropertyDirectly(to), property.readPropertyDirectly(from)); return true; }
public boolean visitAttribute(AttributeProperty property) { String dbAttrPath = property.getAttribute().getDbAttributePath(); // supports merging of partial snapshots... // check for null is cheaper than double lookup // for a key... so check for partial snapshot // only if the value is null Object newValue = snapshot.get(dbAttrPath); if (newValue != null || snapshot.containsKey(dbAttrPath)) { Object curValue = property.readPropertyDirectly(object); Object oldValue = diff != null ? diff.getSnapshotValue(property .getName()) : null; // if value not modified, update it from snapshot, // otherwise leave it alone if (Util.nullSafeEquals(curValue, oldValue) && !Util.nullSafeEquals(newValue, curValue)) { property.writePropertyDirectly(object, oldValue, newValue); } } return true; }
public boolean visitAttribute(AttributeProperty property) { String target = property.getAttribute().getDbAttributePath(); appendColumn(targetSource, target, prefix + target); return true; }
public TargetPropertyWriter getOrCreateWriter(AttributeProperty property) { if (!entity.equals(property.getAttribute().getEntity())) { throw new LmRuntimeException("Property belongs to a different entity: " + property.getName()); } return getOrCreateWriter( property.getName(), ASTDbPath.DB_PREFIX + property.getAttribute().getDbAttributeName(), () -> new TargetAttributePropertyWriter(property) ); }
public boolean visitAttribute(AttributeProperty property) { ObjAttribute attr = property.getAttribute(); String dbAttrPath = attr.getDbAttributePath(); Object value = snapshot.get(dbAttrPath); property.writePropertyDirectly(object, null, value); // note that a check "snaphsot.get(..) == null" would be incorrect in this // case, as NULL value is entirely valid; still save a map lookup by // checking for the null value first if (value == null && !snapshot.containsKey(dbAttrPath)) { isPartialSnapshot[0] = true; } return true; }
public String getName() { return delegate.getName(); }
public boolean visitAttribute(AttributeProperty property) { ObjAttribute objAttr = property.getAttribute(); // processing compound attributes correctly snapshot.put(objAttr.getDbAttributePath(), property.readPropertyDirectly(object)); return true; }
public Object readProperty(Object object) throws PropertyException { return delegate.readProperty(object); }
public void writeProperty(Object object, Object oldValue, Object newValue) throws PropertyException { delegate.writeProperty(object, oldValue, newValue); }
public void writePropertyDirectly(Object object, Object oldValue, Object newValue) throws PropertyException { delegate.writePropertyDirectly(object, oldValue, newValue); } }
public Object readPropertyDirectly(Object object) throws PropertyException { return delegate.readPropertyDirectly(object); }
void indexAddedProperty(PropertyDescriptor property) { if (property instanceof AttributeProperty) { AttributeProperty attributeProperty = (AttributeProperty) property; ObjAttribute attribute = attributeProperty.getAttribute(); if (attribute.isPrimaryKey()) { if (idProperties == null) { idProperties = new ArrayList<>(2); } idProperties.add(attributeProperty); } } else if (property instanceof ArcProperty) { ObjRelationship relationship = ((ArcProperty) property).getRelationship(); ObjRelationship reverseRelationship = relationship.getReverseRelationship(); if (reverseRelationship != null && "java.util.Map".equals(reverseRelationship.getCollectionType())) { if (mapArcProperties == null) { mapArcProperties = new ArrayList<>(2); } mapArcProperties.add((ArcProperty) property); } } }
@Override public boolean visitAttribute(AttributeProperty property) { if (!entity.isIncluded(property.getName())) { return true; } Object value; if (entity.isConfidential(property.getName())) { value = Confidential.getInstance(); } else { String key = property.getAttribute().getDbAttributeName(); value = row.get(key); } if (value != null) { objectChangeSet.attributeChanged(property.getName(), value, null); } return true; }
.getAttribute() .getDbAttributeName()); property.writePropertyDirectly(object, null, value);
@Override public boolean visitAttribute(final AttributeProperty property) { properties.add(property.getName()); return true; }
@Override public boolean willWrite(DataObject target, Object value) { Object oldValue = property.readProperty(target); return !Util.nullSafeEquals(oldValue, value); } }
@Override public boolean visitAttribute(AttributeProperty property) { Object oldValue = snapshot.get(property.getName()); Object newValue = property.readProperty(object); if (!Util.nullSafeEquals(oldValue, newValue)) { modFound[0] = true; } return !modFound[0]; }