public class TableMetadata extends AbstractTableMetadata
cassandraVersion, clusteringColumns, clusteringOrder, columns, id, keyspace, name, options, partitionKey
Modifier and Type | Method and Description |
---|---|
String |
asCQLQuery()
Returns a single CQL statement representing this table.
|
protected String |
asCQLQuery(boolean formatted) |
boolean |
equals(Object other) |
String |
exportAsString()
Returns a
String containing CQL statements representing this
table and all of its derived resources, such as secondary indexes
or materialized views. |
IndexMetadata |
getIndex(String name)
Returns metadata on a index of this table.
|
Collection<IndexMetadata> |
getIndexes()
Returns all indexes based on this table.
|
MaterializedViewMetadata |
getView(String name)
Returns metadata on a view of this table.
|
Collection<MaterializedViewMetadata> |
getViews()
Returns all views based on this table.
|
int |
hashCode() |
appendOptions, getClusteringColumns, getClusteringOrder, getColumn, getColumns, getId, getKeyspace, getName, getOptions, getPartitionKey, getPrimaryKey, toString
public IndexMetadata getIndex(String name)
name
- the name of the index to retrieve (name
will be
interpreted as a case-insensitive identifier unless enclosed in double-quotes,
see Metadata.quote(java.lang.String)
).name
index if it exists, or
null
otherwise.public Collection<IndexMetadata> getIndexes()
public MaterializedViewMetadata getView(String name)
name
- the name of the view to retrieve (name
will be
interpreted as a case-insensitive identifier unless enclosed in double-quotes,
see Metadata.quote(java.lang.String)
).name
view if it exists, or
null
otherwise.public Collection<MaterializedViewMetadata> getViews()
public String exportAsString()
String
containing CQL statements representing this
table and all of its derived resources, such as secondary indexes
or materialized views.
In other words, this method returns the statements that would allow you to
recreate the complete schema of this table, along with the secondary indexes
and materialized views defined on it, if any.
Note that the returned String is formatted to be human readable (for
some definition of human readable at least).exportAsString
in class AbstractTableMetadata
String
.asCQLQuery()
public String asCQLQuery()
CREATE TABLE
statement with the options
corresponding to this table definition.
Note that the returned string is a single line; the returned statement
is not formatted in any way.asCQLQuery
in class AbstractTableMetadata
CREATE TABLE
statement corresponding to this table.exportAsString()
protected String asCQLQuery(boolean formatted)
asCQLQuery
in class AbstractTableMetadata
Copyright © 2012–2017. All rights reserved.