org.hibernate.mapping
Class Table

java.lang.Object
  extended by org.hibernate.mapping.Table
All Implemented Interfaces:
Serializable, RelationalModel
Direct Known Subclasses:
DenormalizedTable

public class Table
extends Object
implements RelationalModel, Serializable

A relational table

See Also:
Serialized Form

Constructor Summary
Table()
           
Table(String name)
           
 
Method Summary
 void addCheckConstraint(String constraint)
           
 void addColumn(Column column)
           
 Index addIndex(Index index)
           
 UniqueKey addUniqueKey(UniqueKey uniqueKey)
           
 boolean containsColumn(Column column)
           
 ForeignKey createForeignKey(String keyName, List keyColumns, String referencedEntityName)
           
 ForeignKey createForeignKey(String keyName, List keyColumns, String referencedEntityName, List referencedColumns)
           
 void createForeignKeys()
           
 UniqueKey createUniqueKey(List keyColumns)
           
 String getCatalog()
           
 Iterator getCheckConstraintsIterator()
           
 Column getColumn(Column column)
          Return the column which is identified by column provided as argument.
 Column getColumn(int n)
           
 Iterator getColumnIterator()
           
 int getColumnSpan()
           
 String getComment()
           
 Iterator getForeignKeyIterator()
           
 KeyValue getIdentifierValue()
           
 Index getIndex(String indexName)
           
 Iterator getIndexIterator()
           
 String getName()
           
 Index getOrCreateIndex(String indexName)
           
 UniqueKey getOrCreateUniqueKey(String keyName)
           
 PrimaryKey getPrimaryKey()
           
 String getQualifiedName(Dialect dialect, String defaultCatalog, String defaultSchema)
           
 String getQuotedCatalog()
           
 String getQuotedCatalog(Dialect dialect)
           
 String getQuotedName()
          returns quoted name as it would be in the mapping file.
 String getQuotedName(Dialect dialect)
           
 String getQuotedSchema()
          returns quoted name as it is in the mapping file.
 String getQuotedSchema(Dialect dialect)
           
 String getRowId()
           
 String getSchema()
           
 String getSubselect()
           
 int getUniqueInteger()
           
 UniqueKey getUniqueKey(String keyName)
           
 Iterator getUniqueKeyIterator()
           
 boolean hasDenormalizedTables()
           
 boolean hasPrimaryKey()
           
 boolean isAbstract()
           
 boolean isAbstractUnionTable()
           
 boolean isCatalogQuoted()
           
 boolean isPhysicalTable()
           
 boolean isQuoted()
           
 boolean isSchemaQuoted()
           
 boolean isSubselect()
           
static String qualify(String catalog, String schema, String table)
           
 void setAbstract(boolean isAbstract)
           
 void setCatalog(String catalog)
           
 void setComment(String comment)
           
 void setIdentifierValue(KeyValue idValue)
           
 void setName(String name)
           
 void setPrimaryKey(PrimaryKey primaryKey)
           
 void setQuoted(boolean quoted)
           
 void setRowId(String rowId)
           
 void setSchema(String schema)
           
 void setSubselect(String subselect)
           
 Iterator sqlAlterStrings(Dialect dialect, Mapping p, TableMetadata tableInfo, String defaultCatalog, String defaultSchema)
           
 Iterator sqlCommentStrings(Dialect dialect, String defaultCatalog, String defaultSchema)
           
 String sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema)
           
 String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)
           
 String sqlTemporaryTableCreateString(Dialect dialect, Mapping mapping)
           
 String toString()
           
 String uniqueColumnString(Iterator iterator)
           
 String uniqueColumnString(Iterator iterator, String referencedEntityName)
           
 void validateColumns(Dialect dialect, Mapping mapping, TableMetadata tableInfo)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Table

public Table()

Table

public Table(String name)
Method Detail

getQualifiedName

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

qualify

public static String qualify(String catalog,
                             String schema,
                             String table)

getName

public String getName()

getQuotedName

public String getQuotedName()
returns quoted name as it would be in the mapping file.


getQuotedName

public String getQuotedName(Dialect dialect)

getQuotedSchema

public String getQuotedSchema()
returns quoted name as it is in the mapping file.


getQuotedSchema

public String getQuotedSchema(Dialect dialect)

getQuotedCatalog

public String getQuotedCatalog()

getQuotedCatalog

public String getQuotedCatalog(Dialect dialect)

setName

public void setName(String name)

getColumn

public Column getColumn(Column column)
Return the column which is identified by column provided as argument.

Parameters:
column - column with atleast 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(int n)

addColumn

public void addColumn(Column column)

getColumnSpan

public int getColumnSpan()

getColumnIterator

public Iterator getColumnIterator()

getIndexIterator

public Iterator getIndexIterator()

getForeignKeyIterator

public Iterator getForeignKeyIterator()

getUniqueKeyIterator

public Iterator getUniqueKeyIterator()

validateColumns

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

sqlAlterStrings

public Iterator sqlAlterStrings(Dialect dialect,
                                Mapping p,
                                TableMetadata tableInfo,
                                String defaultCatalog,
                                String defaultSchema)
                         throws HibernateException
Throws:
HibernateException

hasPrimaryKey

public boolean hasPrimaryKey()

sqlTemporaryTableCreateString

public String sqlTemporaryTableCreateString(Dialect dialect,
                                            Mapping mapping)
                                     throws HibernateException
Throws:
HibernateException

sqlCreateString

public String sqlCreateString(Dialect dialect,
                              Mapping p,
                              String defaultCatalog,
                              String defaultSchema)
Specified by:
sqlCreateString in interface RelationalModel

sqlDropString

public String sqlDropString(Dialect dialect,
                            String defaultCatalog,
                            String defaultSchema)
Specified by:
sqlDropString in interface RelationalModel

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 UniqueKey createUniqueKey(List keyColumns)

getUniqueKey

public UniqueKey getUniqueKey(String keyName)

getOrCreateUniqueKey

public UniqueKey getOrCreateUniqueKey(String keyName)

createForeignKeys

public void createForeignKeys()

createForeignKey

public ForeignKey createForeignKey(String keyName,
                                   List keyColumns,
                                   String referencedEntityName)

createForeignKey

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

uniqueColumnString

public String uniqueColumnString(Iterator iterator)

uniqueColumnString

public String uniqueColumnString(Iterator iterator,
                                 String referencedEntityName)

getSchema

public String getSchema()

setSchema

public void setSchema(String schema)

getCatalog

public String getCatalog()

setCatalog

public void setCatalog(String catalog)

getUniqueInteger

public int getUniqueInteger()

setIdentifierValue

public void setIdentifierValue(KeyValue idValue)

getIdentifierValue

public KeyValue getIdentifierValue()

isSchemaQuoted

public boolean isSchemaQuoted()

isCatalogQuoted

public boolean isCatalogQuoted()

isQuoted

public boolean isQuoted()

setQuoted

public void setQuoted(boolean quoted)

addCheckConstraint

public void addCheckConstraint(String constraint)

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()

getComment

public String getComment()

setComment

public void setComment(String comment)

getCheckConstraintsIterator

public Iterator getCheckConstraintsIterator()

sqlCommentStrings

public Iterator sqlCommentStrings(Dialect dialect,
                                  String defaultCatalog,
                                  String defaultSchema)


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.