public class ConstraintModel extends java.lang.Object implements SQLMetaModel
Class is read-only, use SquelerDDL:ConstraintDDL for changing columns
SQLMetaData,
SQLRecord,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CHECK
constant for a check constraint
|
static java.lang.String |
FOREIGN_KEY
constant for a foreign key constraint
|
static java.lang.String |
PRIMARY_KEY
constant for a primary key constraint
|
| Modifier | Constructor and Description |
|---|---|
protected |
ConstraintModel()
Constructor
only used by ConstraintDDL
|
|
ConstraintModel(java.lang.String type,
SQLRecord record)
Create a ConstriantModel of this specific type
on the basis of the provided SQLRecord
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addColumn(ColumnModel model)
add a ColumnModel as a part of this ConstraintModel
|
boolean |
equals(java.lang.Object obj) |
java.util.List |
getColumns()
get the Columns referenced by this constraint
|
java.lang.String |
getName()
get the name for this model's instance
|
SQLRecord |
getRecord()
the record which defines all the values for the model
|
java.lang.String |
getTableName()
get the table name for this Constraint
|
java.lang.String |
getType()
get the type of Object defined by the meta model
|
int |
hashCode() |
protected void |
setColumns(java.util.List columns)
set the columns for this Model
|
protected void |
setRecord(SQLRecord record)
set the record for this Model
|
public static final java.lang.String PRIMARY_KEY
public static final java.lang.String FOREIGN_KEY
public static final java.lang.String CHECK
protected ConstraintModel()
public ConstraintModel(java.lang.String type,
SQLRecord record)
type - String, one of the constants (PRIMARY_KEY|FOREIGN_KEY|CHECK)record - SQLRecord, the record describing this constraintjava.lang.IllegalArgumentException - if type is not in (PRIMARY_KEY|FOREIGN_KEY|CHECK)public java.lang.String getName()
This is equal to the name of the table,column, etc.
getName in interface SQLMetaModelpublic SQLRecord getRecord()
getRecord in interface SQLMetaModelpublic java.lang.String getTableName()
public java.lang.String getType()
returned value depends on the model: TABLE,COLUMN,INDEX
getType in interface SQLMetaModelpublic java.util.List getColumns()
CHECKprotected void setRecord(SQLRecord record)
record - SQLRecordprotected void setColumns(java.util.List columns)
columns - Listprotected void addColumn(ColumnModel model)
model - ColumnModelpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object