use of org.springframework.data.cassandra.core.mapping.event.AfterDeleteEvent in project spring-data-cassandra by spring-projects.
the class ReactiveCassandraTemplate method doDelete.
Mono<WriteResult> doDelete(Query query, Class<?> entityClass, CqlIdentifier tableName) {
StatementBuilder<Delete> builder = getStatementFactory().delete(query, getRequiredPersistentEntity(entityClass), tableName);
SimpleStatement delete = builder.build();
Mono<WriteResult> writeResult = doExecuteAndFlatMap(delete, ReactiveCassandraTemplate::toWriteResult).doOnSubscribe(it -> maybeEmitEvent(new BeforeDeleteEvent<>(delete, entityClass, tableName)));
return writeResult.doOnNext(it -> maybeEmitEvent(new AfterDeleteEvent<>(delete, entityClass, tableName)));
}
Aggregations