public class TableMetadata extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TableMetadata.Options |
static class |
TableMetadata.Order
Clustering orders.
|
Modifier and Type | Method and Description |
---|---|
String |
asCQLQuery()
Returns a CQL query representing this table.
|
String |
exportAsString()
Returns a
String containing CQL queries representing this
table and the index on it. |
List<ColumnMetadata> |
getClusteringKey()
Returns the list of columns composing the clustering key for this table.
|
List<TableMetadata.Order> |
getClusteringOrder()
Returns the clustering order for this table.
|
ColumnMetadata |
getColumn(String name)
Returns metadata on a column of this table.
|
List<ColumnMetadata> |
getColumns()
Returns a list containing all the columns of this table.
|
KeyspaceMetadata |
getKeyspace()
Returns the keyspace this table belong to.
|
String |
getName()
Returns the name of this table.
|
TableMetadata.Options |
getOptions()
Returns the options for this table.
|
List<ColumnMetadata> |
getPartitionKey()
Returns the list of columns composing the partition key for this table.
|
List<ColumnMetadata> |
getPrimaryKey()
Returns the list of columns composing the primary key for this table.
|
public String getName()
public KeyspaceMetadata getKeyspace()
public ColumnMetadata getColumn(String name)
name
- the name of the column to retrieve.name
column if it exists, or
null
otherwise.public List<ColumnMetadata> getColumns()
SELECT * FROM thisTable
:
the first column is the partition key, next are the clustering
keys in their defined order, and then the rest of the
columns follow in alphabetic order.public List<ColumnMetadata> getPrimaryKey()
public List<ColumnMetadata> getPartitionKey()
public List<ColumnMetadata> getClusteringKey()
public List<TableMetadata.Order> getClusteringOrder()
The returned contains the cluster order of each clustering key. The
i
th element of the result correspond to the order (ascending or
descending) of the i
th clustering key (see
getClusteringKey()
). Note that a table defined without any
particular clustering order is equivalent to one for which all the
clustering key are in ascending order.
public TableMetadata.Options getOptions()
public String exportAsString()
String
containing CQL queries representing this
table and the index on it.
In other words, this method returns the queries that would allow you to
recreate the schema of this table, along with the index defined on
columns of this table.
Note that the returned String is formatted to be human readable (for
some definition of human readable at least).public String asCQLQuery()
exportAsString()
Copyright © 2014. All Rights Reserved.