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 void
addColumn(ColumnInformation columnIdentifier)
protected Map<Identifier,ForeignKeyInformation>
foreignKeys()
ColumnInformation
getColumn(Identifier columnIdentifier)
Retrieve the named ColumnInformationString
getComment()
Get the comments/remarks defined for the table.ForeignKeyInformation
getForeignKey(Identifier fkIdentifier)
Retrieve the named ForeignKeyInformationIterable<ForeignKeyInformation>
getForeignKeys()
Obtain an iterable over all the table's defined foreign keys.IndexInformation
getIndex(Identifier indexName)
Retrieve the named IndexInformationIterable<IndexInformation>
getIndexes()
Obtain an iterable over all the table's defined indexes.QualifiedTableName
getName()
Get the qualified name of the table.PrimaryKeyInformation
getPrimaryKey()
Retrieve information about the table's primary key, if one is defined (aka, may returnnull
).protected Map<Identifier,IndexInformation>
indexes()
boolean
isPhysicalTable()
Does this information describe a physical table as opposed to a view, etc?String
toString()
-
-
-
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:TableInformation
Get the qualified name of the table.- Specified by:
getName
in interfaceTableInformation
- Returns:
- The qualified table name
-
isPhysicalTable
public boolean isPhysicalTable()
Description copied from interface:TableInformation
Does this information describe a physical table as opposed to a view, etc?- Specified by:
isPhysicalTable
in interfaceTableInformation
- Returns:
true
if this is a physical table;false
otherwise.
-
getComment
public String getComment()
Description copied from interface:TableInformation
Get the comments/remarks defined for the table.- Specified by:
getComment
in interfaceTableInformation
- Returns:
- The table comments
-
getColumn
public ColumnInformation getColumn(Identifier columnIdentifier)
Description copied from interface:TableInformation
Retrieve the named ColumnInformation- Specified by:
getColumn
in interfaceTableInformation
- Parameters:
columnIdentifier
- The column identifier (simple name)- Returns:
- The matching column information. May return
null
-
getPrimaryKey
public PrimaryKeyInformation getPrimaryKey()
Description copied from interface:TableInformation
Retrieve information about the table's primary key, if one is defined (aka, may returnnull
).- Specified by:
getPrimaryKey
in interfaceTableInformation
- Returns:
- The primary key information, or
null
if the table did not define a primary key.
-
getForeignKeys
public Iterable<ForeignKeyInformation> getForeignKeys()
Description copied from interface:TableInformation
Obtain an iterable over all the table's defined foreign keys.- Specified by:
getForeignKeys
in interfaceTableInformation
- Returns:
- The iterable.
-
foreignKeys
protected Map<Identifier,ForeignKeyInformation> foreignKeys()
-
getForeignKey
public ForeignKeyInformation getForeignKey(Identifier fkIdentifier)
Description copied from interface:TableInformation
Retrieve the named ForeignKeyInformation- Specified by:
getForeignKey
in 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:TableInformation
Obtain an iterable over all the table's defined indexes.- Specified by:
getIndexes
in interfaceTableInformation
- Returns:
- The iterable.
-
indexes
protected Map<Identifier,IndexInformation> indexes()
-
addColumn
public void addColumn(ColumnInformation columnIdentifier)
- Specified by:
addColumn
in interfaceTableInformation
-
getIndex
public IndexInformation getIndex(Identifier indexName)
Description copied from interface:TableInformation
Retrieve the named IndexInformation- Specified by:
getIndex
in interfaceTableInformation
- Parameters:
indexName
- The index identifier (simple name)- Returns:
- The matching index information. May return
null
-
-