org.hibernate.mapping
Class Constraint

java.lang.Object
  extended by org.hibernate.mapping.Constraint
All Implemented Interfaces:
Serializable, RelationalModel
Direct Known Subclasses:
ForeignKey, PrimaryKey, UniqueKey

public abstract class Constraint
extends Object
implements RelationalModel, Serializable

A relational constraint.

Author:
Gavin King
See Also:
Serialized Form

Constructor Summary
Constraint()
           
 
Method Summary
 void addColumn(Column column)
           
 void addColumns(Iterator columnIterator)
           
 Iterator columnIterator()
           
 boolean containsColumn(Column column)
           
 Column getColumn(int i)
           
 Iterator getColumnIterator()
           
 List getColumns()
           
 int getColumnSpan()
           
 String getName()
           
 Table getTable()
           
 boolean isGenerated(Dialect dialect)
           
 void setName(String name)
           
 void setTable(Table table)
           
abstract  String sqlConstraintString(Dialect d, String constraintName, String defaultCatalog, String defaultSchema)
           
 String sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema)
           
 String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Constraint

public Constraint()
Method Detail

getName

public String getName()

setName

public void setName(String name)

getColumnIterator

public Iterator getColumnIterator()

addColumn

public void addColumn(Column column)

addColumns

public void addColumns(Iterator columnIterator)

containsColumn

public boolean containsColumn(Column column)
Parameters:
column -
Returns:
true if this constraint already contains a column with same name.

getColumnSpan

public int getColumnSpan()

getColumn

public Column getColumn(int i)

columnIterator

public Iterator columnIterator()

getTable

public Table getTable()

setTable

public void setTable(Table table)

isGenerated

public boolean isGenerated(Dialect dialect)

sqlDropString

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

sqlCreateString

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

getColumns

public List getColumns()

sqlConstraintString

public abstract String sqlConstraintString(Dialect d,
                                           String constraintName,
                                           String defaultCatalog,
                                           String defaultSchema)

toString

public String toString()
Overrides:
toString in class Object