Class ColumnSpecification
java.lang.Object
org.springframework.data.cassandra.core.cql.keyspace.ColumnSpecification
Object to configure a CQL column specification.
Use name(String) and type(DataType) to set the name and type of the column, respectively. To
specify a clustered PRIMARY KEY column, use clustered() or clustered(Ordering). To specify
that the PRIMARY KEY column is or is part of the partition key, use partitioned() instead of
clustered() or clustered(Ordering). To specify STATIC column, use staticColumn().
- Author:
- Matthew T. Adams, Alex Shvid, Mark Paluch, Aleksei Zotov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OrderingDefault ordering of primary key fields; value isOrdering.ASCENDING. -
Method Summary
Modifier and TypeMethodDescriptionIdentifies this column as a clustered key column with default ordering.Identifies this column as a clustered key column with the given ordering.Toggles the identification of this column as a clustered key column.com.datastax.oss.driver.api.core.CqlIdentifiergetName()com.datastax.oss.driver.api.core.type.DataTypegetType()booleanisStatic()keyType(PrimaryKeyType keyType) Sets the column'skeyType.static ColumnSpecificationname(com.datastax.oss.driver.api.core.CqlIdentifier name) Create a newColumnSpecificationfor the givenname.static ColumnSpecificationCreate a newColumnSpecificationfor the givenname.Sets the column'sordering.Identifies this column as a primary key column that is also part of a partition key.partitioned(boolean partitioned) Toggles the identification of this column as a primary key column that also is or is part of a partition key.Identifies this column as a static column.toCql()toCql(StringBuilder cql) toString()type(com.datastax.oss.driver.api.core.type.DataType type) Sets the column's type.
-
Field Details
-
DEFAULT_ORDERING
Default ordering of primary key fields; value isOrdering.ASCENDING.
-
-
Method Details
-
name
Create a newColumnSpecificationfor the givenname.- Parameters:
name- must not be null or empty.- Returns:
- a new
ColumnSpecificationforname.
-
name
Create a newColumnSpecificationfor the givenname.- Parameters:
name- must not be null.- Returns:
- a new
ColumnSpecificationforname.
-
type
Sets the column's type.- Returns:
- this
-
partitioned
Identifies this column as a primary key column that is also part of a partition key. Sets the column'skeyTypetoPrimaryKeyType.PARTITIONEDand itsorderingto null.- Returns:
- this
-
partitioned
Toggles the identification of this column as a primary key column that also is or is part of a partition key. Setsorderingto null and, if the given boolean istrue, then sets the column'skeyTypetoPrimaryKeyType.PARTITIONED, else sets it to null.- Returns:
- this
-
clustered
Identifies this column as a clustered key column with default ordering. Sets the column'skeyTypetoPrimaryKeyType.CLUSTEREDand itsorderingtoDEFAULT_ORDERING.- Returns:
- this
-
clustered
Identifies this column as a clustered key column with the given ordering. Sets the column'skeyTypetoPrimaryKeyType.CLUSTEREDand itsorderingto the givenOrdering.- Returns:
- this
-
clustered
Toggles the identification of this column as a clustered key column. If the given boolean istrue, then sets the column'skeyTypetoPrimaryKeyType.PARTITIONEDandorderingto the givenOrdering, else sets bothkeyTypeandorderingto null.- Returns:
- this
-
keyType
Sets the column'skeyType.- Returns:
- this
-
ordering
Sets the column'sordering.- Returns:
- this
-
staticColumn
Identifies this column as a static column. Sets the column'sisStaticto true.- Returns:
- this
- Since:
- 3.2
-
getName
public com.datastax.oss.driver.api.core.CqlIdentifier getName() -
getType
-
getKeyType
-
getOrdering
-
isStatic
public boolean isStatic() -
toCql
-
toCql
-
toString
-