Package org.hibernate.mapping
Class Table
- java.lang.Object
-
- org.hibernate.mapping.Table
-
- All Implemented Interfaces:
Serializable
,ContributableDatabaseObject
,Exportable
,Contributable
- Direct Known Subclasses:
DenormalizedTable
public class Table extends Object implements Serializable, ContributableDatabaseObject
A mapping model object representing a relational database table.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Table.ForeignKeyKey
-
Constructor Summary
Constructors Constructor Description Table()
Deprecated, for removal: This API element is subject to removal in a future version.Table(String contributor)
Table(String contributor, String name)
Table(String contributor, Namespace namespace, String subselect, boolean isAbstract)
Table(String contributor, Namespace namespace, Identifier physicalTableName, boolean isAbstract)
Table(String contributor, Namespace namespace, Identifier physicalTableName, String subselect, boolean isAbstract)
-
Method Summary
-
-
-
Constructor Detail
-
Table
@Deprecated(since="6.2", forRemoval=true) public Table()
Deprecated, for removal: This API element is subject to removal in a future version.
-
Table
public Table(String contributor)
-
Table
public Table(String contributor, Namespace namespace, Identifier physicalTableName, boolean isAbstract)
-
Table
public Table(String contributor, Namespace namespace, Identifier physicalTableName, String subselect, boolean isAbstract)
-
-
Method Detail
-
getContributor
public String getContributor()
Description copied from interface:Contributable
The name of the contributor which contributed this- Specified by:
getContributor
in interfaceContributable
-
getQualifiedName
public String getQualifiedName(SqlStringGenerationContext context)
-
qualify
@Deprecated public static String qualify(String catalog, String schema, String table)
Deprecated.Should build aQualifiedTableName
then useSqlStringGenerationContext.format(QualifiedTableName)
.
-
setName
public void setName(String name)
-
getName
public String getName()
-
getNameIdentifier
public Identifier getNameIdentifier()
-
getSchemaIdentifier
public Identifier getSchemaIdentifier()
-
getCatalogIdentifier
public Identifier getCatalogIdentifier()
-
getQuotedName
public String getQuotedName()
-
getQualifiedTableName
public QualifiedTableName getQualifiedTableName()
-
isQuoted
public boolean isQuoted()
-
setQuoted
public void setQuoted(boolean quoted)
-
setSchema
public void setSchema(String schema)
-
getSchema
public String getSchema()
-
getQuotedSchema
public String getQuotedSchema()
-
isSchemaQuoted
public boolean isSchemaQuoted()
-
setCatalog
public void setCatalog(String catalog)
-
getCatalog
public String getCatalog()
-
getQuotedCatalog
public String getQuotedCatalog()
-
isCatalogQuoted
public boolean isCatalogQuoted()
-
getColumn
public Column getColumn(Column column)
Return the column which is identified by column provided as argument.- Parameters:
column
- column with at least a name.- Returns:
- the underlying column or null if not inside this table. Note: the instance *can* be different than the input parameter, but the name will be the same.
-
getColumn
public Column getColumn(Identifier name)
-
getColumn
@Internal public Column getColumn(InFlightMetadataCollector collector, String logicalName)
-
getColumn
public Column getColumn(int n)
-
addColumn
public void addColumn(Column column)
-
getColumnSpan
public int getColumnSpan()
-
getColumnIterator
@Deprecated(since="6.0") public Iterator<Column> getColumnIterator()
Deprecated.
-
getColumns
public Collection<Column> getColumns()
-
getIndexIterator
@Deprecated(since="6.2") public Iterator<Index> getIndexIterator()
Deprecated.
-
getForeignKeyIterator
@Deprecated(since="6.0") public Iterator<ForeignKey> getForeignKeyIterator()
Deprecated.
-
getForeignKeys
public Map<Table.ForeignKeyKey,ForeignKey> getForeignKeys()
-
getUniqueKeyIterator
@Deprecated(since="6.0") public Iterator<UniqueKey> getUniqueKeyIterator()
Deprecated.
-
equals
public boolean equals(Table table)
-
sqlAlterStrings
@Deprecated(since="6.2") @Remove public @Remove Iterator<String> sqlAlterStrings(Dialect dialect, Metadata metadata, TableInformation tableInfo, SqlStringGenerationContext sqlStringGenerationContext) throws HibernateException
Deprecated.- Throws:
HibernateException
-
isPrimaryKey
public boolean isPrimaryKey(Column column)
-
hasPrimaryKey
public boolean hasPrimaryKey()
-
getPrimaryKey
public PrimaryKey getPrimaryKey()
-
setPrimaryKey
public void setPrimaryKey(PrimaryKey primaryKey)
-
createUniqueKey
public void createUniqueKey(List<Column> keyColumns)
If there is one given column, mark it unique, otherwise create aUniqueKey
comprising the given columns.
-
createForeignKeys
public void createForeignKeys()
-
createForeignKey
public ForeignKey createForeignKey(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition)
-
createForeignKey
public ForeignKey createForeignKey(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition, List<Column> referencedColumns)
-
setUniqueInteger
public void setUniqueInteger(int uniqueInteger)
-
getUniqueInteger
public int getUniqueInteger()
-
setIdentifierValue
public void setIdentifierValue(KeyValue idValue)
-
getIdentifierValue
public KeyValue getIdentifierValue()
-
addCheckConstraint
@Deprecated(since="6.2") public void addCheckConstraint(String constraint)
Deprecated.
-
addCheck
public void addCheck(CheckConstraint check)
-
containsColumn
public boolean containsColumn(Column column)
-
getRowId
public String getRowId()
-
setRowId
public void setRowId(String rowId)
-
getSubselect
public String getSubselect()
-
setSubselect
public void setSubselect(String subselect)
-
isSubselect
public boolean isSubselect()
-
isAbstractUnionTable
public boolean isAbstractUnionTable()
-
hasDenormalizedTables
public boolean hasDenormalizedTables()
-
setAbstract
public void setAbstract(boolean isAbstract)
-
isAbstract
public boolean isAbstract()
-
isPhysicalTable
public boolean isPhysicalTable()
-
getComment
public String getComment()
-
setComment
public void setComment(String comment)
-
getCheckConstraintsIterator
@Deprecated(since="6.0") public Iterator<String> getCheckConstraintsIterator()
Deprecated.
-
getCheckConstraints
@Deprecated(since="6.2") public List<String> getCheckConstraints()
Deprecated.
-
getChecks
public List<CheckConstraint> getChecks()
-
getExportIdentifier
public String getExportIdentifier()
Description copied from interface:Exportable
Get a unique identifier to make sure we are not exporting the same database structure multiple times.- Specified by:
getExportIdentifier
in interfaceExportable
- Returns:
- The exporting identifier.
-
addInitCommand
@Deprecated public void addInitCommand(InitCommand command)
Deprecated.UseaddInitCommand(Function)
instead.
-
addInitCommand
public void addInitCommand(Function<SqlStringGenerationContext,InitCommand> commandProducer)
-
getInitCommands
public List<InitCommand> getInitCommands(SqlStringGenerationContext context)
-
-