Package org.apache.cassandra.schema
Class ViewMetadata
- java.lang.Object
-
- org.apache.cassandra.schema.ViewMetadata
-
- All Implemented Interfaces:
SchemaElement
public final class ViewMetadata extends java.lang.Object implements SchemaElement
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.SchemaElement
SchemaElement.SchemaElementType
-
-
Field Summary
Fields Modifier and Type Field Description TableId
baseTableId
java.lang.String
baseTableName
boolean
includeAllColumns
TableMetadata
metadata
WhereClause
whereClause
-
Fields inherited from interface org.apache.cassandra.cql3.SchemaElement
NAME_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description ViewMetadata(TableId baseTableId, java.lang.String baseTableName, boolean includeAllColumns, WhereClause whereClause, TableMetadata metadata)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendCqlTo(CqlBuilder builder, boolean internals, boolean ifNotExists)
TableMetadata
baseTableMetadata()
ViewMetadata
copy(TableMetadata newMetadata)
java.lang.String
elementKeyspace()
Returns the CQL name of the keyspace to which this schema element belong.java.lang.String
elementName()
Returns the CQL name of this schema element.SchemaElement.SchemaElementType
elementType()
Return the schema element typeboolean
equals(java.lang.Object o)
int
hashCode()
boolean
includes(ColumnIdentifier column)
java.lang.String
keyspace()
java.lang.String
name()
boolean
referencesUserType(java.nio.ByteBuffer name)
java.lang.String
toCqlString(boolean withInternals, boolean ifNotExists)
Returns a CQL representation of this elementjava.lang.String
toString()
ViewMetadata
withAddedRegularColumn(ColumnMetadata column)
ViewMetadata
withNewColumnMask(ColumnIdentifier name, ColumnMask mask)
ViewMetadata
withRenamedPrimaryKeyColumn(ColumnIdentifier from, ColumnIdentifier to)
ViewMetadata
withUpdatedUserType(UserType udt)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.SchemaElement
elementKeyspaceQuotedIfNeeded, elementNameQuotedIfNeeded
-
-
-
-
Field Detail
-
baseTableId
public final TableId baseTableId
-
baseTableName
public final java.lang.String baseTableName
-
includeAllColumns
public final boolean includeAllColumns
-
metadata
public final TableMetadata metadata
-
whereClause
public final WhereClause whereClause
-
-
Constructor Detail
-
ViewMetadata
public ViewMetadata(TableId baseTableId, java.lang.String baseTableName, boolean includeAllColumns, WhereClause whereClause, TableMetadata metadata)
- Parameters:
baseTableId
- Internal ID of the table which this view is based off ofincludeAllColumns
- Whether to include all columns or not
-
-
Method Detail
-
keyspace
public java.lang.String keyspace()
-
name
public java.lang.String name()
-
includes
public boolean includes(ColumnIdentifier column)
- Returns:
- true if the view specified by this definition will include the column, false otherwise
-
copy
public ViewMetadata copy(TableMetadata newMetadata)
-
baseTableMetadata
public TableMetadata baseTableMetadata()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
referencesUserType
public boolean referencesUserType(java.nio.ByteBuffer name)
-
withUpdatedUserType
public ViewMetadata withUpdatedUserType(UserType udt)
-
withRenamedPrimaryKeyColumn
public ViewMetadata withRenamedPrimaryKeyColumn(ColumnIdentifier from, ColumnIdentifier to)
-
withAddedRegularColumn
public ViewMetadata withAddedRegularColumn(ColumnMetadata column)
-
withNewColumnMask
public ViewMetadata withNewColumnMask(ColumnIdentifier name, @Nullable ColumnMask mask)
-
appendCqlTo
public void appendCqlTo(CqlBuilder builder, boolean internals, boolean ifNotExists)
-
elementType
public SchemaElement.SchemaElementType elementType()
Description copied from interface:SchemaElement
Return the schema element type- Specified by:
elementType
in interfaceSchemaElement
- Returns:
- the schema element type
-
elementKeyspace
public java.lang.String elementKeyspace()
Description copied from interface:SchemaElement
Returns the CQL name of the keyspace to which this schema element belong.- Specified by:
elementKeyspace
in interfaceSchemaElement
- Returns:
- the keyspace name.
-
elementName
public java.lang.String elementName()
Description copied from interface:SchemaElement
Returns the CQL name of this schema element.- Specified by:
elementName
in interfaceSchemaElement
- Returns:
- the name of this schema element.
-
toCqlString
public java.lang.String toCqlString(boolean withInternals, boolean ifNotExists)
Description copied from interface:SchemaElement
Returns a CQL representation of this element- Specified by:
toCqlString
in interfaceSchemaElement
- Parameters:
withInternals
- if the internals part of the CQL should be exposed.ifNotExists
- if "IF NOT EXISTS" should be included.- Returns:
- a CQL representation of this element
-
-