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 classTable.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:ContributableThe name of the contributor which contributed this- Specified by:
getContributorin interfaceContributable
-
getQualifiedName
public String getQualifiedName(SqlStringGenerationContext context)
-
qualify
@Deprecated public static String qualify(String catalog, String schema, String table)
Deprecated.Should build aQualifiedTableNamethen 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()
-
getColumns
public Collection<Column> getColumns()
-
getForeignKeyIterator
@Deprecated(since="6.0", forRemoval=true) public Iterator<ForeignKey> getForeignKeyIterator()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed
-
getForeignKeys
public Map<Table.ForeignKeyKey,ForeignKey> getForeignKeys()
-
getUniqueKeyIterator
@Deprecated(since="6.0", forRemoval=true) public Iterator<UniqueKey> getUniqueKeyIterator()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed
-
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(Column column, MetadataBuildingContext context)
Mark the given column unique.
-
createUniqueKey
public void createUniqueKey(List<Column> keyColumns, MetadataBuildingContext context)
If there is one given column, mark it unique, otherwise create aUniqueKeycomprising the given columns.
-
createUniqueKey
@Deprecated(since="6.5", forRemoval=true) public void createUniqueKey(List<Column> keyColumns)
Deprecated, for removal: This API element is subject to removal in a future version.If there is one given column, mark it unique, otherwise create aUniqueKeycomprising the given columns.
-
createForeignKeys
public void createForeignKeys(MetadataBuildingContext context)
-
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()
-
isView
public boolean isView()
-
getComment
public String getComment()
-
setComment
public void setComment(String comment)
-
getCheckConstraintsIterator
@Deprecated(since="6.0", forRemoval=true) public Iterator<String> getCheckConstraintsIterator()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed
-
getCheckConstraints
@Deprecated(since="6.2", forRemoval=true) public List<String> getCheckConstraints()
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed
-
getChecks
public List<CheckConstraint> getChecks()
-
getExportIdentifier
public String getExportIdentifier()
Description copied from interface:ExportableGet a unique identifier to make sure we are not exporting the same database structure multiple times.- Specified by:
getExportIdentifierin interfaceExportable- Returns:
- The exporting identifier.
-
getViewQuery
public String getViewQuery()
-
setViewQuery
public void setViewQuery(String viewQuery)
-
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)
-
-