- java.lang.Object
-
- org.tentackle.sql.metadata.IndexMetaData
-
- Direct Known Subclasses:
PostgresIndexMetaData
public class IndexMetaData extends java.lang.ObjectMeta data for an index.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description IndexMetaData(TableMetaData tableMetaData)Creates an index meta data object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIndexColumnFromMetaData(java.sql.ResultSet resultSet)Adds an index column from the database meta data result.booleanequals(java.lang.Object obj)java.util.List<IndexColumnMetaData>getColumns()Gets the columns.java.lang.StringgetFilterCondition()Gets the filter condition.java.lang.StringgetIndexName()Gets the index name.TableMetaDatagetTableMetaData()Gets the table.inthashCode()booleanisPrimaryIdKey()Returns whether this is the primary key for the object id.booleanisUnique()Returns whether index is unique.voidsetFilterCondition(java.lang.String filterCondition)Sets the filter condition.voidsetIndexName(java.lang.String indexName)Sets the index name.voidsetUnique(boolean unique)Sets whether index is unique.voidsetupIndexFromMetaData(java.sql.ResultSet resultSet)Sets up the index from the database meta data result.java.lang.StringtoString()voidvalidate()Validates and postprocesses the index data.
-
-
-
Constructor Detail
-
IndexMetaData
public IndexMetaData(TableMetaData tableMetaData)
Creates an index meta data object.- Parameters:
tableMetaData- the table the index belongs to
-
-
Method Detail
-
setupIndexFromMetaData
public void setupIndexFromMetaData(java.sql.ResultSet resultSet) throws java.sql.SQLExceptionSets up the index from the database meta data result.- Parameters:
resultSet- the column result set- Throws:
java.sql.SQLException- the processing the result set failed
-
addIndexColumnFromMetaData
public void addIndexColumnFromMetaData(java.sql.ResultSet resultSet) throws java.sql.SQLExceptionAdds an index column from the database meta data result.- Parameters:
resultSet- the column result set- Throws:
java.sql.SQLException- the processing the result set failed
-
getTableMetaData
public TableMetaData getTableMetaData()
Gets the table.- Returns:
- the table meta data
-
getColumns
public java.util.List<IndexColumnMetaData> getColumns()
Gets the columns.- Returns:
- the columns for this index
-
getIndexName
public java.lang.String getIndexName()
Gets the index name.- Returns:
- the name in lowercase without schema
-
setIndexName
public void setIndexName(java.lang.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 java.lang.String getFilterCondition()
Gets the filter condition.- Returns:
- the filter, null if none
-
setFilterCondition
public void setFilterCondition(java.lang.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 postprocesses the index data.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-