Module spring.data.cassandra
Class SpecificationBuilder
java.lang.Object
org.springframework.data.cassandra.core.cql.keyspace.SpecificationBuilder
Entrypoint to create CQL specifications to add, alter and delete CQL objects such as tables and index.
Specifications can be rendered to CQL using
CqlGenerator.toCql(CqlSpecification) for direct usage
with the database.
- Since:
- 4.4
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic AddColumnSpecificationaddColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type) static AddColumnSpecificationstatic AlterColumnSpecificationalterColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type) Entry point into theAlterColumnSpecification's fluent API givennameandDataTypeto alter a column.static AlterColumnSpecificationalterColumn(String name, com.datastax.oss.driver.api.core.type.DataType type) Entry point into theAlterColumnSpecification's fluent API givennameandDataTypeto alter a column.static AlterKeyspaceSpecificationalterKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theAlterKeyspaceSpecification's fluent API givennameto alter a keyspace.static AlterKeyspaceSpecificationalterKeyspace(String name) Entry point into theAlterKeyspaceSpecification's fluent API givennameto alter a keyspace.static AlterTableSpecificationalterTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table.static AlterTableSpecificationalterTable(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table.static AlterTableSpecificationalterTable(String tableName) Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table.static AlterTableSpecificationalterTable(String keyspace, String tableName) Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table.static AlterUserTypeSpecificationEntry point into theAlterColumnSpecification's fluent API giventypeNameto alter a user type.static CreateIndexSpecificationEntry point into theCreateIndexSpecification's fluent API to create an index.static CreateIndexSpecificationcreateIndex(com.datastax.oss.driver.api.core.CqlIdentifier indexName) Entry point into theCreateIndexSpecification's fluent API givenindexNameto create an index.static CreateIndexSpecificationcreateIndex(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier indexName) Entry point into theCreateIndexSpecification's fluent API givenkeyspaceandindexNameto create an index.static CreateIndexSpecificationcreateIndex(String indexName) Entry point into theCreateIndexSpecification's fluent API givenindexNameto create an index.static CreateIndexSpecificationcreateIndex(String keyspace, String indexName) Entry point into theCreateIndexSpecification's fluent API givenindexNameto create an index.static CreateKeyspaceSpecificationcreateKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace.static CreateKeyspaceSpecificationcreateKeyspace(String name) Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace.static CreateTableSpecificationcreateTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theCreateTableSpecification's fluent API giventableNameto create a table.static CreateTableSpecificationcreateTable(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theCreateTableSpecification's fluent API giventableNameto create a table.static CreateTableSpecificationcreateTable(String tableName) Entry point into theCreateTableSpecification's fluent API giventableNameto create a table.static CreateTableSpecificationcreateTable(String keyspace, String tableName) Entry point into theCreateTableSpecification's fluent API giventableNameto create a table.static CreateUserTypeSpecificationcreateType(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateUserTypeSpecification's fluent API giventypeNameto create a type.static CreateUserTypeSpecificationcreateType(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateUserTypeSpecification's fluent API giventypeNameto create a type.static CreateUserTypeSpecificationcreateType(String typeName) Entry point into theCreateUserTypeSpecification's fluent API givennameto create a type.static CreateUserTypeSpecificationcreateType(String keyspace, String typeName) Entry point into theCreateUserTypeSpecification's fluent API givennameto create a type.static DropColumnSpecificationdropColumn(com.datastax.oss.driver.api.core.CqlIdentifier name) Create a newDropColumnSpecificationfor the givenname.static DropColumnSpecificationdropColumn(String name) Create a newDropColumnSpecificationfor the givenname.static DropIndexSpecificationdropIndex(com.datastax.oss.driver.api.core.CqlIdentifier indexName) Create a newDropIndexSpecificationfor the givenindexName.static DropIndexSpecificationdropIndex(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier indexName) Create a newDropIndexSpecificationfor the givenindexName.static DropIndexSpecificationCreate a newDropIndexSpecificationfor the givenindexName.static DropIndexSpecificationCreate a newDropIndexSpecificationfor the givenindexName.static DropKeyspaceSpecificationdropKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Create a newDropKeyspaceSpecificationfor the givenname.static DropKeyspaceSpecificationdropKeyspace(String name) Create a newDropKeyspaceSpecificationfor the givenname.static DropTableSpecificationdropTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theDropTableSpecification's fluent API giventableNameto drop a table.static DropTableSpecificationdropTable(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theDropTableSpecification's fluent API giventableNameto drop a table.static DropTableSpecificationEntry point into theDropTableSpecification's fluent APItableNameto drop a table.static DropTableSpecificationEntry point into theDropTableSpecification's fluent API giventableNameto drop a table.static DropUserTypeSpecificationdropType(com.datastax.oss.driver.api.core.CqlIdentifier typeName) Entry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type.static DropUserTypeSpecificationdropType(com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier typeName) Entry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type.static DropUserTypeSpecificationEntry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type.static DropUserTypeSpecificationEntry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type.
-
Method Details
-
createKeyspace
Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace. Convenient if imported statically.- Parameters:
name- must not be null or empty.- Returns:
- a new
CreateKeyspaceSpecification.
-
createKeyspace
public static CreateKeyspaceSpecification createKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateKeyspaceSpecification's fluent API givennameto create a keyspace. Convenient if imported statically.- Parameters:
name- must not be null.- Returns:
- a new
CreateKeyspaceSpecification.
-
alterKeyspace
Entry point into theAlterKeyspaceSpecification's fluent API givennameto alter a keyspace. Convenient if imported statically.- Parameters:
name- must not be null or empty.- Returns:
- a new
AlterKeyspaceSpecification.
-
alterKeyspace
public static AlterKeyspaceSpecification alterKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theAlterKeyspaceSpecification's fluent API givennameto alter a keyspace. Convenient if imported statically.- Parameters:
name- must not be null or empty.- Returns:
- a new
AlterKeyspaceSpecification.
-
dropKeyspace
Create a newDropKeyspaceSpecificationfor the givenname.- Parameters:
name- must not be null or empty.- Returns:
- a new
DropKeyspaceSpecification.
-
dropKeyspace
public static DropKeyspaceSpecification dropKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier name) Create a newDropKeyspaceSpecificationfor the givenname.- Parameters:
name- must not be null.- Returns:
- a new
DropKeyspaceSpecification.
-
createTable
Entry point into theCreateTableSpecification's fluent API giventableNameto create a table. Convenient if imported statically.- Parameters:
tableName- must not be null or empty.- Returns:
- a new
CreateTableSpecification.
-
createTable
Entry point into theCreateTableSpecification's fluent API giventableNameto create a table. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the table name is prefixed withkeyspace.- Parameters:
keyspace- can be null.tableName- must not be null.- Returns:
- a new
CreateTableSpecification.
-
createTable
public static CreateTableSpecification createTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theCreateTableSpecification's fluent API giventableNameto create a table. Convenient if imported statically.- Parameters:
tableName- must not be null.- Returns:
- a new
CreateTableSpecification.
-
createTable
public static CreateTableSpecification createTable(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theCreateTableSpecification's fluent API giventableNameto create a table. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the table name is prefixed withkeyspace.- Parameters:
keyspace- can be null.tableName- must not be null.- Returns:
- a new
CreateTableSpecification.
-
alterTable
Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table. Convenient if imported statically.- Parameters:
tableName- must not be null or empty.- Returns:
- a new
AlterTableSpecification.
-
alterTable
Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the table name is prefixed withkeyspace.- Parameters:
keyspace- can be null.tableName- must not be null.- Returns:
- a new
AlterTableSpecification.
-
alterTable
public static AlterTableSpecification alterTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table. Convenient if imported statically.- Parameters:
tableName- must not be null.- Returns:
- a new
AlterTableSpecification.
-
alterTable
public static AlterTableSpecification alterTable(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theAlterTableSpecification's fluent API giventableNameto alter a table. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the table name is prefixed withkeyspace.- Parameters:
keyspace- can be null.tableName- must not be null.- Returns:
- a new
AlterTableSpecification.
-
dropTable
Entry point into theDropTableSpecification's fluent APItableNameto drop a table. Convenient if imported statically.- Parameters:
tableName- must not be null or empty.- Returns:
- a new
DropTableSpecification.
-
dropTable
Entry point into theDropTableSpecification's fluent API giventableNameto drop a table. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the table name is prefixed withkeyspace.- Parameters:
keyspace- can be null.tableName- must not be null.- Returns:
- a new
DropTableSpecification.
-
dropTable
public static DropTableSpecification dropTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theDropTableSpecification's fluent API giventableNameto drop a table. Convenient if imported statically.- Parameters:
tableName- must not be null.- Returns:
- a new
DropTableSpecification.
-
dropTable
public static DropTableSpecification dropTable(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theDropTableSpecification's fluent API giventableNameto drop a table. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the table name is prefixed withkeyspace.- Parameters:
keyspace- can be null.tableName- must not be null.- Returns:
- a new
DropTableSpecification.
-
addColumn
public static AddColumnSpecification addColumn(String name, com.datastax.oss.driver.api.core.type.DataType type) - Parameters:
name- must not be null or empty.type- must not be null.- Returns:
- a new
AddColumnSpecification.
-
addColumn
public static AddColumnSpecification addColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type) - Parameters:
name- must not be null.type- must not be null.- Returns:
- a new
AddColumnSpecification.
-
alterColumn
public static AlterColumnSpecification alterColumn(String name, com.datastax.oss.driver.api.core.type.DataType type) Entry point into theAlterColumnSpecification's fluent API givennameandDataTypeto alter a column. Convenient if imported statically.- Parameters:
name- must not be null or empty.type- must not be null.- Returns:
- a new
AlterColumnSpecification.
-
alterColumn
public static AlterColumnSpecification alterColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type) Entry point into theAlterColumnSpecification's fluent API givennameandDataTypeto alter a column. Convenient if imported statically.- Parameters:
name- must not be null.type- must not be null.- Returns:
- a new
AlterColumnSpecification.
-
dropColumn
Create a newDropColumnSpecificationfor the givenname.- Parameters:
name- must not be null or empty.
-
dropColumn
public static DropColumnSpecification dropColumn(com.datastax.oss.driver.api.core.CqlIdentifier name) Create a newDropColumnSpecificationfor the givenname.- Parameters:
name- must not be null or empty.
-
createIndex
Entry point into theCreateIndexSpecification's fluent API to create an index. Convenient if imported statically. -
createIndex
Entry point into theCreateIndexSpecification's fluent API givenindexNameto create an index. Convenient if imported statically.- Parameters:
indexName- must not be null or empty.- Returns:
- a new
CreateIndexSpecification.
-
createIndex
Entry point into theCreateIndexSpecification's fluent API givenindexNameto create an index. Convenient if imported statically.- Parameters:
indexName- must not be null or empty.- Returns:
- a new
CreateIndexSpecification.
-
createIndex
public static CreateIndexSpecification createIndex(com.datastax.oss.driver.api.core.CqlIdentifier indexName) Entry point into theCreateIndexSpecification's fluent API givenindexNameto create an index. Convenient if imported statically.- Parameters:
indexName- must not be null.- Returns:
- a new
CreateIndexSpecification.
-
createIndex
public static CreateIndexSpecification createIndex(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, @Nullable com.datastax.oss.driver.api.core.CqlIdentifier indexName) Entry point into theCreateIndexSpecification's fluent API givenkeyspaceandindexNameto create an index. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the index and table name are prefixed withkeyspace.- Parameters:
keyspace- can be null.indexName- can be null.- Returns:
- a new
CreateIndexSpecification.
-
dropIndex
Create a newDropIndexSpecificationfor the givenindexName.- Parameters:
indexName- must not be null or empty.- Returns:
- a new
DropIndexSpecification.
-
dropIndex
Create a newDropIndexSpecificationfor the givenindexName. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the index name is prefixed withkeyspace.- Parameters:
keyspace- can be null.indexName- must not be null.- Returns:
- a new
DropIndexSpecification.
-
dropIndex
public static DropIndexSpecification dropIndex(com.datastax.oss.driver.api.core.CqlIdentifier indexName) Create a newDropIndexSpecificationfor the givenindexName.- Parameters:
indexName- must not be null.- Returns:
- a new
DropIndexSpecification.
-
dropIndex
public static DropIndexSpecification dropIndex(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier indexName) Create a newDropIndexSpecificationfor the givenindexName. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the index name is prefixed withkeyspace.- Parameters:
keyspace- can be null.indexName- must not be null.- Returns:
- a new
DropIndexSpecification.
-
createType
Entry point into theCreateUserTypeSpecification's fluent API givennameto create a type. Convenient if imported statically.- Parameters:
typeName- must not null or empty.- Returns:
- a new
CreateUserTypeSpecification.
-
createType
Entry point into theCreateUserTypeSpecification's fluent API givennameto create a type. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the UDT name is prefixed withkeyspace.- Parameters:
keyspace- can be null.typeName- must not null.- Returns:
- a new
CreateUserTypeSpecification.
-
createType
public static CreateUserTypeSpecification createType(com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateUserTypeSpecification's fluent API giventypeNameto create a type. Convenient if imported statically.- Parameters:
name- must not null.- Returns:
- a new
CreateUserTypeSpecification.
-
createType
public static CreateUserTypeSpecification createType(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier name) Entry point into theCreateUserTypeSpecification's fluent API giventypeNameto create a type. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the UDT name is prefixed withkeyspace.- Parameters:
keyspace- can be null.name- must not null.- Returns:
- a new
CreateUserTypeSpecification.
-
alterType
Entry point into theAlterColumnSpecification's fluent API giventypeNameto alter a user type. Convenient if imported statically.- Parameters:
typeName- must not be null or empty.- Returns:
- a new
AlterUserTypeSpecification.
-
dropType
Entry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type. Convenient if imported statically.- Parameters:
typeName- must not benullor empty.- Returns:
- a new
DropUserTypeSpecification.
-
dropType
Entry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the UDT name is prefixed withkeyspace.- Parameters:
keyspace- can benull.typeName- must not benullor empty.- Returns:
- a new
DropUserTypeSpecification.
-
dropType
public static DropUserTypeSpecification dropType(com.datastax.oss.driver.api.core.CqlIdentifier typeName) Entry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type. Convenient if imported statically.- Parameters:
typeName- must not benullor empty.- Returns:
- a new
DropUserTypeSpecification.
-
dropType
public static DropUserTypeSpecification dropType(@Nullable com.datastax.oss.driver.api.core.CqlIdentifier keyspace, com.datastax.oss.driver.api.core.CqlIdentifier typeName) Entry point into theDropUserTypeSpecification's fluent API giventypeNameto drop a type. Convenient if imported statically. Uses the default keyspace ifkeyspaceis null; otherwise, of thekeyspaceis not {@link null}, then the UDT name is prefixed withkeyspace.- Parameters:
keyspace- can benull.typeName- must not benullor empty.- Returns:
- a new
DropUserTypeSpecification.
-