|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.brains2b.sql.meta.ConstraintModel
public class ConstraintModel
Wrapper around the constraint definition from DatabaseMetaData
Class is read-only, use SquelerDDL:ConstraintDDL for changing columns
SQLMetaData
,
SQLRecord
Field Summary | |
---|---|
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 |
Constructor Summary | |
---|---|
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 |
Method Summary | |
---|---|
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 |
protected void |
setColumns(java.util.List columns)
set the columns for this Model |
protected void |
setRecord(SQLRecord record)
set the record for this Model |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PRIMARY_KEY
public static final java.lang.String FOREIGN_KEY
public static final java.lang.String CHECK
Constructor Detail |
---|
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 constraint
java.lang.IllegalArgumentException
- if type is not in (PRIMARY_KEY|FOREIGN_KEY|CHECK)Method Detail |
---|
public java.lang.String getName()
This is equal to the name of the table,column, etc.
getName
in interface SQLMetaModel
public SQLRecord getRecord()
getRecord
in interface SQLMetaModel
public java.lang.String getTableName()
public java.lang.String getType()
returned value depends on the model: TABLE,COLUMN,INDEX
getType
in interface SQLMetaModel
public java.util.List getColumns()
CHECK
protected 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.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |