Class BeforeSaveEvent<E>
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.data.cassandra.core.mapping.event.CassandraMappingEvent<T>
org.springframework.data.cassandra.core.mapping.event.AbstractStatementAwareMappingEvent<E>
org.springframework.data.cassandra.core.mapping.event.BeforeSaveEvent<E>
- All Implemented Interfaces:
Serializable
Mapping event
triggered before inserting or updating a row in the database. Before save
is invoked after converting the entity
into a Statement
. This is useful to let
the mapping layer derive values into the statement while the save callback can either update the domain object
without reflecting the changes in the statement. Another use is to inspect the Statement
.- Since:
- 2.1
- Author:
- Lukasz Antoniak, Mark Paluch
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionBeforeSaveEvent
(E source, com.datastax.oss.driver.api.core.CqlIdentifier table, com.datastax.oss.driver.api.core.cql.Statement<?> statement) Create a newBeforeSaveEvent
. -
Method Summary
Methods inherited from class org.springframework.data.cassandra.core.mapping.event.AbstractStatementAwareMappingEvent
getStatement
Methods inherited from class org.springframework.data.cassandra.core.mapping.event.CassandraMappingEvent
getSource, getTableName
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
BeforeSaveEvent
public BeforeSaveEvent(E source, com.datastax.oss.driver.api.core.CqlIdentifier table, com.datastax.oss.driver.api.core.cql.Statement<?> statement) Create a newBeforeSaveEvent
.- Parameters:
source
- must not be null.table
- must not be null.statement
- must not be null.
-