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 TableIdbaseTableIdjava.lang.StringbaseTableNamebooleanincludeAllColumnsTableMetadatametadataWhereClausewhereClause-
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 voidappendCqlTo(CqlBuilder builder, boolean internals, boolean ifNotExists)TableMetadatabaseTableMetadata()ViewMetadatacopy(TableMetadata newMetadata)java.lang.StringelementKeyspace()Returns the CQL name of the keyspace to which this schema element belong.java.lang.StringelementName()Returns the CQL name of this schema element.SchemaElement.SchemaElementTypeelementType()Return the schema element typebooleanequals(java.lang.Object o)inthashCode()booleanincludes(ColumnIdentifier column)java.lang.Stringkeyspace()java.lang.Stringname()booleanreferencesUserType(java.nio.ByteBuffer name)java.lang.StringtoCqlString(boolean withInternals, boolean ifNotExists)Returns a CQL representation of this elementjava.lang.StringtoString()ViewMetadatawithAddedRegularColumn(ColumnMetadata column)ViewMetadatawithRenamedPrimaryKeyColumn(ColumnIdentifier from, ColumnIdentifier to)ViewMetadatawithUpdatedUserType(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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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)
-
appendCqlTo
public void appendCqlTo(CqlBuilder builder, boolean internals, boolean ifNotExists)
-
elementType
public SchemaElement.SchemaElementType elementType()
Description copied from interface:SchemaElementReturn the schema element type- Specified by:
elementTypein interfaceSchemaElement- Returns:
- the schema element type
-
elementKeyspace
public java.lang.String elementKeyspace()
Description copied from interface:SchemaElementReturns the CQL name of the keyspace to which this schema element belong.- Specified by:
elementKeyspacein interfaceSchemaElement- Returns:
- the keyspace name.
-
elementName
public java.lang.String elementName()
Description copied from interface:SchemaElementReturns the CQL name of this schema element.- Specified by:
elementNamein interfaceSchemaElement- Returns:
- the name of this schema element.
-
toCqlString
public java.lang.String toCqlString(boolean withInternals, boolean ifNotExists)Description copied from interface:SchemaElementReturns a CQL representation of this element- Specified by:
toCqlStringin 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
-
-