org.hibernate.mapping

Class Table

Implemented Interfaces:
RelationalModel, Serializable
Known Direct Subclasses:
DenormalizedTable

public class Table
extends java.lang.Object
implements RelationalModel, Serializable

A relational table
Author:
Gavin King

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(int n)
Column
getColumn(Column column)
Return the column which is identified by column provided as argument.
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
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
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)

Constructor Details

Table

public Table()

Table

public Table(String name)

Method Details

addCheckConstraint

public void addCheckConstraint(String constraint)

addColumn

public void addColumn(Column column)

addIndex

public Index addIndex(Index index)

addUniqueKey

public UniqueKey addUniqueKey(UniqueKey uniqueKey)

containsColumn

public boolean containsColumn(Column column)

createForeignKey

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

createForeignKey

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

createForeignKeys

public void createForeignKeys()

createUniqueKey

public UniqueKey createUniqueKey(List keyColumns)

getCatalog

public String getCatalog()

getCheckConstraintsIterator

public Iterator getCheckConstraintsIterator()

getColumn

public Column getColumn(int n)

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.

getColumnIterator

public Iterator getColumnIterator()

getColumnSpan

public int getColumnSpan()

getComment

public String getComment()

getForeignKeyIterator

public Iterator getForeignKeyIterator()

getIdentifierValue

public KeyValue getIdentifierValue()

getIndex

public Index getIndex(String indexName)

getIndexIterator

public Iterator getIndexIterator()

getName

public String getName()

getOrCreateIndex

public Index getOrCreateIndex(String indexName)

getOrCreateUniqueKey

public UniqueKey getOrCreateUniqueKey(String keyName)

getPrimaryKey

public PrimaryKey getPrimaryKey()

getQualifiedName

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

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)

getRowId

public String getRowId()

getSchema

public String getSchema()

getSubselect

public String getSubselect()

getUniqueInteger

public int getUniqueInteger()

getUniqueKey

public UniqueKey getUniqueKey(String keyName)

getUniqueKeyIterator

public Iterator getUniqueKeyIterator()

hasDenormalizedTables

public boolean hasDenormalizedTables()

hasPrimaryKey

public boolean hasPrimaryKey()

isAbstract

public boolean isAbstract()

isAbstractUnionTable

public boolean isAbstractUnionTable()

isPhysicalTable

public boolean isPhysicalTable()

isQuoted

public boolean isQuoted()

isSchemaQuoted

public boolean isSchemaQuoted()

isSubselect

public boolean isSubselect()

qualify

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

setAbstract

public void setAbstract(boolean isAbstract)

setCatalog

public void setCatalog(String catalog)

setComment

public void setComment(String comment)

setIdentifierValue

public void setIdentifierValue(KeyValue idValue)

setName

public void setName(String name)

setPrimaryKey

public void setPrimaryKey(PrimaryKey primaryKey)

setQuoted

public void setQuoted(boolean quoted)

setRowId

public void setRowId(String rowId)

setSchema

public void setSchema(String schema)

setSubselect

public void setSubselect(String subselect)

sqlAlterStrings

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

sqlCommentStrings

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

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

sqlTemporaryTableCreateString

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

toString

public String toString()

uniqueColumnString

public String uniqueColumnString(Iterator iterator)

uniqueColumnString

public String uniqueColumnString(Iterator iterator,
                                 String referencedEntityName)

validateColumns

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