public String getName() { return delegate.getName(); }
@Override public boolean visitAttribute(final AttributeProperty property) { properties.add(property.getName()); return true; }
@Override public boolean visitAttribute(AttributeProperty property) { snapshot.put(property.getName(), property.readProperty(object)); return true; }
@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]; }
@Override public boolean visitAttribute(AttributeProperty property) { Object newValue = property.readProperty(object); // no baseline to compare if (snapshot == null) { if (newValue != null) { handler.nodePropertyChanged(nodeId, property.getName(), null, newValue); } } // have baseline to compare else { Object oldValue = snapshot.get(property.getName()); if (!Util.nullSafeEquals(oldValue, newValue)) { handler.nodePropertyChanged(nodeId, property.getName(), oldValue, newValue); } } return true; }
AttributePropertyDecorator(ClassDescriptor owningClassDescriptor, AttributeProperty delegate) { this.delegate = delegate; this.attribute = owningClassDescriptor.getEntity().getAttribute(delegate.getName()); }
@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; }
public boolean visitAttribute(AttributeProperty property) { PropertyDescriptor targetProperty = targetDescriptor .getProperty(property.getName()); targetProperty.writeProperty(target, null, property.readProperty(source)); 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) { 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; }