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:
  • Constructor Details

  • Method Details

    • getContributor

      public String getContributor()
      Description copied from interface: Contributable
      The name of the contributor which contributed this
      Specified by:
      getContributor in interface Contributable
    • getQualifiedName

      public String getQualifiedName(SqlStringGenerationContext context)
    • qualify

      @Deprecated public static String qualify(String catalog, String schema, String table)
    • 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()
    • getQuotedName

      public String getQuotedName(Dialect dialect)
    • 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()
    • getQuotedSchema

      public String getQuotedSchema(Dialect dialect)
    • isSchemaQuoted

      public boolean isSchemaQuoted()
    • setCatalog

      public void setCatalog(String catalog)
    • getCatalog

      public String getCatalog()
    • getQuotedCatalog

      public String getQuotedCatalog()
    • getQuotedCatalog

      public String getQuotedCatalog(Dialect dialect)
    • 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)
    • columnRenamed

      @Internal public void columnRenamed(Column column)
    • getColumnSpan

      public int getColumnSpan()
    • getColumns

      public Collection<Column> getColumns()
    • getIndexes

      public Map<String,Index> getIndexes()
    • getForeignKeys

      public Map<Table.ForeignKeyKey,ForeignKey> getForeignKeys()
    • getUniqueKeys

      public Map<String,UniqueKey> getUniqueKeys()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(Table table)
    • isPrimaryKey

      public boolean isPrimaryKey(Column column)
    • hasPrimaryKey

      public boolean hasPrimaryKey()
    • getPrimaryKey

      public PrimaryKey getPrimaryKey()
    • setPrimaryKey

      public void setPrimaryKey(PrimaryKey primaryKey)
    • getOrCreateIndex

      public Index getOrCreateIndex(String indexName)
    • getIndex

      public Index getIndex(String indexName)
    • addIndex

      public Index addIndex(Index index)
    • addUniqueKey

      public UniqueKey addUniqueKey(UniqueKey uniqueKey)
    • 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 a UniqueKey comprising the given columns.
    • getUniqueKey

      public UniqueKey getUniqueKey(String keyName)
    • getOrCreateUniqueKey

      public UniqueKey getOrCreateUniqueKey(String keyName)
    • createForeignKeys

      public void createForeignKeys(MetadataBuildingContext context)
    • createForeignKey

      @Deprecated(since="7.0", forRemoval=true) public ForeignKey createForeignKey(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • createForeignKey

      public ForeignKey createForeignKey(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition, String options)
    • createForeignKey

      public ForeignKey createForeignKey(String keyName, List<Column> keyColumns, String referencedEntityName, String keyDefinition, String options, List<Column> referencedColumns)
    • setUniqueInteger

      public void setUniqueInteger(int uniqueInteger)
    • getUniqueInteger

      public int getUniqueInteger()
    • 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)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)
    • 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 interface Exportable
      Returns:
      The exporting identifier.
    • reorderColumns

      @Internal public void reorderColumns(List<Column> columns)
    • getViewQuery

      public String getViewQuery()
    • setViewQuery

      public void setViewQuery(String viewQuery)
    • addInitCommand

      @Deprecated public void addInitCommand(InitCommand command)
      Deprecated.
    • addInitCommand

      public void addInitCommand(Function<SqlStringGenerationContext,InitCommand> commandProducer)
    • getInitCommands

      public List<InitCommand> getInitCommands(SqlStringGenerationContext context)
    • getOptions

      public String getOptions()
    • setOptions

      public void setOptions(String options)