org.hibernate.metamodel.relational
Class AbstractConstraint

java.lang.Object
  extended by org.hibernate.metamodel.relational.AbstractConstraint
All Implemented Interfaces:
Constraint, Exportable
Direct Known Subclasses:
ForeignKey, Index, PrimaryKey, UniqueKey

public abstract class AbstractConstraint
extends Object
implements Constraint

Support for writing Constraint implementations


Constructor Summary
protected AbstractConstraint(TableSpecification table, String name)
           
 
Method Summary
 void addColumn(Column column)
           
 Iterable<Column> getColumns()
          Obtain the columns that are part of this constraint.
protected  int getColumnSpan()
           
 String getName()
          Obtain the constraint name.
 TableSpecification getTable()
          Obtain the table to which this constraint applies.
protected  void internalAddColumn(Column column)
           
protected  List<Column> internalColumnAccess()
           
protected  boolean isCreationVetoed(Dialect dialect)
           
protected abstract  String sqlConstraintStringInAlterTable(Dialect dialect)
           
 String[] sqlCreateStrings(Dialect dialect)
          Gets the SQL strings for creating the database object.
 String[] sqlDropStrings(Dialect dialect)
          Gets the SQL strings for dropping the database object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.metamodel.relational.Exportable
getExportIdentifier
 

Constructor Detail

AbstractConstraint

protected AbstractConstraint(TableSpecification table,
                             String name)
Method Detail

getTable

public TableSpecification getTable()
Description copied from interface: Constraint
Obtain the table to which this constraint applies.

Specified by:
getTable in interface Constraint
Returns:
The constrained table.

getName

public String getName()
Description copied from interface: Constraint
Obtain the constraint name.

Specified by:
getName in interface Constraint
Returns:
the name.

getColumns

public Iterable<Column> getColumns()
Description copied from interface: Constraint
Obtain the columns that are part of this constraint.

Specified by:
getColumns in interface Constraint
Returns:
The constrained columns.

getColumnSpan

protected int getColumnSpan()

internalColumnAccess

protected List<Column> internalColumnAccess()

addColumn

public void addColumn(Column column)

internalAddColumn

protected void internalAddColumn(Column column)

isCreationVetoed

protected boolean isCreationVetoed(Dialect dialect)

sqlConstraintStringInAlterTable

protected abstract String sqlConstraintStringInAlterTable(Dialect dialect)

sqlDropStrings

public String[] sqlDropStrings(Dialect dialect)
Description copied from interface: Exportable
Gets the SQL strings for dropping the database object.

Specified by:
sqlDropStrings in interface Exportable
Parameters:
dialect - The dialect for which to generate the SQL drop strings
Returns:
the SQL strings for dropping the database object.

sqlCreateStrings

public String[] sqlCreateStrings(Dialect dialect)
Description copied from interface: Exportable
Gets the SQL strings for creating the database object.

Specified by:
sqlCreateStrings in interface Exportable
Parameters:
dialect - The dialect for which to generate the SQL creation strings
Returns:
the SQL strings for creating the database object.


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