Class CreateTableSpecification
java.lang.Object
org.springframework.data.cassandra.core.cql.keyspace.TableNameSpecification
org.springframework.data.cassandra.core.cql.keyspace.TableOptionsSpecification<TableSpecification<T>>
org.springframework.data.cassandra.core.cql.keyspace.TableSpecification<CreateTableSpecification>
org.springframework.data.cassandra.core.cql.keyspace.CreateTableSpecification
- All Implemented Interfaces:
TableDescriptor
Object to configure a
CREATE TABLE specification.- Author:
- Matthew T. Adams, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionstatic CreateTableSpecificationcreateTable(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.booleanCauses the inclusion of anIF NOT EXISTSclause.ifNotExists(boolean ifNotExists) Toggles the inclusion of anIF NOT EXISTSclause.Adds the given option by name to this table's options.with(TableOption option) Convenience method that callswith(option, null).with(TableOption option, Object value) Sets the given table option.Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.TableSpecification
clusteredKeyColumn, clusteredKeyColumn, clusteredKeyColumn, clusteredKeyColumn, clusteredKeyColumn, column, column, column, column, column, column, getClusteredKeyColumns, getColumns, getNonKeyColumns, getPartitionKeyColumns, getPrimaryKeyColumns, getStaticColumns, partitionKeyColumn, partitionKeyColumn, staticColumn, staticColumnMethods inherited from class org.springframework.data.cassandra.core.cql.keyspace.TableOptionsSpecification
getOptionsMethods inherited from class org.springframework.data.cassandra.core.cql.keyspace.TableNameSpecification
getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.cassandra.core.cql.keyspace.TableDescriptor
getName, getOptions
-
Method Details
-
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
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.
-
ifNotExists
Causes the inclusion of anIF NOT EXISTSclause.- Returns:
- this
-
ifNotExists
Toggles the inclusion of anIF NOT EXISTSclause.- Returns:
- this
-
getIfNotExists
public boolean getIfNotExists() -
with
Description copied from class:TableOptionsSpecificationConvenience method that callswith(option, null).- Overrides:
within classTableOptionsSpecification<TableSpecification<CreateTableSpecification>>- Returns:
- this
-
with
Description copied from class:TableOptionsSpecificationSets the given table option. This is a convenience method that callsTableOptionsSpecification.with(String, Object, boolean, boolean)appropriately from the givenTableOptionand value for that option.- Overrides:
within classTableOptionsSpecification<TableSpecification<CreateTableSpecification>>- Parameters:
option- The option to set.value- The value of the option. Must be type-compatible with theTableOption.- Returns:
- this
- See Also:
-
with
public CreateTableSpecification with(String name, @Nullable Object value, boolean escape, boolean quote) Description copied from class:TableOptionsSpecificationAdds the given option by name to this table's options.Options that have null values are considered single string options where the name of the option is the string to be used. Otherwise, the result of
Object.toString()is considered to be the value of the option with the given name. The value, after conversion to string, may have embedded single quotes escaped according to parameterescapeand may be single-quoted according to parameterquote.- Overrides:
within classTableOptionsSpecification<TableSpecification<CreateTableSpecification>>- Parameters:
name- The name of the optionvalue- The value of the option. If null, the value is ignored and the option is considered to be composed of only the name, otherwise the value'sObject.toString()value is used.escape- Whether to escape the value viaCqlStringUtils.escapeSingle(Object). Ignored if given value is an instance of aMap.quote- Whether to quote the value viaCqlStringUtils.singleQuote(Object). Ignored if given value is an instance of aMap.- Returns:
- this
-