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 CreateTableSpecification
createTable
(com.datastax.oss.driver.api.core.CqlIdentifier tableName) Entry point into theCreateTableSpecification
's fluent API giventableName
to create a table.static CreateTableSpecification
createTable
(String tableName) Entry point into theCreateTableSpecification
's fluent API giventableName
to create a table.boolean
Causes the inclusion of anIF NOT EXISTS
clause.ifNotExists
(boolean ifNotExists) Toggles the inclusion of anIF NOT EXISTS
clause.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, staticColumn
Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.TableOptionsSpecification
getOptions
Methods inherited from class org.springframework.data.cassandra.core.cql.keyspace.TableNameSpecification
getName
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.cql.keyspace.TableDescriptor
getName, getOptions
-
Method Details
-
createTable
Entry point into theCreateTableSpecification
's fluent API giventableName
to 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 giventableName
to create a table. Convenient if imported statically.- Parameters:
tableName
- must not be null.- Returns:
- a new
CreateTableSpecification
.
-
ifNotExists
Causes the inclusion of anIF NOT EXISTS
clause.- Returns:
- this
-
ifNotExists
Toggles the inclusion of anIF NOT EXISTS
clause.- Returns:
- this
-
getIfNotExists
public boolean getIfNotExists() -
with
Description copied from class:TableOptionsSpecification
Convenience method that callswith(option, null)
.- Overrides:
with
in classTableOptionsSpecification<TableSpecification<CreateTableSpecification>>
- Returns:
- this
-
with
Description copied from class:TableOptionsSpecification
Sets the given table option. This is a convenience method that callsTableOptionsSpecification.with(String, Object, boolean, boolean)
appropriately from the givenTableOption
and value for that option.- Overrides:
with
in 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:TableOptionsSpecification
Adds 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 parameterescape
and may be single-quoted according to parameterquote
.- Overrides:
with
in 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
-