Search in sources :

Example 6 with BeforeDeleteEvent

use of org.springframework.cloud.gcp.data.spanner.core.mapping.event.BeforeDeleteEvent in project spring-cloud-gcp by spring-cloud.

the class SpannerTemplate method applyDeleteMutations.

private void applyDeleteMutations(Class<?> entityClass, KeySet keys, List<Mutation> mutations) {
    maybeEmitEvent(new BeforeDeleteEvent(mutations, null, keys, entityClass));
    applyMutations(mutations);
    maybeEmitEvent(new AfterDeleteEvent(mutations, null, keys, entityClass));
}
Also used : AfterDeleteEvent(org.springframework.cloud.gcp.data.spanner.core.mapping.event.AfterDeleteEvent) BeforeDeleteEvent(org.springframework.cloud.gcp.data.spanner.core.mapping.event.BeforeDeleteEvent)

Aggregations

AfterDeleteEvent (org.springframework.cloud.gcp.data.spanner.core.mapping.event.AfterDeleteEvent)6 BeforeDeleteEvent (org.springframework.cloud.gcp.data.spanner.core.mapping.event.BeforeDeleteEvent)6 Mutation (com.google.cloud.spanner.Mutation)4 Test (org.junit.Test)4 KeySet (com.google.cloud.spanner.KeySet)2 Key (com.google.cloud.spanner.Key)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 PrimaryKey (org.springframework.cloud.gcp.data.spanner.core.mapping.PrimaryKey)1