Class CassandraTemplate
- All Implemented Interfaces:
Aware
,ApplicationContextAware
,ApplicationEventPublisherAware
,CassandraOperations
,ExecutableDeleteOperation
,ExecutableInsertOperation
,ExecutableSelectOperation
,ExecutableUpdateOperation
,FluentCassandraOperations
- Direct Known Subclasses:
CassandraAdminTemplate
CassandraOperations
. It simplifies the use of Cassandra usage and helps to avoid
common errors. It executes core Cassandra workflow. This class executes CQL queries or updates, initiating iteration
over ResultSet
and catching Cassandra exceptions and translating them to the generic, more informative
exception hierarchy defined in the org.springframework.dao
package.
Can be used within a service implementation via direct instantiation with a CqlSession
reference, or get
prepared in an application context and given to services as bean reference.
This class supports the use of prepared statements when enabling setUsePreparedStatements(boolean)
. All
statements created by methods of this class (such as select(Query, Class)
or
update(Query, org.springframework.data.cassandra.core.query.Update, Class)
will be executed as prepared
statements. Also, statements accepted by methods (such as select(String, Class)
or
and others
) will be prepared prior to execution. Note that Statement
objects passed to methods must be SimpleStatement
so that these can be prepared.
Note: The CqlSession
should always be configured as a bean in the application context, in the first case
given to the service directly, in the second case to the prepared template.
- Since:
- 2.0
- Author:
- Mark Paluch, John Blum, Lukasz Antoniak, Sam Lightfoot
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Utility class to prepare aSimpleStatement
and bind values associated with the statement to aBoundStatement
.Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableDeleteOperation
ExecutableDeleteOperation.DeleteWithQuery, ExecutableDeleteOperation.DeleteWithTable, ExecutableDeleteOperation.ExecutableDelete, ExecutableDeleteOperation.TerminatingDelete
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableInsertOperation
ExecutableInsertOperation.ExecutableInsert<T>, ExecutableInsertOperation.InsertWithOptions<T>, ExecutableInsertOperation.InsertWithTable<T>, ExecutableInsertOperation.TerminatingInsert<T>
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableSelectOperation
ExecutableSelectOperation.ExecutableSelect<T>, ExecutableSelectOperation.SelectWithProjection<T>, ExecutableSelectOperation.SelectWithQuery<T>, ExecutableSelectOperation.SelectWithTable<T>, ExecutableSelectOperation.TerminatingSelect<T>
Nested classes/interfaces inherited from interface org.springframework.data.cassandra.core.ExecutableUpdateOperation
ExecutableUpdateOperation.ExecutableUpdate, ExecutableUpdateOperation.TerminatingUpdate, ExecutableUpdateOperation.UpdateWithQuery, ExecutableUpdateOperation.UpdateWithTable
-
Constructor Summary
ConstructorDescriptionCassandraTemplate
(com.datastax.oss.driver.api.core.CqlSession session) Creates an instance ofCassandraTemplate
initialized with the givenCqlSession
and a defaultMappingCassandraConverter
.CassandraTemplate
(com.datastax.oss.driver.api.core.CqlSession session, CassandraConverter converter) Creates an instance ofCassandraTemplate
initialized with the givenCqlSession
andCassandraConverter
.CassandraTemplate
(CqlOperations cqlOperations, CassandraConverter converter) Creates an instance ofCassandraTemplate
initialized with the givenCqlOperations
andCassandraConverter
.CassandraTemplate
(SessionFactory sessionFactory, CassandraConverter converter) Creates an instance ofCassandraTemplate
initialized with the givenSessionFactory
andCassandraConverter
. -
Method Summary
Modifier and TypeMethodDescriptionbatchOps
(com.datastax.oss.driver.api.core.cql.BatchType batchType) Returns a newCassandraBatchOperations
.long
Returns the number of rows for the given entity class.long
Returns the number of rows for the given entity class applyingQuery
.createPreparedStatementHandler
(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Create a new statement-basedCassandraTemplate.PreparedStatementHandler
using the statement passed in.Begin creating aDELETE
operation for the givendomainType
.void
Delete the given entity and return the entity if the delete statement was applied.delete
(Object entity, QueryOptions options) Delete the given entity applyingQueryOptions
and return the entity if the delete statement was applied.boolean
Remove entities (rows)/columns from the table byQuery
.boolean
deleteById
(Object id, Class<?> entityClass) Remove the given object from the table by id.com.datastax.oss.driver.api.core.cql.ResultSet
execute
(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Execute the given CassandraStatement
.boolean
Determine whether a row ofentityClass
with the givenid
exists.boolean
Determine whether the result forentityClass
Query
yields at least one row.Returns the underlyingCassandraConverter
.Expose the underlyingCqlOperations
to allow CQL operations.protected org.springframework.data.cassandra.core.EntityOperations
Returns theEntityOperations
used to perform data access operations on an entity inside a Cassandra data source.protected SpelAwareProxyProjectionFactory
Deprecated.protected StatementFactory
Returns theStatementFactory
used by this template to construct and run Cassandra CQL statements.com.datastax.oss.driver.api.core.CqlIdentifier
getTableName
(Class<?> entityClass) The table name used for the specified class by this template.Begin creating anINSERT
operation for givendomainType
.<T> T
insert
(T entity) Insert the given entity and return the entity if the insert was applied.<T> EntityWriteResult<T>
insert
(T entity, InsertOptions options) Insert the given entity applyingWriteOptions
and return the entity if the insert was applied.boolean
Returns whether this instance is configured to useprepared statements
.protected <T> T
maybeCallBeforeConvert
(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName) protected <T> T
maybeCallBeforeSave
(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName, com.datastax.oss.driver.api.core.cql.Statement<?> statement) protected <E extends CassandraMappingEvent<T>,
T>
voidmaybeEmitEvent
(Supplier<E> event) Begin creating a CassandraSELECT
query operation for the givendomainType
.<T> List<T>
Execute aSELECT
query and convert the resulting items to aList
of entities.<T> List<T>
Execute aSELECT
query and convert the resulting items to aList
of entities.<T> List<T>
Execute aSELECT
query and convert the resulting items to aList
of entities.<T> T
Execute aSELECT
query and convert the resulting item to an entity.<T> T
Execute aSELECT
query and convert the resulting item to an entity.<T> T
Execute aSELECT
query and convert the resulting item to an entity.<T> T
selectOneById
(Object id, Class<T> entityClass) Execute the Select byid
for the givenentityClass
.void
setApplicationContext
(ApplicationContext applicationContext) void
setApplicationEventPublisher
(ApplicationEventPublisher applicationEventPublisher) void
setEntityCallbacks
(EntityCallbacks entityCallbacks) ConfigureEntityCallbacks
to pre-/post-process entities during persistence operations.void
setEntityLifecycleEventsEnabled
(boolean enabled) Configure whether lifecycle events such asAfterLoadEvent
,BeforeSaveEvent
, etc. should be published or whether emission should be suppressed.void
setUsePreparedStatements
(boolean usePreparedStatements) Enable/disableprepared statements
usage.<T> Slice<T>
Execute aSELECT
query with paging and convert the result set to aSlice
of entities.<T> Slice<T>
Execute aSELECT
query with paging and convert the result set to aSlice
of entities.<T> Stream<T>
Execute aSELECT
query and convert the resulting items to aIterator
of entities.<T> Stream<T>
Execute aSELECT
query and convert the resulting items to aIterator
of entities.<T> Stream<T>
Execute aSELECT
query and convert the resulting items to aIterator
of entities.void
Execute aTRUNCATE
query to remove all entities of a given class.Begin creating anUPDATE
operation for the givendomainType
.boolean
Update the queried entities and return true if the update was applied.<T> T
update
(T entity) Update the given entity and return the entity if the update was applied.<T> EntityWriteResult<T>
update
(T entity, UpdateOptions options) Update the given entity applyingWriteOptions
and return the entity if the update was applied.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.cassandra.core.CassandraOperations
batchOps, delete
-
Constructor Details
-
CassandraTemplate
public CassandraTemplate(com.datastax.oss.driver.api.core.CqlSession session) Creates an instance ofCassandraTemplate
initialized with the givenCqlSession
and a defaultMappingCassandraConverter
.- Parameters:
session
-CqlSession
used to interact with Cassandra; must not be null.- See Also:
-
CassandraConverter
CqlSession
-
CassandraTemplate
public CassandraTemplate(com.datastax.oss.driver.api.core.CqlSession session, CassandraConverter converter) Creates an instance ofCassandraTemplate
initialized with the givenCqlSession
andCassandraConverter
.- Parameters:
session
-CqlSession
used to interact with Cassandra; must not be null.converter
-CassandraConverter
used to convert between Java and Cassandra types; must not be null.- See Also:
-
CassandraConverter
CqlSession
-
CassandraTemplate
Creates an instance ofCassandraTemplate
initialized with the givenSessionFactory
andCassandraConverter
.- Parameters:
sessionFactory
-SessionFactory
used to interact with Cassandra; must not be null.converter
-CassandraConverter
used to convert between Java and Cassandra types; must not be null.- See Also:
-
CassandraTemplate
Creates an instance ofCassandraTemplate
initialized with the givenCqlOperations
andCassandraConverter
.- Parameters:
cqlOperations
-CqlOperations
used to interact with Cassandra; must not be null.converter
-CassandraConverter
used to convert between Java and Cassandra types; must not be null.- See Also:
-
CassandraConverter
CqlSession
-
-
Method Details
-
batchOps
Description copied from interface:CassandraOperations
Returns a newCassandraBatchOperations
. EachCassandraBatchOperations
instance can be executed only once, so you need to obtain newCassandraBatchOperations
instances for each batch.- Specified by:
batchOps
in interfaceCassandraOperations
- Parameters:
batchType
- must not be null.- Returns:
- a new
ReactiveCassandraBatchOperations
associated with the given entity class.
-
setApplicationEventPublisher
- Specified by:
setApplicationEventPublisher
in interfaceApplicationEventPublisherAware
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
setEntityCallbacks
ConfigureEntityCallbacks
to pre-/post-process entities during persistence operations.- Parameters:
entityCallbacks
-
-
setEntityLifecycleEventsEnabled
public void setEntityLifecycleEventsEnabled(boolean enabled) Configure whether lifecycle events such asAfterLoadEvent
,BeforeSaveEvent
, etc. should be published or whether emission should be suppressed. Enabled by default.- Parameters:
enabled
-true
to enable entity lifecycle events;false
to disable entity lifecycle events.- Since:
- 4.0
- See Also:
-
getCqlOperations
Description copied from interface:CassandraOperations
Expose the underlyingCqlOperations
to allow CQL operations.- Specified by:
getCqlOperations
in interfaceCassandraOperations
- Returns:
- the underlying
CqlOperations
. - See Also:
-
getConverter
Description copied from interface:CassandraOperations
Returns the underlyingCassandraConverter
.- Specified by:
getConverter
in interfaceCassandraOperations
- Returns:
- the underlying
CassandraConverter
.
-
isUsePreparedStatements
public boolean isUsePreparedStatements()Returns whether this instance is configured to useprepared statements
. If enabled (default), then all persistence methods (such asselect(java.lang.String, java.lang.Class<T>)
,update(org.springframework.data.cassandra.core.query.Query, org.springframework.data.cassandra.core.query.Update, java.lang.Class<?>)
, and others) will make use of prepared statements. Note that methods accepting aStatement
must be called withSimpleStatement
instances to participate in statement preparation.- Returns:
- true if prepared statements usage is enabled; false otherwise.
- Since:
- 3.2
-
setUsePreparedStatements
public void setUsePreparedStatements(boolean usePreparedStatements) Enable/disableprepared statements
usage. If enabled (default), then all persistence methods (such asselect(java.lang.String, java.lang.Class<T>)
,update(org.springframework.data.cassandra.core.query.Query, org.springframework.data.cassandra.core.query.Update, java.lang.Class<?>)
, and others) will make use of prepared statements. Note that methods accepting aStatement
must be called withSimpleStatement
instances to participate in statement preparation.- Parameters:
usePreparedStatements
- whether to use prepared statements.- Since:
- 3.2
-
getEntityOperations
protected org.springframework.data.cassandra.core.EntityOperations getEntityOperations()Returns theEntityOperations
used to perform data access operations on an entity inside a Cassandra data source.- Returns:
- the configured
EntityOperations
for this template. - See Also:
-
EntityOperations
-
getProjectionFactory
Deprecated.since 3.4, useCassandraConverter.getProjectionFactory()
instead.Returns a reference to the configuredProjectionFactory
used by this template to process CQL query projections.- Returns:
- a reference to the configured
ProjectionFactory
used by this template to process CQL query projections. - Since:
- 2.1
- See Also:
-
getStatementFactory
Returns theStatementFactory
used by this template to construct and run Cassandra CQL statements.- Returns:
- the
StatementFactory
used by this template to construct and run Cassandra CQL statements. - Since:
- 2.1
- See Also:
-
getTableName
Description copied from interface:CassandraOperations
The table name used for the specified class by this template.- Specified by:
getTableName
in interfaceCassandraOperations
- Parameters:
entityClass
- The entity type must not be null.- Returns:
- the
CqlIdentifier
-
select
Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting items to aList
of entities.- Specified by:
select
in interfaceCassandraOperations
- Parameters:
cql
- must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted results
-
selectOne
Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting item to an entity.- Specified by:
selectOne
in interfaceCassandraOperations
- Parameters:
cql
- must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted object or null.
-
stream
Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting items to aIterator
of entities.Returns a
Iterator
that wraps the CassandraResultSet
.- Specified by:
stream
in interfaceCassandraOperations
- Type Parameters:
T
- element return type.- Parameters:
cql
- query to execute. Must not be empty or null.entityClass
- Class type of the elements in theIterator
stream. Must not be null.- Returns:
- an
Iterator
(stream) over the elements in the query result set. - Throws:
DataAccessException
- if there is any problem executing the query.
-
execute
public com.datastax.oss.driver.api.core.cql.ResultSet execute(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Description copied from interface:CassandraOperations
Execute the given CassandraStatement
. Any errors that result from executing this command will be converted into Spring's DAO exception hierarchy.- Specified by:
execute
in interfaceCassandraOperations
- Parameters:
statement
- a CassandraStatement
, must not be null.- Returns:
- the
ResultSet
.
-
select
public <T> List<T> select(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting items to aList
of entities.- Specified by:
select
in interfaceCassandraOperations
- Parameters:
statement
- must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted results
-
selectOne
public <T> T selectOne(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting item to an entity.- Specified by:
selectOne
in interfaceCassandraOperations
- Parameters:
statement
- must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted object or null.
-
slice
public <T> Slice<T> slice(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) Description copied from interface:CassandraOperations
Execute aSELECT
query with paging and convert the result set to aSlice
of entities. A sliced query translates the effectivefetch size
to the page size.- Specified by:
slice
in interfaceCassandraOperations
- Parameters:
statement
- the CQL statement, must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted results
-
stream
public <T> Stream<T> stream(com.datastax.oss.driver.api.core.cql.Statement<?> statement, Class<T> entityClass) throws DataAccessException Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting items to aIterator
of entities.Returns a
Iterator
that wraps the CassandraResultSet
.- Specified by:
stream
in interfaceCassandraOperations
- Type Parameters:
T
- element return type.- Parameters:
statement
- query to execute. Must not be empty or null.entityClass
- Class type of the elements in theIterator
stream. Must not be null.- Returns:
- an
Iterator
(stream) over the elements in the query result set. - Throws:
DataAccessException
- if there is any problem executing the query.
-
select
Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting items to aList
of entities.- Specified by:
select
in interfaceCassandraOperations
- Parameters:
query
- must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted results
- Throws:
DataAccessException
- if there is any problem executing the query.
-
selectOne
Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting item to an entity.- Specified by:
selectOne
in interfaceCassandraOperations
- Parameters:
query
- must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted object or null.
- Throws:
DataAccessException
- if there is any problem executing the query.
-
slice
Description copied from interface:CassandraOperations
Execute aSELECT
query with paging and convert the result set to aSlice
of entities.- Specified by:
slice
in interfaceCassandraOperations
- Parameters:
query
- the query object used to create a CQL statement, must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted results
- Throws:
DataAccessException
- if there is any problem executing the query.- See Also:
-
stream
Description copied from interface:CassandraOperations
Execute aSELECT
query and convert the resulting items to aIterator
of entities.Returns a
Iterator
that wraps the CassandraResultSet
.- Specified by:
stream
in interfaceCassandraOperations
- Type Parameters:
T
- element return type.- Parameters:
query
- query to execute. Must not be empty or null.entityClass
- Class type of the elements in theIterator
stream. Must not be null.- Returns:
- an
Iterator
(stream) over the elements in the query result set. - Throws:
DataAccessException
- if there is any problem executing the query.
-
update
Description copied from interface:CassandraOperations
Update the queried entities and return true if the update was applied.- Specified by:
update
in interfaceCassandraOperations
- Parameters:
query
- must not be null.update
- must not be null.entityClass
- The entity type must not be null.- Throws:
DataAccessException
- if there is any problem executing the query.
-
delete
Description copied from interface:CassandraOperations
Remove entities (rows)/columns from the table byQuery
.- Specified by:
delete
in interfaceCassandraOperations
- Parameters:
query
- must not be null.entityClass
- The entity type must not be null.- Throws:
DataAccessException
- if there is any problem executing the query.
-
count
Description copied from interface:CassandraOperations
Returns the number of rows for the given entity class.- Specified by:
count
in interfaceCassandraOperations
- Parameters:
entityClass
-type
of the entity; must not be null.- Returns:
- the number of existing entities.
-
count
Description copied from interface:CassandraOperations
Returns the number of rows for the given entity class applyingQuery
. This overridden method allows users to further refine the selection criteria using aQuery
predicate to determine how many entities of the giventype
match the criteria.- Specified by:
count
in interfaceCassandraOperations
- Parameters:
query
- user-defined countQuery
to execute; must not be null.entityClass
-type
of the entity; must not be null.- Returns:
- the number of existing entities.
- Throws:
DataAccessException
- if any problem occurs while executing the query.
-
exists
Description copied from interface:CassandraOperations
Determine whether a row ofentityClass
with the givenid
exists.- Specified by:
exists
in interfaceCassandraOperations
- Parameters:
id
- Id value. For single primary keys it's the plain value. For composite primary keys either, it's an instance of eitherPrimaryKeyClass
orMapId
. Must not be null.entityClass
-type
of the entity; must not be null.- Returns:
- true if the object exists.
-
exists
Description copied from interface:CassandraOperations
Determine whether the result forentityClass
Query
yields at least one row.- Specified by:
exists
in interfaceCassandraOperations
- Parameters:
query
- user-defined existsQuery
to execute; must not be null.entityClass
-type
of the entity; must not be null.- Returns:
- true if the object exists.
- Throws:
DataAccessException
- if any problem occurs while executing the query.
-
selectOneById
Description copied from interface:CassandraOperations
Execute the Select byid
for the givenentityClass
.- Specified by:
selectOneById
in interfaceCassandraOperations
- Parameters:
id
- the Id value. For single primary keys it's the plain value. For composite primary keys either thePrimaryKeyClass
orMapId
. Must not be null.entityClass
- The entity type must not be null.- Returns:
- the converted object or null.
-
insert
public <T> T insert(T entity) Description copied from interface:CassandraOperations
Insert the given entity and return the entity if the insert was applied.- Specified by:
insert
in interfaceCassandraOperations
- Parameters:
entity
- The entity to insert, must not be null.- Returns:
- the inserted entity.
-
insert
Description copied from interface:CassandraOperations
Insert the given entity applyingWriteOptions
and return the entity if the insert was applied.- Specified by:
insert
in interfaceCassandraOperations
- Parameters:
entity
- The entity to insert, must not be null.options
- must not be null.- Returns:
- the
EntityWriteResult
for this operation. - See Also:
-
update
public <T> T update(T entity) Description copied from interface:CassandraOperations
Update the given entity and return the entity if the update was applied.- Specified by:
update
in interfaceCassandraOperations
- Parameters:
entity
- The entity to update, must not be null.- Returns:
- the updated entity.
-
update
Description copied from interface:CassandraOperations
Update the given entity applyingWriteOptions
and return the entity if the update was applied.- Specified by:
update
in interfaceCassandraOperations
- Parameters:
entity
- The entity to update, must not be null.options
- must not be null.- Returns:
- the
EntityWriteResult
for this operation. - See Also:
-
delete
Description copied from interface:CassandraOperations
Delete the given entity and return the entity if the delete statement was applied.- Specified by:
delete
in interfaceCassandraOperations
- Parameters:
entity
- must not be null.
-
delete
Description copied from interface:CassandraOperations
Delete the given entity applyingQueryOptions
and return the entity if the delete statement was applied.- Specified by:
delete
in interfaceCassandraOperations
- Parameters:
entity
- must not be null.options
- must not be null.- Returns:
- the
WriteResult
for this operation. - See Also:
-
deleteById
Description copied from interface:CassandraOperations
Remove the given object from the table by id.- Specified by:
deleteById
in interfaceCassandraOperations
- Parameters:
id
- the Id value. For single primary keys it's the plain value. For composite primary keys either thePrimaryKeyClass
orMapId
. Must not be null.entityClass
- The entity type must not be null.
-
truncate
Description copied from interface:CassandraOperations
Execute aTRUNCATE
query to remove all entities of a given class.- Specified by:
truncate
in interfaceCassandraOperations
- Parameters:
entityClass
- The entity type must not be null.
-
query
Description copied from interface:ExecutableSelectOperation
Begin creating a CassandraSELECT
query operation for the givendomainType
.- Specified by:
query
in interfaceExecutableSelectOperation
- Type Parameters:
T
-type
of the application domain object.- Parameters:
domainType
-type
to domain object to query; must not be null.- Returns:
- new instance of
ExecutableSelectOperation.ExecutableSelect
. - See Also:
-
insert
Description copied from interface:ExecutableInsertOperation
Begin creating anINSERT
operation for givendomainType
.- Specified by:
insert
in interfaceExecutableInsertOperation
- Parameters:
domainType
-type
of domain object to insert; must not be null.- Returns:
- new instance of
ExecutableInsertOperation.ExecutableInsert
. - See Also:
-
update
Description copied from interface:ExecutableUpdateOperation
Begin creating anUPDATE
operation for the givendomainType
.- Specified by:
update
in interfaceExecutableUpdateOperation
- Parameters:
domainType
-type
of domain object to update; must not be null.- Returns:
- new instance of
ExecutableUpdateOperation.ExecutableUpdate
.
-
delete
Description copied from interface:ExecutableDeleteOperation
Begin creating aDELETE
operation for the givendomainType
.- Specified by:
delete
in interfaceExecutableDeleteOperation
- Parameters:
domainType
-type
of domain object to delete; must not be null.- Returns:
- new instance of
ExecutableDeleteOperation.ExecutableDelete
. - See Also:
-
createPreparedStatementHandler
protected CassandraTemplate.PreparedStatementHandler createPreparedStatementHandler(com.datastax.oss.driver.api.core.cql.Statement<?> statement) Create a new statement-basedCassandraTemplate.PreparedStatementHandler
using the statement passed in.This method allows for the creation to be overridden by subclasses.
- Parameters:
statement
- the statement to be prepared.- Returns:
- the new
CassandraTemplate.PreparedStatementHandler
to use. - Since:
- 3.3.3
-
maybeEmitEvent
-
maybeCallBeforeConvert
protected <T> T maybeCallBeforeConvert(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName) -
maybeCallBeforeSave
protected <T> T maybeCallBeforeSave(T object, com.datastax.oss.driver.api.core.CqlIdentifier tableName, com.datastax.oss.driver.api.core.cql.Statement<?> statement)
-
CassandraConverter.getProjectionFactory()
instead.