- All Superinterfaces:
Constraint,ConstraintEnforcementStep,ConstraintFinalStep,FieldOrConstraint,Named,QueryPart,Serializable,TableElement
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 ConstraintForeignKeyOnStepAdd anON DELETE CASCADEclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON DELETE NO ACTIONclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON DELETE RESTRICTclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON DELETE SET DEFAULTclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON DELETE SET NULLclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON UPDATE CASCADEclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON UPDATE NO ACTIONclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON UPDATE RESTRICTclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON UPDATE SET DEFAULTclause to theFOREIGN KEYconstraint.@NotNull ConstraintForeignKeyOnStepAdd anON UPDATE SET NULLclause to theFOREIGN KEYconstraint.Methods inherited from interface org.jooq.ConstraintEnforcementStep
enforced, notEnforcedMethods inherited from interface org.jooq.Named
$name, getComment, getCommentPart, getName, getQualifiedName, getUnqualifiedName
-
Method Details
-
onDeleteNoAction
Add anON DELETE NO ACTIONclause to theFOREIGN KEYconstraint.This is the standard action according to the SQL standard. If a given
SQLDialectdoes 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,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onDeleteRestrict()Add anON DELETE RESTRICTclause to theFOREIGN KEYconstraint. -
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,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onDeleteCascade()Add anON DELETE CASCADEclause to theFOREIGN KEYconstraint. -
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,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onDeleteSetNull()Add anON DELETE SET NULLclause to theFOREIGN KEYconstraint. -
onDeleteSetDefault
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onDeleteSetDefault()Add anON DELETE SET DEFAULTclause to theFOREIGN KEYconstraint. -
onUpdateNoAction
Add anON UPDATE NO ACTIONclause to theFOREIGN KEYconstraint.This is the standard action according to the SQL standard. If a given
SQLDialectdoes 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,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onUpdateRestrict()Add anON UPDATE RESTRICTclause to theFOREIGN KEYconstraint. -
onUpdateCascade
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onUpdateCascade()Add anON UPDATE CASCADEclause to theFOREIGN KEYconstraint. -
onUpdateSetNull
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MARIADB,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onUpdateSetNull()Add anON UPDATE SET NULLclause to theFOREIGN KEYconstraint. -
onUpdateSetDefault
@NotNull @Support({ACCESS,ASE,AURORA_MYSQL,AURORA_POSTGRES,COCKROACHDB,CUBRID,FIREBIRD,H2,HANA,HSQLDB,INGRES,MEMSQL,MYSQL,POSTGRES,SQLITE,SQLSERVER,SYBASE,YUGABYTEDB}) @NotNull ConstraintForeignKeyOnStep onUpdateSetDefault()Add anON UPDATE SET DEFAULTclause to theFOREIGN KEYconstraint.
-