From 86121ae90612b76e73739e0a69acc7019183d15b Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 1 Sep 2012 17:37:32 +0200 Subject: [PATCH] [#1058] Add Factory.tuple(T1, T2, .. TN) and Factory.tuple(Field, Field ... Field) to allow for creating tuples - Pull up in(Select) and notIn(Select) methods --- jOOQ/src/main/java/org/jooq/Tuple.java | 68 +++++++++++++++++++++++++ jOOQ/src/main/java/org/jooq/Tuple1.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple2.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple3.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple4.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple5.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple6.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple7.java | 27 ---------- jOOQ/src/main/java/org/jooq/Tuple8.java | 27 ---------- jOOQ/src/main/java/org/jooq/TupleN.java | 27 ---------- 10 files changed, 68 insertions(+), 243 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/Tuple.java b/jOOQ/src/main/java/org/jooq/Tuple.java index c137c030ff..0037e2bf45 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple.java +++ b/jOOQ/src/main/java/org/jooq/Tuple.java @@ -35,6 +35,13 @@ */ package org.jooq; +import static org.jooq.SQLDialect.CUBRID; +import static org.jooq.SQLDialect.DB2; +import static org.jooq.SQLDialect.HSQLDB; +import static org.jooq.SQLDialect.MYSQL; +import static org.jooq.SQLDialect.ORACLE; +import static org.jooq.SQLDialect.POSTGRES; + /** * A model type for a tuple. *

@@ -54,4 +61,65 @@ public interface Tuple extends QueryPart { * Get a field at a given index */ Field getField(int index); + +// /** +// * Compare this tuple with a subselect for equality +// *

+// * Note that the subquery must return a table of the same degree as this +// * tuple. This is not checked by jOOQ and will result in syntax errors in +// * the database, if not used correctly. +// */ +// @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) +// Condition equal(Select select); +// +// /** +// * Compare this tuple with a subselect for equality +// *

+// * Note that the subquery must return a table of the same degree as this +// * tuple. This is not checked by jOOQ and will result in syntax errors in +// * the database, if not used correctly. +// */ +// @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) +// Condition eq(Select select); +// +// /** +// * Compare this tuple with a subselect for equality +// *

+// * Note that the subquery must return a table of the same degree as this +// * tuple. This is not checked by jOOQ and will result in syntax errors in +// * the database, if not used correctly. +// */ +// @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) +// Condition notEqual(Select select); +// +// /** +// * Compare this tuple with a subselect for equality +// *

+// * Note that the subquery must return a table of the same degree as this +// * tuple. This is not checked by jOOQ and will result in syntax errors in +// * the database, if not used correctly. +// */ +// @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) +// Condition ne(Select select); + + /** + * Compare this tuple with a subselect for equality + *

+ * Note that the subquery must return a table of the same degree as this + * tuple. This is not checked by jOOQ and will result in syntax errors in + * the database, if not used correctly. + */ + @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) + Condition in(Select select); + + /** + * Compare this tuple with a subselect for non-equality + *

+ * Note that the subquery must return a table of the same degree as this + * tuple. This is not checked by jOOQ and will result in syntax errors in + * the database, if not used correctly. + */ + @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) + Condition notIn(Select select); + } diff --git a/jOOQ/src/main/java/org/jooq/Tuple1.java b/jOOQ/src/main/java/org/jooq/Tuple1.java index 0f1819cfd3..6d23a59571 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple1.java +++ b/jOOQ/src/main/java/org/jooq/Tuple1.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -223,16 +216,6 @@ public interface Tuple1 extends Tuple { @Support Condition in(Tuple1... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -256,14 +239,4 @@ public interface Tuple1 extends Tuple { */ @Support Condition notIn(Tuple1... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/Tuple2.java b/jOOQ/src/main/java/org/jooq/Tuple2.java index 3c7a3ab0d2..d4f22ad268 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple2.java +++ b/jOOQ/src/main/java/org/jooq/Tuple2.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -228,16 +221,6 @@ public interface Tuple2 extends Tuple { @Support Condition in(Tuple2... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -262,16 +245,6 @@ public interface Tuple2 extends Tuple { @Support Condition notIn(Tuple2... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); - /** * Check if this tuple overlaps another tuple *

diff --git a/jOOQ/src/main/java/org/jooq/Tuple3.java b/jOOQ/src/main/java/org/jooq/Tuple3.java index cdc498a7c0..d7091d46fd 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple3.java +++ b/jOOQ/src/main/java/org/jooq/Tuple3.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -233,16 +226,6 @@ public interface Tuple3 extends Tuple { @Support Condition in(Tuple3... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -266,14 +249,4 @@ public interface Tuple3 extends Tuple { */ @Support Condition notIn(Tuple3... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/Tuple4.java b/jOOQ/src/main/java/org/jooq/Tuple4.java index 3597516443..71588fa5c4 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple4.java +++ b/jOOQ/src/main/java/org/jooq/Tuple4.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -238,16 +231,6 @@ public interface Tuple4 extends Tuple { @Support Condition in(Tuple4... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -271,14 +254,4 @@ public interface Tuple4 extends Tuple { */ @Support Condition notIn(Tuple4... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/Tuple5.java b/jOOQ/src/main/java/org/jooq/Tuple5.java index b62d679620..5cd8c555c8 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple5.java +++ b/jOOQ/src/main/java/org/jooq/Tuple5.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -243,16 +236,6 @@ public interface Tuple5 extends Tuple { @Support Condition in(Tuple5... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -276,14 +259,4 @@ public interface Tuple5 extends Tuple { */ @Support Condition notIn(Tuple5... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/Tuple6.java b/jOOQ/src/main/java/org/jooq/Tuple6.java index 8f7c01413d..91b1817e6c 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple6.java +++ b/jOOQ/src/main/java/org/jooq/Tuple6.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -248,16 +241,6 @@ public interface Tuple6 extends Tuple { @Support Condition in(Tuple6... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -281,14 +264,4 @@ public interface Tuple6 extends Tuple { */ @Support Condition notIn(Tuple6... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/Tuple7.java b/jOOQ/src/main/java/org/jooq/Tuple7.java index b55fb2603e..83807b3dce 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple7.java +++ b/jOOQ/src/main/java/org/jooq/Tuple7.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -253,16 +246,6 @@ public interface Tuple7 extends Tuple { @Support Condition in(Tuple7... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -286,14 +269,4 @@ public interface Tuple7 extends Tuple { */ @Support Condition notIn(Tuple7... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/Tuple8.java b/jOOQ/src/main/java/org/jooq/Tuple8.java index 7c90a68865..7a1d2ca211 100644 --- a/jOOQ/src/main/java/org/jooq/Tuple8.java +++ b/jOOQ/src/main/java/org/jooq/Tuple8.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -258,16 +251,6 @@ public interface Tuple8 extends Tuple { @Support Condition in(Tuple8... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -291,14 +274,4 @@ public interface Tuple8 extends Tuple { */ @Support Condition notIn(Tuple8... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); } diff --git a/jOOQ/src/main/java/org/jooq/TupleN.java b/jOOQ/src/main/java/org/jooq/TupleN.java index 693fefc1a9..ad1cbde5f9 100644 --- a/jOOQ/src/main/java/org/jooq/TupleN.java +++ b/jOOQ/src/main/java/org/jooq/TupleN.java @@ -35,13 +35,6 @@ */ package org.jooq; -import static org.jooq.SQLDialect.CUBRID; -import static org.jooq.SQLDialect.DB2; -import static org.jooq.SQLDialect.HSQLDB; -import static org.jooq.SQLDialect.MYSQL; -import static org.jooq.SQLDialect.ORACLE; -import static org.jooq.SQLDialect.POSTGRES; - import java.util.Collection; /** @@ -210,16 +203,6 @@ public interface TupleN extends Tuple { @Support Condition in(TupleN... tuples); - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition in(Select select); - /** * Compare this tuple with a set of tuples for equality *

@@ -243,14 +226,4 @@ public interface TupleN extends Tuple { */ @Support Condition notIn(TupleN... tuples); - - /** - * Compare this tuple with a subselect for equality - *

- * Note that the subquery must return a table of the same degree as this - * tuple. This is not checked by jOOQ and will result in syntax errors in - * the database, if not used correctly. - */ - @Support({ CUBRID, DB2, HSQLDB, MYSQL, ORACLE, POSTGRES }) - Condition notIn(Select select); }