public class CreateTableSpecification extends TableSpecification<CreateTableSpecification>
CREATE TABLE
specification.Modifier and Type | Method and Description |
---|---|
static CreateTableSpecification |
createTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName)
Entry point into the
CreateTableSpecification 's fluent API given tableName to create a table. |
static CreateTableSpecification |
createTable(String tableName)
Entry point into the
CreateTableSpecification 's fluent API given tableName to create a table. |
boolean |
getIfNotExists() |
CreateTableSpecification |
ifNotExists()
Causes the inclusion of an
IF NOT EXISTS clause. |
CreateTableSpecification |
ifNotExists(boolean ifNotExists)
Toggles the inclusion of an
IF NOT EXISTS clause. |
CreateTableSpecification |
with(String name,
Object value,
boolean escape,
boolean quote)
Adds the given option by name to this table's options.
|
CreateTableSpecification |
with(TableOption option)
Convenience method that calls
with(option, null) . |
CreateTableSpecification |
with(TableOption option,
Object value)
Sets the given table option.
|
clusteredKeyColumn, clusteredKeyColumn, clusteredKeyColumn, clusteredKeyColumn, clusteredKeyColumn, column, column, column, column, column, column, getClusteredKeyColumns, getColumns, getNonKeyColumns, getPartitionKeyColumns, getPrimaryKeyColumns, getStaticColumns, partitionKeyColumn, partitionKeyColumn, staticColumn, staticColumn
getOptions
getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getOptions
public static CreateTableSpecification createTable(String tableName)
CreateTableSpecification
's fluent API given tableName
to create a table.
Convenient if imported statically.tableName
- must not be null or empty.CreateTableSpecification
.public static CreateTableSpecification createTable(com.datastax.oss.driver.api.core.CqlIdentifier tableName)
CreateTableSpecification
's fluent API given tableName
to create a table.
Convenient if imported statically.tableName
- must not be null.CreateTableSpecification
.public CreateTableSpecification ifNotExists()
IF NOT EXISTS
clause.public CreateTableSpecification ifNotExists(boolean ifNotExists)
IF NOT EXISTS
clause.public boolean getIfNotExists()
public CreateTableSpecification with(TableOption option)
TableOptionsSpecification
with(option, null)
.with
in class TableOptionsSpecification<TableSpecification<CreateTableSpecification>>
public CreateTableSpecification with(TableOption option, Object value)
TableOptionsSpecification
TableOptionsSpecification.with(String, Object, boolean, boolean)
appropriately from the given TableOption
and value for that
option.with
in class TableOptionsSpecification<TableSpecification<CreateTableSpecification>>
option
- The option to set.value
- The value of the option. Must be type-compatible with the TableOption
.TableOptionsSpecification.with(String, Object, boolean, boolean)
public CreateTableSpecification with(String name, @Nullable Object value, boolean escape, boolean quote)
TableOptionsSpecification
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
parameter escape
and may be single-quoted according to parameter quote
.with
in class TableOptionsSpecification<TableSpecification<CreateTableSpecification>>
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's Object.toString()
value is used.escape
- Whether to escape the value via CqlStringUtils.escapeSingle(Object)
. Ignored if given value
is an instance of a Map
.quote
- Whether to quote the value via CqlStringUtils.singleQuote(Object)
. Ignored if given value is
an instance of a Map
.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.