Class StatementFactory
java.lang.Object
org.springframework.data.cassandra.core.StatementFactory
-
Constructor Summary
ConstructorsConstructorDescriptionStatementFactory(CassandraConverter converter) CreateStatementFactorygivenCassandraConverter.StatementFactory(QueryMapper queryMapper, UpdateMapper updateMapper) StatementFactory(UpdateMapper updateMapper) CreateStatementFactorygivenUpdateMapper. -
Method Summary
Modifier and TypeMethodDescriptionStatementBuilder<com.datastax.oss.driver.api.querybuilder.select.Select>count(Query query, CassandraPersistentEntity<?> persistentEntity) Create a COUNT statement by mappingQuerytoSelect.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 mappingQuerytoSelect.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 mappingQuerytoDelete.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 mappingQuerytoDelete.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 mappingidto SELECT … WHERE consideringUpdateOptions.protected QueryMapperReturns theQueryMapperused to mapQueryto CQL-specific data types.protected UpdateMapperReturns theUpdateMapperused to mapUpdateto 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 mappingQuerytoSelect.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 mappingQuerytoSelect.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 mappingidto 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
CreateStatementFactorygivenCassandraConverter.- Parameters:
converter- must not be null.- Since:
- 3.0
-
StatementFactory
CreateStatementFactorygivenUpdateMapper.- Parameters:
updateMapper- must not be null.
-
StatementFactory
- Parameters:
queryMapper- must not be null.updateMapper- must not be null.
-
-
Method Details
-
getQueryMapper
Returns theQueryMapperused to mapQueryto CQL-specific data types.- Returns:
- the
QueryMapperused to mapQueryto CQL-specific data types. - See Also:
-
getUpdateMapper
Returns theUpdateMapperused to mapUpdateto CQL-specific data types.- Returns:
- the
UpdateMapperused to mapUpdateto 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 mappingQuerytoSelect. -
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 mappingQuerytoSelect. -
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 mappingidto 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 mappingQuerytoSelect.- 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 mappingQuerytoSelect.- 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- optionalWriteOptionsto apply to theInsertstatement, 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- optionalWriteOptionsto apply to theInsertstatement, may be null.persistentEntity- theCassandraPersistentEntityto 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 mappingidto 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 mappingQuerytoDelete.- 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 mappingQuerytoDelete.- 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.
-