Package org.hibernate.mapping
Class Table
java.lang.Object
org.hibernate.mapping.Table
- All Implemented Interfaces:
Serializable
,ContributableDatabaseObject
,Exportable
,Contributable
- Direct Known Subclasses:
DenormalizedTable
A mapping model object representing a relational database table.
- See Also:
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTable()
Deprecated, for removal: This API element is subject to removal in a future version.Table
(String contributor, Namespace namespace, Identifier physicalTableName, boolean isAbstract) Table
(String contributor, Namespace namespace, Identifier physicalTableName, String subselect, boolean isAbstract) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCheck
(CheckConstraint check) void
addCheckConstraint
(String constraint) Deprecated.void
void
addInitCommand
(Function<SqlStringGenerationContext, InitCommand> commandProducer) void
addInitCommand
(InitCommand command) Deprecated.addUniqueKey
(UniqueKey uniqueKey) void
columnRenamed
(Column column) boolean
containsColumn
(Column column) createForeignKey
(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition) createForeignKey
(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition, List<Column> referencedColumns) void
createForeignKeys
(MetadataBuildingContext context) void
createUniqueKey
(List<Column> keyColumns) Deprecated, for removal: This API element is subject to removal in a future version.void
createUniqueKey
(List<Column> keyColumns, MetadataBuildingContext context) If there is one given column, mark it unique, otherwise create aUniqueKey
comprising the given columns.void
createUniqueKey
(Column column, MetadataBuildingContext context) Mark the given column unique.boolean
boolean
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removedDeprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removedgetColumn
(int n) getColumn
(Identifier name) getColumn
(InFlightMetadataCollector collector, String logicalName) Return the column which is identified by column provided as argument.int
The name of the contributor which contributed thisGet a unique identifier to make sure we are not exporting the same database structure multiple times.Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removedgetName()
getOrCreateIndex
(String indexName) getOrCreateUniqueKey
(String keyName) getQuotedCatalog
(Dialect dialect) getQuotedName
(Dialect dialect) getQuotedSchema
(Dialect dialect) getRowId()
int
getUniqueKey
(String keyName) Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removedboolean
int
hashCode()
boolean
boolean
boolean
boolean
boolean
boolean
isPrimaryKey
(Column column) boolean
isQuoted()
boolean
boolean
boolean
isView()
static String
Deprecated.Should build aQualifiedTableName
then useSqlStringGenerationContext.format(QualifiedTableName)
.void
reorderColumns
(List<Column> columns) void
setAbstract
(boolean isAbstract) void
setCatalog
(String catalog) void
setComment
(String comment) void
void
setPrimaryKey
(PrimaryKey primaryKey) void
setQuoted
(boolean quoted) void
void
void
setSubselect
(String subselect) void
setUniqueInteger
(int uniqueInteger) void
setViewQuery
(String viewQuery) sqlAlterStrings
(Dialect dialect, Metadata metadata, TableInformation tableInfo, SqlStringGenerationContext sqlStringGenerationContext) Deprecated.toString()
-
Constructor Details
-
Table
Deprecated, for removal: This API element is subject to removal in a future version. -
Table
-
Table
-
Table
public Table(String contributor, Namespace namespace, Identifier physicalTableName, boolean isAbstract) -
Table
public Table(String contributor, Namespace namespace, Identifier physicalTableName, String subselect, boolean isAbstract) -
Table
-
-
Method Details
-
getContributor
Description copied from interface:Contributable
The name of the contributor which contributed this- Specified by:
getContributor
in interfaceContributable
-
getQualifiedName
-
qualify
Deprecated.Should build aQualifiedTableName
then useSqlStringGenerationContext.format(QualifiedTableName)
. -
setName
-
getName
-
getNameIdentifier
-
getSchemaIdentifier
-
getCatalogIdentifier
-
getQuotedName
-
getQuotedName
-
getQualifiedTableName
-
isQuoted
public boolean isQuoted() -
setQuoted
public void setQuoted(boolean quoted) -
setSchema
-
getSchema
-
getQuotedSchema
-
getQuotedSchema
-
isSchemaQuoted
public boolean isSchemaQuoted() -
setCatalog
-
getCatalog
-
getQuotedCatalog
-
getQuotedCatalog
-
isCatalogQuoted
public boolean isCatalogQuoted() -
getColumn
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
-
getColumn
-
getColumn
-
addColumn
-
columnRenamed
-
getColumnSpan
public int getColumnSpan() -
getColumns
-
getIndexes
-
getForeignKeyIterator
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed -
getForeignKeys
-
getUniqueKeyIterator
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed -
getUniqueKeys
-
hashCode
public int hashCode() -
equals
-
equals
-
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
-
hasPrimaryKey
public boolean hasPrimaryKey() -
getPrimaryKey
-
setPrimaryKey
-
getOrCreateIndex
-
getIndex
-
addIndex
-
addUniqueKey
-
createUniqueKey
Mark the given column unique. -
createUniqueKey
If there is one given column, mark it unique, otherwise create aUniqueKey
comprising the given columns. -
createUniqueKey
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 aUniqueKey
comprising the given columns. -
getUniqueKey
-
getOrCreateUniqueKey
-
createForeignKeys
-
createForeignKey
-
createForeignKey
-
setUniqueInteger
public void setUniqueInteger(int uniqueInteger) -
getUniqueInteger
public int getUniqueInteger() -
addCheckConstraint
Deprecated. -
addCheck
-
containsColumn
-
getRowId
-
setRowId
-
toString
-
getSubselect
-
setSubselect
-
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
-
setComment
-
getCheckConstraintsIterator
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed -
getCheckConstraints
Deprecated, for removal: This API element is subject to removal in a future version.No longer used, should be removed -
getChecks
-
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.
-
reorderColumns
-
getViewQuery
-
setViewQuery
-
addInitCommand
Deprecated.UseaddInitCommand(Function)
instead. -
addInitCommand
-
getInitCommands
-
addInitCommand(Function)
instead.