|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.engine.DbObjectBase
org.h2.schema.SchemaObjectBase
org.h2.constraint.Constraint
org.h2.constraint.ConstraintCheck
public class ConstraintCheck
A check constraint.
Field Summary |
---|
Fields inherited from class org.h2.constraint.Constraint |
---|
CHECK, PRIMARY_KEY, REFERENTIAL, table, UNIQUE |
Fields inherited from class org.h2.engine.DbObjectBase |
---|
comment, database, trace |
Fields inherited from interface org.h2.engine.DbObject |
---|
AGGREGATE, COMMENT, CONSTANT, CONSTRAINT, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, TABLE_OR_VIEW, TRIGGER, USER, USER_DATATYPE |
Constructor Summary | |
---|---|
ConstraintCheck(Schema schema,
int id,
java.lang.String name,
Table table)
|
Method Summary | |
---|---|
void |
checkExistingData(Session session)
Check the existing data. |
void |
checkRow(Session session,
Table t,
Row oldRow,
Row newRow)
Check if this row fulfils the constraint. |
boolean |
containsColumn(Column col)
Check if this constraint contains the given column. |
java.lang.String |
getConstraintType()
The constraint type name |
java.lang.String |
getCreateSQL()
Build a SQL statement to re-create this object. |
java.lang.String |
getCreateSQLForCopy(Table forTable,
java.lang.String quotedName)
Build a SQL statement to re-create the object, or to create a copy of the object with a different name or referencing a different table |
java.lang.String |
getCreateSQLWithoutIndexes()
Get the SQL statement to create this constraint. |
Expression |
getExpression()
|
java.lang.String |
getShortDescription()
|
Index |
getUniqueIndex()
Get the unique index used to enforce this constraint, or null if no index is used. |
boolean |
isBefore()
Check if this constraint needs to be checked before updating the data. |
void |
rebuild()
This method is called after a related table has changed (the table was renamed, or columns have been renamed). |
void |
removeChildrenAndResources(Session session)
Remove all dependent objects and free all resources (files, blocks in files) of this object. |
void |
setExpression(Expression expr)
|
void |
setIndexOwner(Index index)
This index is now the owner of the specified index. |
void |
setTableFilter(TableFilter filter)
|
boolean |
usesIndex(Index index)
Check if this constraint needs the specified index. |
Methods inherited from class org.h2.constraint.Constraint |
---|
checkRename, compareTo, getDropSQL, getRefTable, getTable, getType |
Methods inherited from class org.h2.schema.SchemaObjectBase |
---|
getSchema, getSQL, initSchemaObjectBase |
Methods inherited from class org.h2.engine.DbObjectBase |
---|
getChildren, getComment, getDatabase, getHeadPos, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporary, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.h2.engine.DbObject |
---|
getChildren, getComment, getDatabase, getHeadPos, getId, getModificationId, getName, isTemporary, rename, setComment, setModified, setTemporary |
Constructor Detail |
---|
public ConstraintCheck(Schema schema, int id, java.lang.String name, Table table)
Method Detail |
---|
public java.lang.String getConstraintType()
Constraint
getConstraintType
in class Constraint
public void setTableFilter(TableFilter filter)
public void setExpression(Expression expr)
public java.lang.String getCreateSQLForCopy(Table forTable, java.lang.String quotedName)
DbObjectBase
getCreateSQLForCopy
in interface DbObject
getCreateSQLForCopy
in class DbObjectBase
forTable
- the new table namequotedName
- the new quoted name
public java.lang.String getShortDescription()
public java.lang.String getCreateSQLWithoutIndexes()
Constraint
getCreateSQLWithoutIndexes
in class Constraint
public java.lang.String getCreateSQL()
DbObjectBase
getCreateSQL
in interface DbObject
getCreateSQL
in class DbObjectBase
public void removeChildrenAndResources(Session session) throws java.sql.SQLException
DbObjectBase
removeChildrenAndResources
in interface DbObject
removeChildrenAndResources
in class DbObjectBase
session
- the session
java.sql.SQLException
public void checkRow(Session session, Table t, Row oldRow, Row newRow) throws java.sql.SQLException
Constraint
checkRow
in class Constraint
session
- the sessiont
- the tableoldRow
- the old rownewRow
- the new row
java.sql.SQLException
public boolean usesIndex(Index index)
Constraint
usesIndex
in class Constraint
index
- the index
public void setIndexOwner(Index index)
Constraint
setIndexOwner
in class Constraint
index
- the indexpublic boolean containsColumn(Column col)
Constraint
containsColumn
in class Constraint
col
- the column
public Expression getExpression()
public boolean isBefore()
Constraint
isBefore
in class Constraint
public void checkExistingData(Session session) throws java.sql.SQLException
Constraint
checkExistingData
in class Constraint
session
- the session
java.sql.SQLException
public Index getUniqueIndex()
Constraint
getUniqueIndex
in class Constraint
public void rebuild()
Constraint
rebuild
in class Constraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |