From 1bb528dd5f90bf2498ae2f53d4711902a2c650f2 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Mon, 12 Mar 2018 11:29:36 +0100 Subject: [PATCH] [#7171] [#7280] Add ConstraintForeignKeyReferencesStep[N].references(Table) --- .../resources/org/jooq/web/grammar-3.11.txt | 8 +++-- .../ConstraintForeignKeyReferencesStep1.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep10.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep11.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep12.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep13.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep14.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep15.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep16.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep17.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep18.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep19.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep2.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep20.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep21.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep22.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep3.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep4.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep5.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep6.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep7.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep8.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStep9.java | 27 +++++++++++++++-- .../ConstraintForeignKeyReferencesStepN.java | 28 ++++++++++++++--- .../java/org/jooq/impl/ConstraintImpl.java | 30 +++++++++++++++---- 25 files changed, 582 insertions(+), 78 deletions(-) diff --git a/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt b/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt index 758da9eb18..54e2b4230d 100644 --- a/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt +++ b/jOOQ-manual/src/main/resources/org/jooq/web/grammar-3.11.txt @@ -255,6 +255,7 @@ column = | 'PRIMARY KEY' | 'UNIQUE' [ 'KEY' | 'INDEX' ] | 'CHECK' '(' condition ')' + | 'REFERENCES' constraintReferenceSpecification | 'AUTO_INCREMENT' | 'AUTOINCREMENT' | 'IDENTITY' [ '(' signedInteger ',' signedInteger ')' ] @@ -267,7 +268,11 @@ column = constraint = 'PRIMARY KEY' '(' fieldNames ')' | 'UNIQUE' [ 'KEY' | 'INDEX' ] '(' fieldNames ')' -| 'FOREIGN KEY' '(' fieldNames ')' 'REFERENCS' '(' fieldNames ')' +| 'FOREIGN KEY' '(' fieldNames ')' 'REFERENCES' constraintReferenceSpecification +| 'CHECK' '(' condition ')' +; + +constraintReferenceSpecification = tableName '(' fieldNames ')' { 'ON' ( 'DELETE' | 'UPDATE' ) ( @@ -278,7 +283,6 @@ constraint = | 'SET NULL' ) } -| 'CHECK' '(' condition ')' ; identity = diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep1.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep1.java index a2fc90b421..5ff97b2e14 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep1.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep1.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep1 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep10.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep10.java index c366a25a9a..a3293e1449 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep10.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep10.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep10 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep11.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep11.java index b079874a93..0078e00492 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep11.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep11.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep11 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep12.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep12.java index 2d2a1d3ff3..760ca23a49 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep12.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep12.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep12 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep13.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep13.java index 3f2268c91e..b7047adecd 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep13.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep13.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep13 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep14.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep14.java index 8ad8dcac9b..97ae09ef9d 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep14.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep14.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep14 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep15.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep15.java index 2fd4471acb..a6d5e580c5 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep15.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep15.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep15 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep16.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep16.java index 492ceaa5b0..98aaa756b3 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep16.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep16.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep16 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep17.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep17.java index b34a68286b..3076b089a0 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep17.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep17.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep17 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16, Name field17); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep18.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep18.java index 140ba706b6..5f63c7a3ff 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep18.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep18.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep18 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16, Name field17, Name field18); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep19.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep19.java index e7aec84ce2..ff763923da 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep19.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep19.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep19 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16, Name field17, Name field18, Name field19); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep2.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep2.java index 747ccd6605..317c1a92c3 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep2.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep2.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep2 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep20.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep20.java index 7ab7f59e5c..c08ca33cb3 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep20.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep20.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep20 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19, String field20); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16, Name field17, Name field18, Name field19, Name field20); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep21.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep21.java index 9d8e99aa2d..70c9a8bc4e 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep21.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep21.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep21 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19, String field20, String field21); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16, Name field17, Name field18, Name field19, Name field20, Name field21); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep22.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep22.java index 263c5a8f0c..1d7e7d246f 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep22.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep22.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep22 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9, String field10, String field11, String field12, String field13, String field14, String field15, String field16, String field17, String field18, String field19, String field20, String field21, String field22); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9, Name field10, Name field11, Name field12, Name field13, Name field14, Name field15, Name field16, Name field17, Name field18, Name field19, Name field20, Name field21, Name field22); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9, Field field10, Field field11, Field field12, Field field13, Field field14, Field field15, Field field16, Field field17, Field field18, Field field19, Field field20, Field field21, Field field22); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep3.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep3.java index 21e32a1f79..8923222c23 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep3.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep3.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep3 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep4.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep4.java index 87feca6644..6288b49a85 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep4.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep4.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep4 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep5.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep5.java index 2981c1ea5b..7b1bbe26c6 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep5.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep5.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep5 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep6.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep6.java index d9c5025a06..4305ed94a8 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep6.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep6.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep6 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep7.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep7.java index aba16ef32e..81fb4cc548 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep7.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep7.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep7 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep8.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep8.java index 87aba4de7d..2592c51d63 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep8.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep8.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep8 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep9.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep9.java index ee39401aa4..387fd2e252 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep9.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStep9.java @@ -50,19 +50,40 @@ import javax.annotation.Generated; public interface ConstraintForeignKeyReferencesStep9 { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(String table, String field1, String field2, String field3, String field4, String field5, String field6, String field7, String field8, String field9); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Name table, Name field1, Name field2, Name field3, Name field4, Name field5, Name field6, Name field7, Name field8, Name field9); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ @Support ConstraintForeignKeyOnStep references(Table table, Field field1, Field field2, Field field3, Field field4, Field field5, Field field6, Field field7, Field field8, Field field9); diff --git a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStepN.java b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStepN.java index 00fb77b370..a685a9ae80 100644 --- a/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStepN.java +++ b/jOOQ/src/main/java/org/jooq/ConstraintForeignKeyReferencesStepN.java @@ -37,7 +37,6 @@ */ package org.jooq; - /** * The step in the {@link Constraint} construction DSL API that allows for * matching a FOREIGN KEY clause with a REFERENCES @@ -48,17 +47,38 @@ package org.jooq; public interface ConstraintForeignKeyReferencesStepN { /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(String table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ ConstraintForeignKeyOnStep references(String table, String... fields); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Name table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ ConstraintForeignKeyOnStep references(Name table, Name... fields); /** - * Add a REFERENCES clause to the CONSTRAINT. + * Add a REFERENCES clause to the CONSTRAINT, + * implicitly referencing the primary key. + */ + ConstraintForeignKeyOnStep references(Table table); + + /** + * Add a REFERENCES clause to the CONSTRAINT, + * referencing a key by column names. */ ConstraintForeignKeyOnStep references(Table table, Field... fields); } diff --git a/jOOQ/src/main/java/org/jooq/impl/ConstraintImpl.java b/jOOQ/src/main/java/org/jooq/impl/ConstraintImpl.java index 9a5f7728af..ceb4dd4e5a 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ConstraintImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ConstraintImpl.java @@ -53,6 +53,7 @@ import static org.jooq.impl.Keywords.K_ON_UPDATE; import static org.jooq.impl.Keywords.K_PRIMARY_KEY; import static org.jooq.impl.Keywords.K_REFERENCES; import static org.jooq.impl.Keywords.K_UNIQUE; +import static org.jooq.impl.Tools.EMPTY_FIELD; import static org.jooq.impl.Tools.fieldsByName; import static org.jooq.impl.Tools.DataKey.DATA_CONSTRAINT_REFERENCE; @@ -203,12 +204,14 @@ implements .formatSeparator() .visit(K_REFERENCES) .sql(' ') - .visit(referencesTable) - .sql(" (") - .qualify(false) - .visit(new QueryPartList>(references)) - .qualify(qualify) - .sql(')'); + .visit(referencesTable); + + if (references.length > 0) + ctx.sql(" (") + .qualify(false) + .visit(new QueryPartList>(references)) + .qualify(qualify) + .sql(')'); if (onDelete != null) ctx.sql(' ').visit(K_ON_DELETE) @@ -286,16 +289,31 @@ implements return this; } + @Override + public final ConstraintImpl references(String table) { + return references(table(name(table)), EMPTY_FIELD); + } + @Override public final ConstraintImpl references(String table, String... fields) { return references(table(name(table)), fieldsByName(fields)); } + @Override + public final ConstraintImpl references(Name table) { + return references(table(table), EMPTY_FIELD); + } + @Override public final ConstraintImpl references(Name table, Name... fields) { return references(table(table), fieldsByName(fields)); } + @Override + public final ConstraintImpl references(Table table) { + return references(table, EMPTY_FIELD); + } + @Override public final ConstraintImpl references(Table table, Field... fields) { referencesTable = table;