use of org.eclipse.persistence.sessions.changesets.ObjectChangeSet in project jmix by jmix-framework.
the class EclipselinkAttributeChangesProvider method getOldValueByImplementation.
@Override
@Nullable
protected Object getOldValueByImplementation(Object entity, String attribute) {
checkEntityByImplementation(entity);
PropertyChangeListener propertyChangeListener = ((ChangeTracker) entity)._persistence_getPropertyChangeListener();
ObjectChangeSet objectChanges = ((AttributeChangeListener) propertyChangeListener).getObjectChangeSet();
if (objectChanges != null) {
ChangeRecord changeRecord = objectChanges.getChangesForAttributeNamed(attribute);
if (changeRecord != null) {
return changeRecord.getOldValue();
}
}
return null;
}
use of org.eclipse.persistence.sessions.changesets.ObjectChangeSet in project jmix by jmix-framework.
the class EclipselinkAttributeChangesProvider method buildChangesByImplementation.
@Override
protected void buildChangesByImplementation(AttributeChanges.Builder builder, Object entity, BiFunction<Object, MetaProperty, Object> transformer) {
checkEntityByImplementation(entity);
PropertyChangeListener propertyChangeListener = ((ChangeTracker) entity)._persistence_getPropertyChangeListener();
ObjectChangeSet objectChanges = ((AttributeChangeListener) propertyChangeListener).getObjectChangeSet();
if (objectChanges != null) {
buildChanges(builder, objectChanges, metadata.getClass(entity), transformer);
}
}
use of org.eclipse.persistence.sessions.changesets.ObjectChangeSet in project jmix by jmix-framework.
the class EclipselinkAttributeChangesProvider method getChangedAttributeNamesByImplementation.
@Override
protected Set<String> getChangedAttributeNamesByImplementation(Object entity) {
checkEntityByImplementation(entity);
PropertyChangeListener propertyChangeListener = ((ChangeTracker) entity)._persistence_getPropertyChangeListener();
ObjectChangeSet objectChanges = ((AttributeChangeListener) propertyChangeListener).getObjectChangeSet();
if (objectChanges != null) {
return new HashSet<>(objectChanges.getChangedAttributeNames());
}
return Collections.emptySet();
}
Aggregations