Class TableMetadata

    • Method Detail

      • getIndex

        public IndexMetadata getIndex​(String name)
        Returns metadata on a index of this table.
        Parameters:
        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)).
        Returns:
        the metadata for the name index if it exists, or null otherwise.
      • getIndexes

        public Collection<IndexMetadata> getIndexes()
        Returns all indexes based on this table.
        Returns:
        all indexes based on this table.
      • getView

        public MaterializedViewMetadata getView​(String name)
        Returns metadata on a view of this table.
        Parameters:
        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)).
        Returns:
        the metadata for the name view if it exists, or null otherwise.
      • exportAsString

        public String exportAsString()
        Returns a 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 indexes and views defined on this table, if any.

        Note that the returned String is formatted to be human readable (for some definition of human readable at least).

        Overrides:
        exportAsString in class AbstractTableMetadata
        Returns:
        the CQL queries representing this table schema as a {code String}.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object