Class TableInformationImpl
- java.lang.Object
-
- org.hibernate.tool.schema.extract.internal.TableInformationImpl
-
- All Implemented Interfaces:
TableInformation
public class TableInformationImpl extends Object implements TableInformation
Provides access to information about existing schema objects (tables, sequences etc) of existing database.
-
-
Constructor Summary
Constructors Constructor Description TableInformationImpl(InformationExtractor extractor, IdentifierHelper identifierHelper, QualifiedTableName tableName, boolean physicalTable, String comment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(ColumnInformation columnIdentifier)protected Map<Identifier,ForeignKeyInformation>foreignKeys()ColumnInformationgetColumn(Identifier columnIdentifier)Retrieve the named ColumnInformationStringgetComment()Get the comments/remarks defined for the table.ForeignKeyInformationgetForeignKey(Identifier fkIdentifier)Retrieve the named ForeignKeyInformationIterable<ForeignKeyInformation>getForeignKeys()Obtain an iterable over all the table's defined foreign keys.IndexInformationgetIndex(Identifier indexName)Retrieve the named IndexInformationIterable<IndexInformation>getIndexes()Obtain an iterable over all the table's defined indexes.QualifiedTableNamegetName()Get the qualified name of the table.PrimaryKeyInformationgetPrimaryKey()Retrieve information about the table's primary key, if one is defined (aka, may returnnull).protected Map<Identifier,IndexInformation>indexes()booleanisPhysicalTable()Does this information describe a physical table as opposed to a view, etc?StringtoString()
-
-
-
Constructor Detail
-
TableInformationImpl
public TableInformationImpl(InformationExtractor extractor, IdentifierHelper identifierHelper, QualifiedTableName tableName, boolean physicalTable, String comment)
-
-
Method Detail
-
getName
public QualifiedTableName getName()
Description copied from interface:TableInformationGet the qualified name of the table.- Specified by:
getNamein interfaceTableInformation- Returns:
- The qualified table name
-
isPhysicalTable
public boolean isPhysicalTable()
Description copied from interface:TableInformationDoes this information describe a physical table as opposed to a view, etc?- Specified by:
isPhysicalTablein interfaceTableInformation- Returns:
trueif this is a physical table;falseotherwise.
-
getComment
public String getComment()
Description copied from interface:TableInformationGet the comments/remarks defined for the table.- Specified by:
getCommentin interfaceTableInformation- Returns:
- The table comments
-
getColumn
public ColumnInformation getColumn(Identifier columnIdentifier)
Description copied from interface:TableInformationRetrieve the named ColumnInformation- Specified by:
getColumnin interfaceTableInformation- Parameters:
columnIdentifier- The column identifier (simple name)- Returns:
- The matching column information. May return
null
-
getPrimaryKey
public PrimaryKeyInformation getPrimaryKey()
Description copied from interface:TableInformationRetrieve information about the table's primary key, if one is defined (aka, may returnnull).- Specified by:
getPrimaryKeyin interfaceTableInformation- Returns:
- The primary key information, or
nullif the table did not define a primary key.
-
getForeignKeys
public Iterable<ForeignKeyInformation> getForeignKeys()
Description copied from interface:TableInformationObtain an iterable over all the table's defined foreign keys.- Specified by:
getForeignKeysin interfaceTableInformation- Returns:
- The iterable.
-
foreignKeys
protected Map<Identifier,ForeignKeyInformation> foreignKeys()
-
getForeignKey
public ForeignKeyInformation getForeignKey(Identifier fkIdentifier)
Description copied from interface:TableInformationRetrieve the named ForeignKeyInformation- Specified by:
getForeignKeyin interfaceTableInformation- Parameters:
fkIdentifier- The foreign key identifier (simple name)- Returns:
- The matching foreign key information. May return
null
-
getIndexes
public Iterable<IndexInformation> getIndexes()
Description copied from interface:TableInformationObtain an iterable over all the table's defined indexes.- Specified by:
getIndexesin interfaceTableInformation- Returns:
- The iterable.
-
indexes
protected Map<Identifier,IndexInformation> indexes()
-
addColumn
public void addColumn(ColumnInformation columnIdentifier)
- Specified by:
addColumnin interfaceTableInformation
-
getIndex
public IndexInformation getIndex(Identifier indexName)
Description copied from interface:TableInformationRetrieve the named IndexInformation- Specified by:
getIndexin interfaceTableInformation- Parameters:
indexName- The index identifier (simple name)- Returns:
- The matching index information. May return
null
-
-