|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.command.Prepared
org.h2.command.ddl.DefineCommand
org.h2.command.ddl.SchemaCommand
org.h2.command.ddl.AlterTableAddConstraint
public class AlterTableAddConstraint
This class represents the statement ALTER TABLE ADD CONSTRAINT
Field Summary | |
---|---|
static int |
CHECK
The type of a ALTER TABLE ADD CHECK statement. |
static int |
PRIMARY_KEY
The type of a ALTER TABLE ADD PRIMARY KEY statement. |
static int |
REFERENTIAL
The type of a ALTER TABLE ADD FOREIGN KEY statement. |
static int |
UNIQUE
The type of a ALTER TABLE ADD UNIQUE statement. |
Fields inherited from class org.h2.command.Prepared |
---|
headPos, parameters, prepareAlways, session, sqlStatement |
Constructor Summary | |
---|---|
AlterTableAddConstraint(Session session,
Schema schema,
boolean ifNotExists)
|
Method Summary | |
---|---|
IndexColumn[] |
getIndexColumns()
|
int |
getType()
|
void |
setCheckExisting(boolean b)
|
void |
setCheckExpression(Expression expression)
|
void |
setComment(java.lang.String comment)
|
void |
setConstraintName(java.lang.String constraintName)
|
void |
setDeleteAction(int action)
|
void |
setIndex(Index index)
|
void |
setIndexColumns(IndexColumn[] indexColumns)
|
void |
setPrimaryKeyHash(boolean b)
|
void |
setRefIndex(Index refIndex)
|
void |
setRefIndexColumns(IndexColumn[] indexColumns)
|
void |
setRefTableName(Schema refSchema,
java.lang.String ref)
Set the referenced table. |
void |
setTableName(java.lang.String tableName)
|
void |
setType(int type)
|
void |
setUpdateAction(int action)
|
int |
tryUpdate()
Try to execute the statement. |
int |
update()
Execute the statement. |
Methods inherited from class org.h2.command.ddl.SchemaCommand |
---|
getSchema |
Methods inherited from class org.h2.command.ddl.DefineCommand |
---|
isReadOnly, isTransactional, queryMeta |
Methods inherited from class org.h2.command.Prepared |
---|
checkCanceled, checkParameters, getCurrentObjectId, getCurrentRowNumber, getObjectId, getParameters, getPlanSQL, getSQL, getSQL, getSQL, isQuery, needRecompile, prepare, query, setCommand, setCurrentRowNumber, setHeadPos, setObjectId, setParameterList, setPrepareAlways, setRow, setSession, setSQL, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CHECK
public static final int UNIQUE
public static final int REFERENTIAL
public static final int PRIMARY_KEY
Constructor Detail |
---|
public AlterTableAddConstraint(Session session, Schema schema, boolean ifNotExists)
Method Detail |
---|
public int update() throws java.sql.SQLException
Prepared
update
in class Prepared
java.sql.SQLException
- if it is a querypublic int tryUpdate() throws java.sql.SQLException
java.sql.SQLException
public void setDeleteAction(int action)
public void setUpdateAction(int action)
public void setConstraintName(java.lang.String constraintName)
public void setType(int type)
public int getType()
public void setCheckExpression(Expression expression)
public void setTableName(java.lang.String tableName)
public void setIndexColumns(IndexColumn[] indexColumns)
public IndexColumn[] getIndexColumns()
public void setRefTableName(Schema refSchema, java.lang.String ref)
refSchema
- the schemaref
- the table namepublic void setRefIndexColumns(IndexColumn[] indexColumns)
public void setIndex(Index index)
public void setRefIndex(Index refIndex)
public void setComment(java.lang.String comment)
public void setCheckExisting(boolean b)
public void setPrimaryKeyHash(boolean b)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |