Top Description Inners Fields Constructors Methods
org.hibernate.mapping

public Class Table

extends Object
implements RelationalModel, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.hibernate.mapping.RelationalModel
Known Direct Subclasses
org.hibernate.mapping.DenormalizedTable
Imports
java.io.Serializable, java.util.ArrayList, .HashMap, .Iterator, .List, .Map, .LinkedHashMap, org.hibernate.HibernateException, .MappingException, org.hibernate.dialect.Dialect, org.hibernate.engine.Mapping, org.hibernate.tool.hbm2ddl.ColumnMetadata, .TableMetadata, org.hibernate.util.CollectionHelper

A relational table
Author
Gavin King

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private String
private List<E>
private Map<K, V>
columns

contains all columns, including the primary key

private String
private Map<K, V>
private boolean
private KeyValue
private Map<K, V>
private boolean
private String
private PrimaryKey
private boolean
private String
private String
private boolean
private String
private static int
private final int
private Map<K, V>

Constructor Summary

AccessConstructor and Description
public
public
Table(String name)

Method Summary

Modifier and TypeMethod and Description
public void
public void
addColumn(Column column)

public Index
addIndex(Index index)

public UniqueKey
public boolean
public ForeignKey
createForeignKey(String keyName, List<E> keyColumns, String referencedEntityName)

public ForeignKey
createForeignKey(String keyName, List<E> keyColumns, String referencedEntityName, List<E> referencedColumns)

public void
public UniqueKey
createUniqueKey(List<E> keyColumns)

public String
public Iterator<E>
public Column

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
(Column
column with atleast a name.
column
)

Return the column which is identified by column provided as argument.

public Column
getColumn(int n)

public Iterator<E>
public int
public String
public Iterator<E>
public KeyValue
public Index
getIndex(String indexName)

public Iterator<E>
public String
public Index
public UniqueKey
public PrimaryKey
public String
getQualifiedName(Dialect dialect, String defaultCatalog, String defaultSchema)

public String
getQuotedName()

returns quoted name as it would be in the mapping file.

public String
public String
getQuotedSchema()

returns quoted name as it is in the mapping file.

public String
public String
public String
public String
public int
public UniqueKey
public Iterator<E>
pack-priv Map<K, V>
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public boolean
public static String
qualify(String catalog, String schema, String table)

public void
setAbstract(boolean isAbstract)

public void
setCatalog(String catalog)

public void
setComment(String comment)

pack-priv void
public void
public void
public void
public void
setQuoted(boolean quoted)

public void
public void
setSchema(String schema)

public void
setSubselect(String subselect)

public Iterator<E>
sqlAlterStrings(Dialect dialect, Mapping p, TableMetadata tableInfo, String defaultCatalog, String defaultSchema)

public Iterator<E>
sqlCommentStrings(Dialect dialect, String defaultCatalog, String defaultSchema)

public String
public String
sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)

Implements org.hibernate.mapping.RelationalModel.sqlDropString.

public String
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public String
public String
uniqueColumnString(Iterator<E> iterator, String referencedEntityName)

public void
validateColumns(Dialect dialect, Mapping mapping, TableMetadata tableInfo)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

catalogback to summary
private String catalog
checkConstraintsback to summary
private List<E> checkConstraints
columnsback to summary
private Map<K, V> columns

contains all columns, including the primary key

commentback to summary
private String comment
foreignKeysback to summary
private Map<K, V> foreignKeys
hasDenormalizedTablesback to summary
private boolean hasDenormalizedTables
idValueback to summary
private KeyValue idValue
indexesback to summary
private Map<K, V> indexes
isAbstractback to summary
private boolean isAbstract
nameback to summary
private String name
primaryKeyback to summary
private PrimaryKey primaryKey
quotedback to summary
private boolean quoted
rowIdback to summary
private String rowId
schemaback to summary
private String schema
schemaQuotedback to summary
private boolean schemaQuoted
subselectback to summary
private String subselect
tableCounterback to summary
private static int tableCounter
uniqueIntegerback to summary
private final int uniqueInteger
uniqueKeysback to summary
private Map<K, V> uniqueKeys

Constructor Detail

Tableback to summary
public Table()
Tableback to summary
public Table(String name)

Method Detail

addCheckConstraintback to summary
public void addCheckConstraint(String constraint)
addColumnback to summary
public void addColumn(Column column)
addIndexback to summary
public Index addIndex(Index index)
addUniqueKeyback to summary
public UniqueKey addUniqueKey(UniqueKey uniqueKey)
containsColumnback to summary
public boolean containsColumn(Column column)
createForeignKeyback to summary
public ForeignKey createForeignKey(String keyName, List<E> keyColumns, String referencedEntityName)
createForeignKeyback to summary
public ForeignKey createForeignKey(String keyName, List<E> keyColumns, String referencedEntityName, List<E> referencedColumns)
createForeignKeysback to summary
public void createForeignKeys()
createUniqueKeyback to summary
public UniqueKey createUniqueKey(List<E> keyColumns)
getCatalogback to summary
public String getCatalog()
getCheckConstraintsIteratorback to summary
public Iterator<E> getCheckConstraintsIterator()
getColumnback to summary
public Column getColumn(Column column)

Return the column which is identified by column provided as argument.

Parameters
column:Column

column with atleast a name.

Returns:Column

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.

getColumnback to summary
public Column getColumn(int n)
getColumnIteratorback to summary
public Iterator<E> getColumnIterator()
getColumnSpanback to summary
public int getColumnSpan()
getCommentback to summary
public String getComment()
getForeignKeyIteratorback to summary
public Iterator<E> getForeignKeyIterator()
getIdentifierValueback to summary
public KeyValue getIdentifierValue()
getIndexback to summary
public Index getIndex(String indexName)
getIndexIteratorback to summary
public Iterator<E> getIndexIterator()
getNameback to summary
public String getName()
getOrCreateIndexback to summary
public Index getOrCreateIndex(String indexName)
getOrCreateUniqueKeyback to summary
public UniqueKey getOrCreateUniqueKey(String keyName)
getPrimaryKeyback to summary
public PrimaryKey getPrimaryKey()
getQualifiedNameback to summary
public String getQualifiedName(Dialect dialect, String defaultCatalog, String defaultSchema)
getQuotedNameback to summary
public String getQuotedName()

returns quoted name as it would be in the mapping file.

getQuotedNameback to summary
public String getQuotedName(Dialect dialect)
getQuotedSchemaback to summary
public String getQuotedSchema()

returns quoted name as it is in the mapping file.

getQuotedSchemaback to summary
public String getQuotedSchema(Dialect dialect)
getRowIdback to summary
public String getRowId()
getSchemaback to summary
public String getSchema()
getSubselectback to summary
public String getSubselect()
getUniqueIntegerback to summary
public int getUniqueInteger()
getUniqueKeyback to summary
public UniqueKey getUniqueKey(String keyName)
getUniqueKeyIteratorback to summary
public Iterator<E> getUniqueKeyIterator()
getUniqueKeysback to summary
pack-priv Map<K, V> getUniqueKeys()
hasDenormalizedTablesback to summary
public boolean hasDenormalizedTables()
hasPrimaryKeyback to summary
public boolean hasPrimaryKey()
isAbstractback to summary
public boolean isAbstract()
isAbstractUnionTableback to summary
public boolean isAbstractUnionTable()
isPhysicalTableback to summary
public boolean isPhysicalTable()
isQuotedback to summary
public boolean isQuoted()
isSchemaQuotedback to summary
public boolean isSchemaQuoted()
isSubselectback to summary
public boolean isSubselect()
qualifyback to summary
public static String qualify(String catalog, String schema, String table)
setAbstractback to summary
public void setAbstract(boolean isAbstract)
setCatalogback to summary
public void setCatalog(String catalog)
setCommentback to summary
public void setComment(String comment)
setHasDenormalizedTablesback to summary
pack-priv void setHasDenormalizedTables()
setIdentifierValueback to summary
public void setIdentifierValue(KeyValue idValue)
setNameback to summary
public void setName(String name)
setPrimaryKeyback to summary
public void setPrimaryKey(PrimaryKey primaryKey)
setQuotedback to summary
public void setQuoted(boolean quoted)
setRowIdback to summary
public void setRowId(String rowId)
setSchemaback to summary
public void setSchema(String schema)
setSubselectback to summary
public void setSubselect(String subselect)
sqlAlterStringsback to summary
public Iterator<E> sqlAlterStrings(Dialect dialect, Mapping p, TableMetadata tableInfo, String defaultCatalog, String defaultSchema) throws HibernateException
sqlCommentStringsback to summary
public Iterator<E> sqlCommentStrings(Dialect dialect, String defaultCatalog, String defaultSchema)
sqlCreateStringback to summary
public String sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema)

Implements org.hibernate.mapping.RelationalModel.sqlCreateString.

sqlDropStringback to summary
public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)

Implements org.hibernate.mapping.RelationalModel.sqlDropString.

sqlTemporaryTableCreateStringback to summary
public String sqlTemporaryTableCreateString(Dialect dialect, Mapping mapping) throws HibernateException
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

uniqueColumnStringback to summary
public String uniqueColumnString(Iterator<E> iterator)
uniqueColumnStringback to summary
public String uniqueColumnString(Iterator<E> iterator, String referencedEntityName)
validateColumnsback to summary
public void validateColumns(Dialect dialect, Mapping mapping, TableMetadata tableInfo)
org.hibernate.mapping back to summary

pack-priv Class Table.ForeignKeyKey

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable

Field Summary

Modifier and TypeField and Description
pack-priv List<E>
pack-priv String
pack-priv List<E>

Constructor Summary

AccessConstructor and Description
pack-priv
ForeignKeyKey(List<E> columns, String referencedClassName, List<E> referencedColumns)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

columnsback to summary
pack-priv List<E> columns
referencedClassNameback to summary
pack-priv String referencedClassName
referencedColumnsback to summary
pack-priv List<E> referencedColumns

Constructor Detail

ForeignKeyKeyback to summary
pack-priv ForeignKeyKey(List<E> columns, String referencedClassName, List<E> referencedColumns)

Method Detail

equalsback to summary
public boolean equals(Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.