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
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTable()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 TypeMethodDescriptionvoidaddCheck(CheckConstraint check) voidaddCheckConstraint(String constraint) Deprecated.voidvoidaddInitCommand(Function<SqlStringGenerationContext, InitCommand> commandProducer) voidaddInitCommand(InitCommand command) Deprecated.addUniqueKey(UniqueKey uniqueKey) voidcolumnRenamed(Column column) booleancontainsColumn(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) voidcreateForeignKeys(MetadataBuildingContext context) voidcreateUniqueKey(List<Column> keyColumns, MetadataBuildingContext context) If there is one given column, mark it unique, otherwise create aUniqueKeycomprising the given columns.voidcreateUniqueKey(Column column, MetadataBuildingContext context) Mark the given column unique.booleanbooleangetColumn(int n) getColumn(Identifier name) getColumn(InFlightMetadataCollector collector, String logicalName) Return the column which is identified by column provided as argument.intThe name of the contributor which contributed thisGet a unique identifier to make sure we are not exporting the same database structure multiple times.getName()getOrCreateIndex(String indexName) getOrCreateUniqueKey(String keyName) getQuotedCatalog(Dialect dialect) getQuotedName(Dialect dialect) getQuotedSchema(Dialect dialect) getRowId()intgetUniqueKey(String keyName) booleaninthashCode()booleanbooleanbooleanbooleanbooleanbooleanisPrimaryKey(Column column) booleanisQuoted()booleanbooleanbooleanisView()static StringDeprecated.Should build aQualifiedTableNamethen useSqlStringGenerationContext.format(QualifiedTableName).voidreorderColumns(List<Column> columns) voidsetAbstract(boolean isAbstract) voidsetCatalog(String catalog) voidsetComment(String comment) voidvoidsetOptions(String options) voidsetPrimaryKey(PrimaryKey primaryKey) voidsetQuoted(boolean quoted) voidvoidvoidsetSubselect(String subselect) voidsetUniqueInteger(int uniqueInteger) voidsetViewQuery(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:ContributableThe name of the contributor which contributed this- Specified by:
getContributorin interfaceContributable
-
getQualifiedName
-
qualify
Deprecated.Should build aQualifiedTableNamethen 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
-
getForeignKeys
-
getUniqueKeys
-
hashCode
public int hashCode() -
equals
-
equals
-
sqlAlterStrings
@Deprecated(since="6.2") @Remove public 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 aUniqueKeycomprising 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
-
getChecks
-
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.
-
reorderColumns
-
getViewQuery
-
setViewQuery
-
addInitCommand
Deprecated.UseaddInitCommand(Function)instead. -
addInitCommand
-
getInitCommands
-
getOptions
-
setOptions
-
addInitCommand(Function)instead.