Class Create
- java.lang.Object
-
- com.datastax.driver.core.Statement
-
- com.datastax.driver.core.RegularStatement
-
- com.datastax.driver.core.schemabuilder.SchemaStatement
-
- com.datastax.driver.core.schemabuilder.AbstractCreateStatement<Create>
-
- com.datastax.driver.core.schemabuilder.Create
-
public class Create extends AbstractCreateStatement<Create>
A built CREATE TABLE statement.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreate.OptionsThe table options of a CREATE TABLE statement.
-
Field Summary
-
Fields inherited from class com.datastax.driver.core.schemabuilder.AbstractCreateStatement
ifNotExists, keyspaceName, simpleColumns
-
Fields inherited from class com.datastax.driver.core.Statement
idempotent, NULL_PAYLOAD_VALUE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CreateaddClusteringColumn(String columnName, DataType dataType)Add a clustering column definition to this CREATE TABLE statement.CreateaddPartitionKey(String columnName, DataType dataType)Add a partition key column definition to this CREATE TABLE statement.CreateaddStaticColumn(String columnName, DataType dataType)Add a static column definition to this CREATE TABLE statement.CreateaddUDTClusteringColumn(String columnName, UDTType udtType)Add a clustering column definition to this CREATE TABLE statement, when its type contains a UDT.CreateaddUDTPartitionKey(String columnName, UDTType udtType)Add a partition key column definition to this CREATE TABLE statement, when its type contains a UDT.CreateaddUDTStaticColumn(String columnName, UDTType udtType)Add a static column definition to this CREATE TABLE statement, when its type contains a UDT.StringbuildInternal()Create.OptionswithOptions()Add options for this CREATE TABLE statement.-
Methods inherited from class com.datastax.driver.core.schemabuilder.AbstractCreateStatement
addColumn, addUDTColumn, addUDTListColumn, addUDTMapColumn, addUDTMapColumn, addUDTMapColumn, addUDTSetColumn, buildColumnType, ifNotExists
-
Methods inherited from class com.datastax.driver.core.schemabuilder.SchemaStatement
getKeyspace, getNamedValues, getQueryString, getRoutingKey, getValues, hasValues, usesNamedValues
-
Methods inherited from class com.datastax.driver.core.RegularStatement
getQueryString, hasValues, requestSizeInBytes, toString
-
Methods inherited from class com.datastax.driver.core.Statement
disableTracing, enableTracing, getConsistencyLevel, getDefaultTimestamp, getFetchSize, getHost, getLastHost, getNowInSeconds, getOutgoingPayload, getPartitioner, getReadTimeoutMillis, getRetryPolicy, getSerialConsistencyLevel, isBatchIdempotent, isIdempotent, isLWT, isTracing, setConsistencyLevel, setDefaultTimestamp, setFetchSize, setHost, setIdempotent, setLastHost, setNowInSeconds, setOutgoingPayload, setPagingState, setPagingState, setPagingStateUnsafe, setReadTimeoutMillis, setRetryPolicy, setSerialConsistencyLevel
-
-
-
-
Method Detail
-
addPartitionKey
public Create addPartitionKey(String columnName, DataType dataType)
Add a partition key column definition to this CREATE TABLE statement.This includes the column declaration (you don't need an additional
addColumncall).Partition key columns are added in the order of their declaration.
- Parameters:
columnName- the name of the partition key column to be added.dataType- the data type of the partition key column to be added.- Returns:
- this CREATE statement.
-
addUDTPartitionKey
public Create addUDTPartitionKey(String columnName, UDTType udtType)
Add a partition key column definition to this CREATE TABLE statement, when its type contains a UDT.This includes the column declaration (you don't need an additional
addColumncall).Partition key columns are added in the order of their declaration.
- Parameters:
columnName- the name of the partition key column to be added.udtType- the UDT type of the partition key column to be added. UseSchemaBuilder.frozen(String)orSchemaBuilder.udtLiteral(String).- Returns:
- this CREATE statement.
-
addClusteringColumn
public Create addClusteringColumn(String columnName, DataType dataType)
Add a clustering column definition to this CREATE TABLE statement.This includes the column declaration (you don't need an additional
addColumncall).Clustering columns are added in the order of their declaration.
- Parameters:
columnName- the name of the clustering column to be added.dataType- the data type of the clustering column to be added.- Returns:
- this CREATE statement.
-
addUDTClusteringColumn
public Create addUDTClusteringColumn(String columnName, UDTType udtType)
Add a clustering column definition to this CREATE TABLE statement, when its type contains a UDT.This includes the column declaration (you don't need an additional
addColumncall).Clustering columns are added in the order of their declaration.
- Parameters:
columnName- the name of the clustering column to be added.udtType- the UDT type of the clustering column to be added. UseSchemaBuilder.frozen(String)orSchemaBuilder.udtLiteral(String).- Returns:
- this CREATE statement.
-
addStaticColumn
public Create addStaticColumn(String columnName, DataType dataType)
Add a static column definition to this CREATE TABLE statement.- Parameters:
columnName- the name of the column to be added.dataType- the data type of the column to be added.- Returns:
- this CREATE statement.
-
addUDTStaticColumn
public Create addUDTStaticColumn(String columnName, UDTType udtType)
Add a static column definition to this CREATE TABLE statement, when its type contains a UDT.- Parameters:
columnName- the name of the column to be added.udtType- the UDT type of the column to be added. UseSchemaBuilder.frozen(String)orSchemaBuilder.udtLiteral(String).- Returns:
- this CREATE statement.
-
withOptions
public Create.Options withOptions()
Add options for this CREATE TABLE statement.- Returns:
- the options of this CREATE TABLE statement.
-
buildInternal
public String buildInternal()
-
-