Class StatementFactory
java.lang.Object
org.springframework.data.cassandra.core.StatementFactory
-
Constructor Summary
ConstructorDescriptionStatementFactory
(CassandraConverter converter) CreateStatementFactory
givenCassandraConverter
.StatementFactory
(QueryMapper queryMapper, UpdateMapper updateMapper) StatementFactory
(UpdateMapper updateMapper) CreateStatementFactory
givenUpdateMapper
. -
Method Summary
Modifier and TypeMethodDescriptionStatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select>
count
(Query query, CassandraPersistentEntity<?> persistentEntity) Create a COUNT statement by mappingQuery
toSelect
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select>
count
(Query query, CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create a COUNT statement by mappingQuery
toSelect
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete>
delete
(Object entity, QueryOptions options, EntityWriter<Object, Object> entityWriter, com.datastax.oss.driver.api.core.CqlIdentifier tableName) StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete>
delete
(Query query, CassandraPersistentEntity<?> persistentEntity) Create a DELETE statement by mappingQuery
toDelete
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete>
delete
(Query query, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create a DELETE statement by mappingQuery
toDelete
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete>
deleteById
(Object id, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create an DELETE statement by mappingid
to SELECT … WHERE consideringUpdateOptions
.protected QueryMapper
Returns theQueryMapper
used to mapQuery
to CQL-specific data types.protected UpdateMapper
Returns theUpdateMapper
used to mapUpdate
to CQL-specific data types.StatementBuilder<com.datastax.oss.driver.api.querybuilder.insert.RegularInsert>
insert
(Object objectToInsert, WriteOptions options) Creates a Query Object for an insert.StatementBuilder<com.datastax.oss.driver.api.querybuilder.insert.RegularInsert>
insert
(Object objectToInsert, WriteOptions options, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Creates a Query Object for an insert.StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select>
select
(Query query, CassandraPersistentEntity<?> persistentEntity) Create a SELECT statement by mappingQuery
toSelect
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select>
select
(Query query, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create a SELECT statement by mappingQuery
toSelect
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select>
selectOneById
(Object id, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create an SELECT statement by mappingid
to SELECT … WHERE consideringUpdateOptions
.StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update>
update
(Object objectToUpdate, WriteOptions options) StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update>
update
(Object objectToUpdate, WriteOptions options, CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update>
update
(Query query, Update update, CassandraPersistentEntity<?> persistentEntity)
-
Constructor Details
-
StatementFactory
CreateStatementFactory
givenCassandraConverter
.- Parameters:
converter
- must not be null.- Since:
- 3.0
-
StatementFactory
CreateStatementFactory
givenUpdateMapper
.- Parameters:
updateMapper
- must not be null.
-
StatementFactory
- Parameters:
queryMapper
- must not be null.updateMapper
- must not be null.
-
-
Method Details
-
getQueryMapper
Returns theQueryMapper
used to mapQuery
to CQL-specific data types.- Returns:
- the
QueryMapper
used to mapQuery
to CQL-specific data types. - See Also:
-
getUpdateMapper
Returns theUpdateMapper
used to mapUpdate
to CQL-specific data types.- Returns:
- the
UpdateMapper
used to mapUpdate
to CQL-specific data types. - See Also:
-
count
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select> count(Query query, CassandraPersistentEntity<?> persistentEntity) Create a COUNT statement by mappingQuery
toSelect
. -
count
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select> count(Query query, CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create a COUNT statement by mappingQuery
toSelect
. -
selectOneById
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select> selectOneById(Object id, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create an SELECT statement by mappingid
to SELECT … WHERE consideringUpdateOptions
.- Parameters:
id
- must not be null.persistentEntity
- must not be null.tableName
- must not be null.- Returns:
- the select builder.
-
select
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select> select(Query query, CassandraPersistentEntity<?> persistentEntity) Create a SELECT statement by mappingQuery
toSelect
.- Parameters:
query
- must not be null.persistentEntity
- must not be null.- Returns:
- the select builder.
-
select
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select> select(Query query, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create a SELECT statement by mappingQuery
toSelect
.- Parameters:
query
- must not be null.persistentEntity
- must not be null.tableName
- must not be null.- Returns:
- the select builder.
- Since:
- 2.1
-
insert
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.insert.RegularInsert> insert(Object objectToInsert, WriteOptions options) Creates a Query Object for an insert.- Parameters:
objectToInsert
- the object to save, must not be null.options
- optionalWriteOptions
to apply to theInsert
statement, may be null.- Returns:
- the select builder.
- Since:
- 3.0
-
insert
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.insert.RegularInsert> insert(Object objectToInsert, WriteOptions options, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Creates a Query Object for an insert.- Parameters:
tableName
- the table name, must not be empty and not null.objectToInsert
- the object to save, must not be null.options
- optionalWriteOptions
to apply to theInsert
statement, may be null.persistentEntity
- theCassandraPersistentEntity
to write insert values.- Returns:
- the select builder.
-
update
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update> update(Query query, Update update, CassandraPersistentEntity<?> persistentEntity) - Parameters:
query
- must not be null.persistentEntity
- must not be null.- Returns:
- the update builder.
-
update
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update> update(Object objectToUpdate, WriteOptions options) - Parameters:
objectToUpdate
- must not be null.options
- must not be null.- Returns:
- the update builder.
- Since:
- 3.0
-
update
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.update.Update> update(Object objectToUpdate, WriteOptions options, CassandraPersistentEntity<?> entity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) - Parameters:
objectToUpdate
- must not be null.options
- must not be null.entity
- must not be null.tableName
- must not be null.- Returns:
- the update builder.
-
deleteById
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete> deleteById(Object id, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create an DELETE statement by mappingid
to SELECT … WHERE consideringUpdateOptions
.- Parameters:
id
- must not be null.persistentEntity
- must not be null.tableName
- must not be null.- Returns:
- the delete builder.
-
delete
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete> delete(Query query, CassandraPersistentEntity<?> persistentEntity) Create a DELETE statement by mappingQuery
toDelete
.- Parameters:
query
- must not be null.persistentEntity
- must not be null.- Returns:
- the delete builder.
-
delete
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete> delete(Query query, CassandraPersistentEntity<?> persistentEntity, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Create a DELETE statement by mappingQuery
toDelete
.- Parameters:
query
- must not be null.persistentEntity
- must not be null.tableName
- must not be null.- Returns:
- the delete builder.
-
delete
public StatementBuilder<com.datastax.oss.driver.api.querybuilder.delete.Delete> delete(Object entity, QueryOptions options, EntityWriter<Object, Object> entityWriter, com.datastax.oss.driver.api.core.CqlIdentifier tableName) - Parameters:
entity
- must not be null.options
- must not be null.entityWriter
- must not be null.tableName
- must not be null.- Returns:
- the delete builder.
-