use of org.springframework.data.jdbc.core.conversion.AggregateChange in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplate method createDeletingChange.
private AggregateChange createDeletingChange(Object id, Object entity, Class<?> domainType) {
AggregateChange aggregateChange = new AggregateChange(Kind.DELETE, domainType, entity);
jdbcEntityDeleteWriter.write(id, aggregateChange);
return aggregateChange;
}
use of org.springframework.data.jdbc.core.conversion.AggregateChange in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplate method createDeletingChange.
private AggregateChange createDeletingChange(Class<?> domainType) {
AggregateChange aggregateChange = new AggregateChange(Kind.DELETE, domainType, null);
jdbcEntityDeleteWriter.write(null, aggregateChange);
return aggregateChange;
}
use of org.springframework.data.jdbc.core.conversion.AggregateChange in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplate method deleteTree.
private void deleteTree(Object id, Object entity, Class<?> domainType) {
AggregateChange change = createDeletingChange(id, entity, domainType);
Specified specifiedId = Identifier.of(id);
Optional<Object> optionalEntity = Optional.ofNullable(entity);
publisher.publishEvent(new BeforeDelete(specifiedId, optionalEntity, change));
change.executeWith(interpreter);
publisher.publishEvent(new AfterDelete(specifiedId, optionalEntity, change));
}
use of org.springframework.data.jdbc.core.conversion.AggregateChange in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplate method deleteAll.
@Override
public void deleteAll(Class<?> domainType) {
AggregateChange change = createDeletingChange(domainType);
change.executeWith(interpreter);
}
use of org.springframework.data.jdbc.core.conversion.AggregateChange in project spring-data-jdbc by spring-projects.
the class JdbcEntityTemplate method createChange.
private <T> AggregateChange createChange(T instance) {
AggregateChange aggregateChange = new AggregateChange(Kind.SAVE, instance.getClass(), instance);
jdbcEntityWriter.write(instance, aggregateChange);
return aggregateChange;
}
Aggregations