use of org.springframework.data.jdbc.core.conversion.AggregateChange in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplate method save.
@Override
public <T> void save(T instance, Class<T> domainType) {
JdbcPersistentEntityInformation<T, ?> entityInformation = context.getRequiredPersistentEntityInformation(domainType);
AggregateChange change = createChange(instance);
publisher.publishEvent(new //
BeforeSave(//
Identifier.ofNullable(entityInformation.getId(instance)), //
instance, //
change));
change.executeWith(interpreter);
publisher.publishEvent(new //
AfterSave(//
Identifier.of(entityInformation.getId(instance)), //
instance, //
change));
}
Aggregations