public abstract class Constraint extends Object implements RelationalModel, Serializable
Constructor and Description |
---|
Constraint() |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(Column column) |
void |
addColumns(Iterator columnIterator) |
Iterator |
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 |
getColumnIterator() |
List |
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() |
public String getName()
public void setName(String name)
public static String generateName(String prefix, Table table, Column... columns)
prefix
- Appended to the beginning of the generated nametable
- columns
- public static String generateName(String prefix, Table table, List<Column> columns)
generateName(String, Table, Column...)
.prefix
- Appended to the beginning of the generated nametable
- columns
- public static String hashedName(String s)
s
- The name to be hashed.public Iterator getColumnIterator()
public void addColumn(Column column)
public void addColumns(Iterator columnIterator)
public boolean containsColumn(Column column)
column
- public int getColumnSpan()
public Column getColumn(int i)
public Iterator columnIterator()
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 List getColumns()
public abstract String sqlConstraintString(Dialect d, String constraintName, String defaultCatalog, String defaultSchema)
public abstract String generatedConstraintNamePrefix()
Copyright © 2018 JBoss by Red Hat. All rights reserved.