public abstract class Constraint extends Object implements RelationalModel, Exportable, Serializable
Constructor and Description |
---|
Constraint() |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(Column column) |
void |
addColumns(Iterator columnIterator) |
Iterator<Column> |
columnIterator() |
boolean |
containsColumn(Column column) |
abstract String |
generatedConstraintNamePrefix() |
static String |
generateName(String prefix,
Table table,
Column... columns)
If a constraint is not explicitly named, this is called to generate
a unique hash using the table and column names.
|
static String |
generateName(String prefix,
Table table,
List<Column> columns)
Helper method for
generateName(String, Table, Column...) . |
Column |
getColumn(int i) |
Iterator<Column> |
getColumnIterator() |
List<Column> |
getColumns() |
int |
getColumnSpan() |
String |
getName() |
Table |
getTable() |
static String |
hashedName(String s)
Hash a constraint name using MD5.
|
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() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExportIdentifier
public String getName()
public void setName(String name)
public static String generateName(String prefix, Table table, Column... columns)
public static String generateName(String prefix, Table table, List<Column> columns)
generateName(String, Table, Column...)
.public static String hashedName(String s)
s
- The name to be hashed.public void addColumn(Column column)
public void addColumns(Iterator columnIterator)
public boolean containsColumn(Column column)
public int getColumnSpan()
public Column getColumn(int i)
public Table getTable()
public void setTable(Table table)
public boolean isGenerated(Dialect dialect)
public String sqlDropString(Dialect dialect, String defaultCatalog, String defaultSchema)
sqlDropString
in interface RelationalModel
public String sqlCreateString(Dialect dialect, Mapping p, String defaultCatalog, String defaultSchema)
sqlCreateString
in interface RelationalModel
public abstract String sqlConstraintString(Dialect d, String constraintName, String defaultCatalog, String defaultSchema)
public abstract String generatedConstraintNamePrefix()
Copyright © 2016 JBoss by Red Hat. All rights reserved.