Class IndexMetaData

java.lang.Object
org.tentackle.sql.metadata.IndexMetaData
Direct Known Subclasses:
PostgresIndexMetaData

public class IndexMetaData extends Object
Meta data for an index.
Author:
harald
  • Constructor Details

    • IndexMetaData

      public IndexMetaData(TableMetaData tableMetaData)
      Creates an index meta data object.
      Parameters:
      tableMetaData - the table the index belongs to
  • Method Details

    • setupIndexFromMetaData

      public void setupIndexFromMetaData(ResultSet resultSet) throws SQLException
      Sets up the index from the database metadata result.
      Parameters:
      resultSet - the column result set
      Throws:
      SQLException - the processing the result set failed
    • addIndexColumnFromMetaData

      public void addIndexColumnFromMetaData(ResultSet resultSet) throws SQLException
      Adds an index column from the database metadata result.
      Parameters:
      resultSet - the column result set
      Throws:
      SQLException - the processing the result set failed
    • getTableMetaData

      public TableMetaData getTableMetaData()
      Gets the table.
      Returns:
      the table meta data
    • getColumns

      public List<IndexColumnMetaData> getColumns()
      Gets the columns.
      Returns:
      the columns for this index
    • getIndexName

      public String getIndexName()
      Gets the index name.
      Returns:
      the name in lowercase without schema
    • setIndexName

      public void setIndexName(String indexName)
      Sets the index name.
      Parameters:
      indexName - the name in lowercase without schema
    • isUnique

      public boolean isUnique()
      Returns whether index is unique.
      Returns:
      true if unique
    • setUnique

      public void setUnique(boolean unique)
      Sets whether index is unique.
      Parameters:
      unique - true if unique
    • getFilterCondition

      public String getFilterCondition()
      Gets the filter condition.
      Returns:
      the filter, null if none
    • setFilterCondition

      public void setFilterCondition(String filterCondition)
      Sets the filter condition.
      Parameters:
      filterCondition - the filter, null if none
    • isPrimaryIdKey

      public boolean isPrimaryIdKey()
      Returns whether this is the primary key for the object id.
      Returns:
      true if object id key
    • validate

      public void validate()
      Validates and post-processes the index data.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object