java.lang.Object
org.tentackle.sql.metadata.IndexMetaData
- Direct Known Subclasses:
PostgresIndexMetaData
Meta data for an index.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionIndexMetaData(TableMetaData tableMetaData) Creates an index meta data object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndexColumnFromMetaData(ResultSet resultSet) Adds an index column from the database metadata result.booleanGets the columns.Gets the filter condition.Gets the index name.Gets the table.inthashCode()booleanReturns whether this is the primary key for the object id.booleanisUnique()Returns whether index is unique.voidsetFilterCondition(String filterCondition) Sets the filter condition.voidsetIndexName(String indexName) Sets the index name.voidsetUnique(boolean unique) Sets whether index is unique.voidsetupIndexFromMetaData(ResultSet resultSet) Sets up the index from the database metadata result.toString()voidvalidate()Validates and post-processes the index data.
-
Constructor Details
-
IndexMetaData
Creates an index meta data object.- Parameters:
tableMetaData- the table the index belongs to
-
-
Method Details
-
setupIndexFromMetaData
Sets up the index from the database metadata result.- Parameters:
resultSet- the column result set- Throws:
SQLException- the processing the result set failed
-
addIndexColumnFromMetaData
Adds an index column from the database metadata result.- Parameters:
resultSet- the column result set- Throws:
SQLException- the processing the result set failed
-
getTableMetaData
Gets the table.- Returns:
- the table meta data
-
getColumns
Gets the columns.- Returns:
- the columns for this index
-
getIndexName
Gets the index name.- Returns:
- the name in lowercase without schema
-
setIndexName
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
Gets the filter condition.- Returns:
- the filter, null if none
-
setFilterCondition
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
-
hashCode
public int hashCode() -
equals
-