- All Superinterfaces:
Constraint
,ConstraintEnforcementStep
,ConstraintFinalStep
,FieldOrConstraint
,Named
,QueryPart
,Serializable
Constraint
construction DSL API that allows for
adding ON DELETE
and ON UPDATE
clauses.
Referencing XYZ*Step
types directly from client code
It is usually not recommended to reference any XYZ*Step
types
directly from client code, or assign them to local variables. When writing
dynamic SQL, creating a statement's components dynamically, and passing them
to the DSL API statically is usually a better choice. See the manual's
section about dynamic SQL for details: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql.
Drawbacks of referencing the XYZ*Step
types directly:
- They're operating on mutable implementations (as of jOOQ 3.x)
- They're less composable and not easy to get right when dynamic SQL gets complex
- They're less readable
- They might have binary incompatible changes between minor releases
- Author:
- Lukas Eder
-
Method Summary
Modifier and TypeMethodDescription@NotNull ConstraintForeignKeyOnStep
Add anON DELETE CASCADE
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON DELETE NO ACTION
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON DELETE RESTRICT
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON DELETE SET DEFAULT
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON DELETE SET NULL
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON UPDATE CASCADE
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON UPDATE NO ACTION
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON UPDATE RESTRICT
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON UPDATE SET DEFAULT
clause to theFOREIGN KEY
constraint.@NotNull ConstraintForeignKeyOnStep
Add anON UPDATE SET NULL
clause to theFOREIGN KEY
constraint.Methods inherited from interface org.jooq.ConstraintEnforcementStep
enforced, notEnforced
Methods inherited from interface org.jooq.Named
getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
-
Method Details
-
onDeleteNoAction
Add anON DELETE NO ACTION
clause to theFOREIGN KEY
constraint.This is the standard action according to the SQL standard. If a given
SQLDialect
does not support setting this action explicitly, no explicit action will be specified and calling this method is equivalent to not calling any method at all. -
onDeleteRestrict
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,H2,HANA,HSQLDB,INGRES,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLITE,SYBASE}) @NotNull ConstraintForeignKeyOnStep onDeleteRestrict()Add anON DELETE RESTRICT
clause to theFOREIGN KEY
constraint. -
onDeleteCascade
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLDATAWAREHOUSE,SQLITE,SQLSERVER,SYBASE,TERADATA}) @NotNull ConstraintForeignKeyOnStep onDeleteCascade()Add anON DELETE CASCADE
clause to theFOREIGN KEY
constraint. -
onDeleteSetNull
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,FIREBIRD,H2,HANA,HSQLDB,INFORMIX,INGRES,MARIADB,MEMSQL,MYSQL,ORACLE,POSTGRES,SQLITE,SQLSERVER,SYBASE}) @NotNull ConstraintForeignKeyOnStep onDeleteSetNull()Add anON DELETE SET NULL
clause to theFOREIGN KEY
constraint. -
onDeleteSetDefault
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE}) @NotNull ConstraintForeignKeyOnStep onDeleteSetDefault()Add anON DELETE SET DEFAULT
clause to theFOREIGN KEY
constraint. -
onUpdateNoAction
Add anON UPDATE NO ACTION
clause to theFOREIGN KEY
constraint.This is the standard action according to the SQL standard. If a given
SQLDialect
does not support setting this action explicitly, no explicit action will be specified and calling this method is equivalent to not calling any method at all. -
onUpdateRestrict
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,DB2,DERBY,H2,HANA,HSQLDB,INGRES,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLITE,SYBASE}) @NotNull ConstraintForeignKeyOnStep onUpdateRestrict()Add anON UPDATE RESTRICT
clause to theFOREIGN KEY
constraint. -
onUpdateCascade
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE}) @NotNull ConstraintForeignKeyOnStep onUpdateCascade()Add anON UPDATE CASCADE
clause to theFOREIGN KEY
constraint. -
onUpdateSetNull
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE}) @NotNull ConstraintForeignKeyOnStep onUpdateSetNull()Add anON UPDATE SET NULL
clause to theFOREIGN KEY
constraint. -
onUpdateSetDefault
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE}) @NotNull ConstraintForeignKeyOnStep onUpdateSetDefault()Add anON UPDATE SET DEFAULT
clause to theFOREIGN KEY
constraint.
-