public class TableSpecification<T> extends TableOptionsSpecification<TableSpecification<T>> implements TableDescriptor
TableDescriptor
, independent of CreateTableSpecification
.Modifier | Constructor and Description |
---|---|
protected |
TableSpecification(com.datastax.oss.driver.api.core.CqlIdentifier name) |
Modifier and Type | Method and Description |
---|---|
T |
clusteredKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name,
com.datastax.oss.driver.api.core.type.DataType type)
Adds the given primary key column to the table with ascending ordering.
|
T |
clusteredKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name,
com.datastax.oss.driver.api.core.type.DataType type,
Optional<Ordering> ordering)
Adds the given primary key column to the table with ascending ordering.
|
T |
clusteredKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name,
com.datastax.oss.driver.api.core.type.DataType type,
Ordering ordering)
Adds the given primary key column to the table with ascending ordering.
|
T |
clusteredKeyColumn(String name,
com.datastax.oss.driver.api.core.type.DataType type)
Adds the given primary key column to the table with ascending ordering.
|
T |
clusteredKeyColumn(String name,
com.datastax.oss.driver.api.core.type.DataType type,
Ordering ordering)
Adds the given primary key column to the table with ascending ordering.
|
T |
column(com.datastax.oss.driver.api.core.CqlIdentifier name,
com.datastax.oss.driver.api.core.type.DataType type)
Adds the given non-key column to the table.
|
protected T |
column(com.datastax.oss.driver.api.core.CqlIdentifier name,
com.datastax.oss.driver.api.core.type.DataType type,
Optional<PrimaryKeyType> optionalKeyType,
Optional<Ordering> optionalOrdering) |
T |
column(String name,
com.datastax.oss.driver.api.core.type.DataType type)
Adds the given non-key column to the table.
|
protected T |
column(String name,
com.datastax.oss.driver.api.core.type.DataType type,
PrimaryKeyType keyType)
Adds the given info as a new column to the table.
|
protected T |
column(String name,
com.datastax.oss.driver.api.core.type.DataType type,
PrimaryKeyType keyType,
Optional<Ordering> ordering)
Adds the given info as a new column to the table.
|
protected T |
column(String name,
com.datastax.oss.driver.api.core.type.DataType type,
PrimaryKeyType keyType,
Ordering ordering)
Adds the given info as a new column to the table.
|
List<ColumnSpecification> |
getClusteredKeyColumns()
Returns an unmodifiable list of all primary key columns that are not also partition key columns.
|
List<ColumnSpecification> |
getColumns()
Returns an unmodifiable list of all columns.
|
List<ColumnSpecification> |
getNonKeyColumns()
Returns an unmodifiable list of all non-key columns.
|
List<ColumnSpecification> |
getPartitionKeyColumns()
Returns an unmodifiable list of all partition key columns.
|
List<ColumnSpecification> |
getPrimaryKeyColumns()
Returns an unmodifiable list of all primary key columns that are not also partition key columns.
|
T |
partitionKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name,
com.datastax.oss.driver.api.core.type.DataType type)
Adds the given partition key column to the table.
|
T |
partitionKeyColumn(String name,
com.datastax.oss.driver.api.core.type.DataType type)
Adds the given partition key column to the table.
|
getOptions, with, with, with
getName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, getOptions
protected TableSpecification(com.datastax.oss.driver.api.core.CqlIdentifier name)
public T column(String name, com.datastax.oss.driver.api.core.type.DataType type)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.public T column(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.public T partitionKeyColumn(String name, com.datastax.oss.driver.api.core.type.DataType type)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.public T partitionKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.public T clusteredKeyColumn(String name, com.datastax.oss.driver.api.core.type.DataType type)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.public T clusteredKeyColumn(String name, com.datastax.oss.driver.api.core.type.DataType type, Ordering ordering)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.ordering
- The data type of the column, must not be null.public T clusteredKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.public T clusteredKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type, Ordering ordering)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.ordering
- The data type of the column, must not be null.public T clusteredKeyColumn(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type, Optional<Ordering> ordering)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.ordering
- The data type of the column, must not be null.protected T column(String name, com.datastax.oss.driver.api.core.type.DataType type, PrimaryKeyType keyType)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.keyType
- Indicates key type. Null means that the column is not a key column, must not be null.protected T column(String name, com.datastax.oss.driver.api.core.type.DataType type, PrimaryKeyType keyType, Ordering ordering)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.keyType
- Indicates key type, must not be null.ordering
- If the given PrimaryKeyType
is PrimaryKeyType.CLUSTERED
, then the given ordering is
used, else ignored, must not be null.protected T column(String name, com.datastax.oss.driver.api.core.type.DataType type, PrimaryKeyType keyType, Optional<Ordering> ordering)
name
- The column name; must be a valid unquoted or quoted identifier without the surrounding double quotes,
must not be null.type
- The data type of the column, must not be null.keyType
- Indicates key type, must not be null.ordering
- If the given PrimaryKeyType
is PrimaryKeyType.CLUSTERED
, then the given ordering is
used, else ignored, must not be null.protected T column(com.datastax.oss.driver.api.core.CqlIdentifier name, com.datastax.oss.driver.api.core.type.DataType type, Optional<PrimaryKeyType> optionalKeyType, Optional<Ordering> optionalOrdering)
public List<ColumnSpecification> getColumns()
getColumns
in interface TableDescriptor
public List<ColumnSpecification> getPartitionKeyColumns()
getPartitionKeyColumns
in interface TableDescriptor
public List<ColumnSpecification> getClusteredKeyColumns()
getClusteredKeyColumns
in interface TableDescriptor
public List<ColumnSpecification> getPrimaryKeyColumns()
getPrimaryKeyColumns
in interface TableDescriptor
public List<ColumnSpecification> getNonKeyColumns()
getNonKeyColumns
in interface TableDescriptor
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.