From 266d87f2061747021592df5abe1fd9da3cdd15e7 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Thu, 1 Feb 2018 15:04:23 +0100 Subject: [PATCH] [#1677] [#2769] [#6485] Added asterisk support - [#2769] Add DSL.asterisk() to allow for explicitly issuing SELECT * statements - [#1677] Add SelectFieldOrAsterisk type to support Table.asterisk() (t.*) and DSL.asterisk() - [#6485] Parser support --- jOOQ/src/main/java/org/jooq/Asterisk.java | 49 +++ jOOQ/src/main/java/org/jooq/DSLContext.java | 232 +++++++------- jOOQ/src/main/java/org/jooq/DeleteQuery.java | 4 +- .../java/org/jooq/DeleteReturningStep.java | 4 +- jOOQ/src/main/java/org/jooq/InsertQuery.java | 4 +- .../java/org/jooq/InsertReturningStep.java | 4 +- .../main/java/org/jooq/QualifiedAsterisk.java | 53 ++++ .../java/org/jooq/SelectDistinctOnStep.java | 8 +- jOOQ/src/main/java/org/jooq/SelectField.java | 4 +- .../java/org/jooq/SelectFieldOrAsterisk.java | 49 +++ jOOQ/src/main/java/org/jooq/SelectQuery.java | 8 +- .../main/java/org/jooq/SelectSelectStep.java | 4 +- jOOQ/src/main/java/org/jooq/StoreQuery.java | 4 +- jOOQ/src/main/java/org/jooq/Table.java | 12 + jOOQ/src/main/java/org/jooq/UpdateQuery.java | 4 +- .../java/org/jooq/UpdateReturningStep.java | 4 +- jOOQ/src/main/java/org/jooq/WithStep.java | 272 ++++++++--------- .../java/org/jooq/impl/AbstractDMLQuery.java | 62 ++-- .../java/org/jooq/impl/AbstractTable.java | 6 + jOOQ/src/main/java/org/jooq/impl/Alias.java | 2 +- .../main/java/org/jooq/impl/AsteriskImpl.java | 60 ++++ jOOQ/src/main/java/org/jooq/impl/DSL.java | 282 +++++++++--------- .../java/org/jooq/impl/DefaultDSLContext.java | 9 +- .../main/java/org/jooq/impl/DeleteImpl.java | 5 +- .../src/main/java/org/jooq/impl/Function.java | 2 +- .../main/java/org/jooq/impl/InsertImpl.java | 21 +- .../main/java/org/jooq/impl/ParserImpl.java | 69 ++++- jOOQ/src/main/java/org/jooq/impl/Pivot.java | 12 +- .../org/jooq/impl/QualifiedAsteriskImpl.java | 71 +++++ .../java/org/jooq/impl/QueryPartList.java | 29 +- .../src/main/java/org/jooq/impl/RowField.java | 2 +- .../java/org/jooq/impl/SelectFieldList.java | 27 +- .../main/java/org/jooq/impl/SelectImpl.java | 14 +- .../java/org/jooq/impl/SelectQueryImpl.java | 156 +++++----- jOOQ/src/main/java/org/jooq/impl/Tools.java | 41 +-- .../main/java/org/jooq/impl/UpdateImpl.java | 5 +- .../src/main/java/org/jooq/impl/WithImpl.java | 9 +- 37 files changed, 986 insertions(+), 617 deletions(-) create mode 100644 jOOQ/src/main/java/org/jooq/Asterisk.java create mode 100644 jOOQ/src/main/java/org/jooq/QualifiedAsterisk.java create mode 100644 jOOQ/src/main/java/org/jooq/SelectFieldOrAsterisk.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/AsteriskImpl.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/QualifiedAsteriskImpl.java diff --git a/jOOQ/src/main/java/org/jooq/Asterisk.java b/jOOQ/src/main/java/org/jooq/Asterisk.java new file mode 100644 index 0000000000..a4d30f1b61 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/Asterisk.java @@ -0,0 +1,49 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq; + + +/** + * A QueryPart to be used exclusively in SELECT + * clauses. + * + * @author Lukas Eder + */ +public interface Asterisk extends SelectFieldOrAsterisk { + +} diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java index 743c4eb8ef..21b77c4d59 100644 --- a/jOOQ/src/main/java/org/jooq/DSLContext.java +++ b/jOOQ/src/main/java/org/jooq/DSLContext.java @@ -5609,7 +5609,7 @@ public interface DSLContext extends Scope , AutoCloseable { * @see DSL#select(Collection) */ @Support - SelectSelectStep select(Collection> fields); + SelectSelectStep select(Collection fields); /** * Create a new DSL select statement. @@ -5643,7 +5643,7 @@ public interface DSLContext extends Scope , AutoCloseable { * @see DSL#select(SelectField...) */ @Support - SelectSelectStep select(SelectField... fields); + SelectSelectStep select(SelectFieldOrAsterisk... fields); // [jooq-tools] START [select] @@ -5670,8 +5670,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5700,8 +5700,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5730,8 +5730,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5760,8 +5760,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5790,8 +5790,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5820,8 +5820,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5850,8 +5850,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5880,8 +5880,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5910,8 +5910,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5940,8 +5940,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -5970,8 +5970,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6000,8 +6000,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6030,8 +6030,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6060,8 +6060,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6090,8 +6090,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6120,8 +6120,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6150,8 +6150,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6180,8 +6180,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6210,8 +6210,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6240,8 +6240,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6270,8 +6270,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6300,8 +6300,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6340,7 +6340,7 @@ public interface DSLContext extends Scope , AutoCloseable { * @see DSL#selectDistinct(Collection) */ @Support - SelectSelectStep selectDistinct(Collection> fields); + SelectSelectStep selectDistinct(Collection fields); /** * Create a new DSL select statement. @@ -6349,7 +6349,7 @@ public interface DSLContext extends Scope , AutoCloseable { * statement from this {@link DSLContext}. If you don't need to render or * execute this SELECT statement (e.g. because you want to * create a subselect), consider using the static - * {@link DSL#selectDistinct(SelectField...)} instead. + * {@link DSL#selectDistinct(SelectFieldOrAsterisk...)} instead. *

* Example:

      * DSLContext create = DSL.using(configuration);
@@ -6370,17 +6370,17 @@ public interface DSLContext extends Scope , AutoCloseable  {
      * using plain SQL
      * 
      *
-     * @see DSL#selectDistinct(SelectField...)
+     * @see DSL#selectDistinct(SelectFieldOrAsterisk...)
      */
     @Support
-    SelectSelectStep selectDistinct(SelectField... fields);
+    SelectSelectStep selectDistinct(SelectFieldOrAsterisk... fields);
 
     // [jooq-tools] START [selectDistinct]
 
     /**
      * Create a new DSL select statement.
      * 

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6400,8 +6400,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); *

* - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6410,7 +6410,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6430,8 +6430,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6440,7 +6440,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6460,8 +6460,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6470,7 +6470,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6490,8 +6490,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6500,7 +6500,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6520,8 +6520,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6530,7 +6530,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6550,8 +6550,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6560,7 +6560,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6580,8 +6580,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6590,7 +6590,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6610,8 +6610,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6620,7 +6620,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6640,8 +6640,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6650,7 +6650,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6670,8 +6670,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6680,7 +6680,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6700,8 +6700,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6710,7 +6710,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6730,8 +6730,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6740,7 +6740,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6760,8 +6760,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6770,7 +6770,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6790,8 +6790,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6800,7 +6800,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6820,8 +6820,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6830,7 +6830,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6850,8 +6850,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6860,7 +6860,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6880,8 +6880,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6890,7 +6890,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6910,8 +6910,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6920,7 +6920,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6940,8 +6940,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6950,7 +6950,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -6970,8 +6970,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -6980,7 +6980,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -7000,8 +7000,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -7010,7 +7010,7 @@ public interface DSLContext extends Scope , AutoCloseable { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -7030,8 +7030,8 @@ public interface DSLContext extends Scope , AutoCloseable { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support diff --git a/jOOQ/src/main/java/org/jooq/DeleteQuery.java b/jOOQ/src/main/java/org/jooq/DeleteQuery.java index 4b44808d08..52e747cde9 100644 --- a/jOOQ/src/main/java/org/jooq/DeleteQuery.java +++ b/jOOQ/src/main/java/org/jooq/DeleteQuery.java @@ -121,7 +121,7 @@ public interface DeleteQuery extends ConditionProvider, Delete * @see #getReturnedRecords() */ @Support({ FIREBIRD, POSTGRES }) - void setReturning(Field... fields); + void setReturning(SelectFieldOrAsterisk... fields); /** * Configure the DELETE statement to return a list of fields in @@ -131,7 +131,7 @@ public interface DeleteQuery extends ConditionProvider, Delete * @see #getReturnedRecords() */ @Support({ FIREBIRD, POSTGRES }) - void setReturning(Collection> fields); + void setReturning(Collection fields); /** * The record holding returned values as specified by any of the diff --git a/jOOQ/src/main/java/org/jooq/DeleteReturningStep.java b/jOOQ/src/main/java/org/jooq/DeleteReturningStep.java index 495486364f..59fa32c14b 100644 --- a/jOOQ/src/main/java/org/jooq/DeleteReturningStep.java +++ b/jOOQ/src/main/java/org/jooq/DeleteReturningStep.java @@ -84,7 +84,7 @@ public interface DeleteReturningStep extends DeleteFinalStep returning(Field... fields); + DeleteResultStep returning(SelectFieldOrAsterisk... fields); /** * Configure the DELETE statement to return a list of fields in @@ -94,5 +94,5 @@ public interface DeleteReturningStep extends DeleteFinalStep returning(Collection> fields); + DeleteResultStep returning(Collection fields); } diff --git a/jOOQ/src/main/java/org/jooq/InsertQuery.java b/jOOQ/src/main/java/org/jooq/InsertQuery.java index f9da2b20f4..3c9fe2fe32 100644 --- a/jOOQ/src/main/java/org/jooq/InsertQuery.java +++ b/jOOQ/src/main/java/org/jooq/InsertQuery.java @@ -353,7 +353,7 @@ public interface InsertQuery extends StoreQuery, Insert */ @Override @Support - void setReturning(Field... fields); + void setReturning(SelectFieldOrAsterisk... fields); /** * {@inheritDoc} @@ -362,7 +362,7 @@ public interface InsertQuery extends StoreQuery, Insert */ @Override @Support - void setReturning(Collection> fields); + void setReturning(Collection fields); /** * {@inheritDoc} diff --git a/jOOQ/src/main/java/org/jooq/InsertReturningStep.java b/jOOQ/src/main/java/org/jooq/InsertReturningStep.java index 681ec59258..3f859c603e 100644 --- a/jOOQ/src/main/java/org/jooq/InsertReturningStep.java +++ b/jOOQ/src/main/java/org/jooq/InsertReturningStep.java @@ -92,7 +92,7 @@ public interface InsertReturningStep extends InsertFinalStep returning(Field... fields); + InsertResultStep returning(SelectFieldOrAsterisk... fields); /** * Configure the INSERT statement to return a list of fields in @@ -102,5 +102,5 @@ public interface InsertReturningStep extends InsertFinalStep returning(Collection> fields); + InsertResultStep returning(Collection fields); } diff --git a/jOOQ/src/main/java/org/jooq/QualifiedAsterisk.java b/jOOQ/src/main/java/org/jooq/QualifiedAsterisk.java new file mode 100644 index 0000000000..2695929419 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/QualifiedAsterisk.java @@ -0,0 +1,53 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq; + + +/** + * A QueryPart to be used exclusively in SELECT + * clauses. + * + * @author Lukas Eder + */ +public interface QualifiedAsterisk extends SelectFieldOrAsterisk { + + /** + * The qualifier. + */ + Table qualifier(); +} diff --git a/jOOQ/src/main/java/org/jooq/SelectDistinctOnStep.java b/jOOQ/src/main/java/org/jooq/SelectDistinctOnStep.java index 464cd2a623..b56c6951a2 100644 --- a/jOOQ/src/main/java/org/jooq/SelectDistinctOnStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectDistinctOnStep.java @@ -93,7 +93,7 @@ public interface SelectDistinctOnStep extends SelectIntoStep on(SelectField... fields); + SelectIntoStep on(SelectFieldOrAsterisk... fields); /** * Add the PostgreSQL-specific ON(...) clause to a @@ -103,19 +103,19 @@ public interface SelectDistinctOnStep extends SelectIntoStep on(Collection> fields); + SelectIntoStep on(Collection fields); /** * Add the PostgreSQL-specific ON(...) clause to a * SELECT DISTINCT ON (...) statement. */ @Support({ POSTGRES }) - SelectIntoStep distinctOn(SelectField... fields); + SelectIntoStep distinctOn(SelectFieldOrAsterisk... fields); /** * Add the PostgreSQL-specific ON(...) clause to a * SELECT DISTINCT ON (...) statement. */ @Support({ POSTGRES }) - SelectIntoStep distinctOn(Collection> fields); + SelectIntoStep distinctOn(Collection fields); } diff --git a/jOOQ/src/main/java/org/jooq/SelectField.java b/jOOQ/src/main/java/org/jooq/SelectField.java index e07ca68116..ffb5d1465a 100644 --- a/jOOQ/src/main/java/org/jooq/SelectField.java +++ b/jOOQ/src/main/java/org/jooq/SelectField.java @@ -40,11 +40,11 @@ package org.jooq; /** * A QueryPart to be used exclusively in SELECT - * clauses + * clauses. * * @author Lukas Eder */ -public interface SelectField extends QueryPart { +public interface SelectField extends SelectFieldOrAsterisk { // ------------------------------------------------------------------------ // API diff --git a/jOOQ/src/main/java/org/jooq/SelectFieldOrAsterisk.java b/jOOQ/src/main/java/org/jooq/SelectFieldOrAsterisk.java new file mode 100644 index 0000000000..e5ca3897ac --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/SelectFieldOrAsterisk.java @@ -0,0 +1,49 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq; + + +/** + * A QueryPart to be used exclusively in SELECT + * clauses. + * + * @author Lukas Eder + */ +public interface SelectFieldOrAsterisk extends QueryPart { + +} diff --git a/jOOQ/src/main/java/org/jooq/SelectQuery.java b/jOOQ/src/main/java/org/jooq/SelectQuery.java index a1e9b917cf..2c445c58e8 100644 --- a/jOOQ/src/main/java/org/jooq/SelectQuery.java +++ b/jOOQ/src/main/java/org/jooq/SelectQuery.java @@ -82,7 +82,7 @@ public interface SelectQuery extends Select, ConditionProvi * @param fields */ @Support - void addSelect(SelectField... fields); + void addSelect(SelectFieldOrAsterisk... fields); /** * Add a list of select fields. @@ -90,7 +90,7 @@ public interface SelectQuery extends Select, ConditionProvi * @param fields */ @Support - void addSelect(Collection> fields); + void addSelect(Collection fields); /** * Add "distinct" keyword to the select clause. @@ -104,7 +104,7 @@ public interface SelectQuery extends Select, ConditionProvi * This also sets the distinct flag to true */ @Support({ POSTGRES }) - void addDistinctOn(SelectField... fields); + void addDistinctOn(SelectFieldOrAsterisk... fields); /** * Add a PostgreSQL-specific DISTINCT ON (fields...) clause. @@ -112,7 +112,7 @@ public interface SelectQuery extends Select, ConditionProvi * This also sets the distinct flag to true */ @Support({ POSTGRES }) - void addDistinctOn(Collection> fields); + void addDistinctOn(Collection fields); /** * Add INTO clause to the SELECT statement. diff --git a/jOOQ/src/main/java/org/jooq/SelectSelectStep.java b/jOOQ/src/main/java/org/jooq/SelectSelectStep.java index f995421c2c..8d0b3e483c 100644 --- a/jOOQ/src/main/java/org/jooq/SelectSelectStep.java +++ b/jOOQ/src/main/java/org/jooq/SelectSelectStep.java @@ -88,11 +88,11 @@ public interface SelectSelectStep extends SelectDistinctOnStep * Add additional fields to the SELECT clause of this query */ @Support - SelectSelectStep select(SelectField... fields); + SelectSelectStep select(SelectFieldOrAsterisk... fields); /** * Add additional fields to the SELECT clause of this query */ @Support - SelectSelectStep select(Collection> fields); + SelectSelectStep select(Collection fields); } diff --git a/jOOQ/src/main/java/org/jooq/StoreQuery.java b/jOOQ/src/main/java/org/jooq/StoreQuery.java index 7a863cca67..439462b2fa 100644 --- a/jOOQ/src/main/java/org/jooq/StoreQuery.java +++ b/jOOQ/src/main/java/org/jooq/StoreQuery.java @@ -116,7 +116,7 @@ public interface StoreQuery extends Query { * @see #getReturnedRecords() */ @Support - void setReturning(Field... fields); + void setReturning(SelectFieldOrAsterisk... fields); /** * Configure the INSERT or UPDATE statement to return a list of fields in @@ -126,7 +126,7 @@ public interface StoreQuery extends Query { * @see #getReturnedRecords() */ @Support - void setReturning(Collection> fields); + void setReturning(Collection fields); /** * The record holding returned values as specified by any of the diff --git a/jOOQ/src/main/java/org/jooq/Table.java b/jOOQ/src/main/java/org/jooq/Table.java index 0edcc90659..f86bbbe9ed 100644 --- a/jOOQ/src/main/java/org/jooq/Table.java +++ b/jOOQ/src/main/java/org/jooq/Table.java @@ -96,6 +96,7 @@ public interface Table extends TableLike, Named { * expressions return the empty string "" here, never * null. */ + @Override String getComment(); /** @@ -275,6 +276,17 @@ public interface Table extends TableLike, Named { + + // ------------------------------------------------------------------------- + // XXX: Expressions based on this table + // ------------------------------------------------------------------------- + + /** + * Create a qualified asterisk expression from this table + * (table.*) for use with SELECT. + */ + @Support + QualifiedAsterisk asterisk(); // ------------------------------------------------------------------------- // XXX: Aliasing clauses diff --git a/jOOQ/src/main/java/org/jooq/UpdateQuery.java b/jOOQ/src/main/java/org/jooq/UpdateQuery.java index f0c897fd9e..69b0d96573 100644 --- a/jOOQ/src/main/java/org/jooq/UpdateQuery.java +++ b/jOOQ/src/main/java/org/jooq/UpdateQuery.java @@ -490,7 +490,7 @@ public interface UpdateQuery extends StoreQuery, ConditionP */ @Override @Support({ FIREBIRD, POSTGRES }) - void setReturning(Field... fields); + void setReturning(SelectFieldOrAsterisk... fields); /** * {@inheritDoc} @@ -500,7 +500,7 @@ public interface UpdateQuery extends StoreQuery, ConditionP */ @Override @Support({ FIREBIRD, POSTGRES }) - void setReturning(Collection> fields); + void setReturning(Collection fields); /** * {@inheritDoc} diff --git a/jOOQ/src/main/java/org/jooq/UpdateReturningStep.java b/jOOQ/src/main/java/org/jooq/UpdateReturningStep.java index 20b253f2d7..bf19699bbb 100644 --- a/jOOQ/src/main/java/org/jooq/UpdateReturningStep.java +++ b/jOOQ/src/main/java/org/jooq/UpdateReturningStep.java @@ -87,7 +87,7 @@ public interface UpdateReturningStep extends UpdateFinalStep returning(Field... fields); + UpdateResultStep returning(SelectFieldOrAsterisk... fields); /** * Configure the UPDATE statement to return a list of fields in @@ -97,5 +97,5 @@ public interface UpdateReturningStep extends UpdateFinalStep returning(Collection> fields); + UpdateResultStep returning(Collection fields); } diff --git a/jOOQ/src/main/java/org/jooq/WithStep.java b/jOOQ/src/main/java/org/jooq/WithStep.java index d555d14c63..c6a637e9b6 100644 --- a/jOOQ/src/main/java/org/jooq/WithStep.java +++ b/jOOQ/src/main/java/org/jooq/WithStep.java @@ -488,7 +488,7 @@ public interface WithStep extends QueryPart { * @see DSL#select(Collection) */ @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) - SelectSelectStep select(Collection> fields); + SelectSelectStep select(Collection fields); /** * Create a new DSL select statement. @@ -513,14 +513,14 @@ public interface WithStep extends QueryPart { * @see DSL#select(SelectField...) */ @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) - SelectSelectStep select(SelectField... fields); + SelectSelectStep select(SelectFieldOrAsterisk... fields); // [jooq-tools] START [select] /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -541,8 +541,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -551,7 +551,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -572,8 +572,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -582,7 +582,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -603,8 +603,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -613,7 +613,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -634,8 +634,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -644,7 +644,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -665,8 +665,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -675,7 +675,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -696,8 +696,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -706,7 +706,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -727,8 +727,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -737,7 +737,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -758,8 +758,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -768,7 +768,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -789,8 +789,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -799,7 +799,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -820,8 +820,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -830,7 +830,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -851,8 +851,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -861,7 +861,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -882,8 +882,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -892,7 +892,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -913,8 +913,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -923,7 +923,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -944,8 +944,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -954,7 +954,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -975,8 +975,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -985,7 +985,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1006,8 +1006,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1016,7 +1016,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1037,8 +1037,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1047,7 +1047,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1068,8 +1068,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1078,7 +1078,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1099,8 +1099,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1109,7 +1109,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1130,8 +1130,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1140,7 +1140,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1161,8 +1161,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1171,7 +1171,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #select(SelectField...)}, except that it + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1192,8 +1192,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1223,7 +1223,7 @@ public interface WithStep extends QueryPart { * @see DSL#selectDistinct(Collection) */ @Support({ FIREBIRD, HSQLDB, MYSQL_8_0, POSTGRES }) - SelectSelectStep selectDistinct(Collection> fields); + SelectSelectStep selectDistinct(Collection fields); /** * Create a new DSL select statement. @@ -1247,14 +1247,14 @@ public interface WithStep extends QueryPart { * @see DSL#selectDistinct(SelectField...) */ @Support({ FIREBIRD, HSQLDB, MYSQL_8_0, POSTGRES }) - SelectSelectStep selectDistinct(SelectField... fields); + SelectSelectStep selectDistinct(SelectFieldOrAsterisk... fields); // [jooq-tools] START [selectDistinct] /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1275,8 +1275,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1285,7 +1285,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1306,8 +1306,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1316,7 +1316,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1337,8 +1337,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1347,7 +1347,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1368,8 +1368,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1378,7 +1378,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1399,8 +1399,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1409,7 +1409,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1430,8 +1430,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1440,7 +1440,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1461,8 +1461,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1471,7 +1471,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1492,8 +1492,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1502,7 +1502,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1523,8 +1523,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1533,7 +1533,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1554,8 +1554,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1564,7 +1564,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1585,8 +1585,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1595,7 +1595,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1616,8 +1616,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1626,7 +1626,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1647,8 +1647,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1657,7 +1657,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1678,8 +1678,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1688,7 +1688,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1709,8 +1709,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1719,7 +1719,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1740,8 +1740,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1750,7 +1750,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1771,8 +1771,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1781,7 +1781,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1802,8 +1802,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1812,7 +1812,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1833,8 +1833,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1843,7 +1843,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1864,8 +1864,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1874,7 +1874,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1895,8 +1895,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) @@ -1905,7 +1905,7 @@ public interface WithStep extends QueryPart { /** * Create a new DSL select statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -1926,8 +1926,8 @@ public interface WithStep extends QueryPart { * .orderBy(field2); * * - * @see DSL#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSL#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support({ FIREBIRD, H2, HSQLDB, MYSQL_8_0, POSTGRES }) diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java b/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java index e06ad233ba..912a960f1f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractDMLQuery.java @@ -60,9 +60,8 @@ import static org.jooq.impl.Keywords.K_ROWCOUNT; import static org.jooq.impl.Keywords.K_SELECT; import static org.jooq.impl.Keywords.K_SQL; import static org.jooq.impl.Keywords.K_TABLE; +import static org.jooq.impl.Tools.EMPTY_FIELD; import static org.jooq.impl.Tools.EMPTY_STRING; -import static org.jooq.impl.Tools.fieldArray; -import static org.jooq.impl.Tools.unqualify; import static org.jooq.util.sqlite.SQLiteDSL.rowid; import java.sql.CallableStatement; @@ -78,6 +77,7 @@ import java.util.Collection; import java.util.EnumSet; import java.util.List; +import org.jooq.Asterisk; import org.jooq.Binding; import org.jooq.Configuration; import org.jooq.Context; @@ -88,9 +88,11 @@ import org.jooq.ExecuteContext; import org.jooq.ExecuteListener; import org.jooq.Field; import org.jooq.Identity; +import org.jooq.QualifiedAsterisk; import org.jooq.Record; import org.jooq.Result; import org.jooq.SQLDialect; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.Table; import org.jooq.UpdateQuery; import org.jooq.conf.ExecuteWithoutWhere; @@ -108,23 +110,25 @@ abstract class AbstractDMLQuery extends AbstractQuery { /** * Generated UID */ - private static final long serialVersionUID = -7438014075226919192L; - private static final JooqLogger log = JooqLogger.getLogger(AbstractQuery.class); + private static final long serialVersionUID = -7438014075226919192L; + private static final JooqLogger log = JooqLogger.getLogger(AbstractQuery.class); - final WithImpl with; - final Table table; - final SelectFieldList returning; - Result returned; + final WithImpl with; + final Table table; + final SelectFieldList returning; + final List> returningResolvedAsterisks; + Result returned; AbstractDMLQuery(Configuration configuration, WithImpl with, Table table) { super(configuration); this.with = with; this.table = table; - this.returning = new SelectFieldList(); + this.returning = new SelectFieldList(); + this.returningResolvedAsterisks = new ArrayList>(); } // @Override @@ -134,36 +138,42 @@ abstract class AbstractDMLQuery extends AbstractQuery { // @Override public final void setReturning(Identity identity) { - if (identity != null) { + if (identity != null) setReturning(identity.getField()); - } } // @Override - public final void setReturning(Field... fields) { + public final void setReturning(SelectFieldOrAsterisk... fields) { setReturning(Arrays.asList(fields)); } // @Override - public final void setReturning(Collection> fields) { + public final void setReturning(Collection fields) { returning.clear(); returning.addAll(fields); + + returningResolvedAsterisks.clear(); + for (SelectFieldOrAsterisk f : fields) + if (f instanceof Field) + returningResolvedAsterisks.add((Field) f); + else if (f instanceof QualifiedAsterisk) + returningResolvedAsterisks.addAll(Arrays.asList(((QualifiedAsterisk) f).qualifier().fields())); + else if (f instanceof Asterisk) + returningResolvedAsterisks.addAll(Arrays.asList(table.fields())); } // @Override public final R getReturnedRecord() { - if (getReturnedRecords().size() == 0) { + if (getReturnedRecords().size() == 0) return null; - } return getReturnedRecords().get(0); } // @Override public final Result getReturnedRecords() { - if (returned == null) { - returned = new ResultImpl(configuration(), returning); - } + if (returned == null) + returned = new ResultImpl(configuration(), returningResolvedAsterisks); return returned; } @@ -453,7 +463,7 @@ abstract class AbstractDMLQuery extends AbstractQuery { List names = new ArrayList(); RenderNameStyle style = configuration().settings().getRenderNameStyle(); - for (Field field : returning) { + for (Field field : returningResolvedAsterisks) { // [#2845] Field names should be passed to JDBC in the case // imposed by the user. For instance, if the user uses @@ -525,7 +535,7 @@ abstract class AbstractDMLQuery extends AbstractQuery { ctx.rows(result); listener.executeEnd(ctx); - selectReturning(ctx.configuration(), create(ctx.configuration()).lastID()); + selectReturning(ctx.configuration(), ctx.dsl().lastID()); return result; } @@ -679,7 +689,7 @@ abstract class AbstractDMLQuery extends AbstractQuery { ExecuteListener listener2 = ExecuteListeners.get(ctx2); ctx2.resultSet(rs); - returned = new CursorImpl(ctx2, listener2, fieldArray(returning), null, false, true).fetch(); + returned = new CursorImpl(ctx2, listener2, returningResolvedAsterisks.toArray(EMPTY_FIELD), null, false, true).fetch(); // [#3682] Plain SQL tables do not have any fields if (table.fields().length > 0) @@ -716,7 +726,7 @@ abstract class AbstractDMLQuery extends AbstractQuery { // Only the IDENTITY value was requested. No need for an // additional query - if (returning.size() == 1 && new Fields(returning).field(field) != null) { + if (returningResolvedAsterisks.size() == 1 && new Fields(returningResolvedAsterisks).field(field) != null) { for (final Object id : ids) { getReturnedRecords().add( Tools.newRecord(true, table, configuration) @@ -738,10 +748,10 @@ abstract class AbstractDMLQuery extends AbstractQuery { // Other values are requested, too. Run another query else { returned = - create(configuration).select(returning) - .from(table) - .where(field.in(ids)) - .fetchInto(table); + configuration.dsl().select(returning) + .from(table) + .where(field.in(ids)) + .fetchInto(table); } } } diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java b/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java index c57f98984c..34da0f7c6a 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractTable.java @@ -83,6 +83,7 @@ import org.jooq.JoinType; // ... import org.jooq.Name; import org.jooq.PivotForStep; +import org.jooq.QualifiedAsterisk; import org.jooq.QueryPart; import org.jooq.Record; import org.jooq.RecordType; @@ -174,6 +175,11 @@ abstract class AbstractTable extends AbstractNamed implements // XXX: TableLike API // ------------------------------------------------------------------------ + @Override + public final QualifiedAsterisk asterisk() { + return new QualifiedAsteriskImpl(this); + } + /** * Subclasses should override this method to provide the set of fields * contained in the concrete table implementation. For example, a diff --git a/jOOQ/src/main/java/org/jooq/impl/Alias.java b/jOOQ/src/main/java/org/jooq/impl/Alias.java index f36bef0427..01e8dc93ac 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Alias.java +++ b/jOOQ/src/main/java/org/jooq/impl/Alias.java @@ -153,7 +153,7 @@ final class Alias extends AbstractQueryPart { else if (fieldAliases != null && SUPPORT_DERIVED_COLUMN_NAMES_SPECIAL2.contains(family)) { emulatedDerivedColumnList = true; - SelectFieldList fields = new SelectFieldList(); + SelectFieldList> fields = new SelectFieldList>(); for (Name fieldAlias : fieldAliases) { switch (family) { diff --git a/jOOQ/src/main/java/org/jooq/impl/AsteriskImpl.java b/jOOQ/src/main/java/org/jooq/impl/AsteriskImpl.java new file mode 100644 index 0000000000..b0b4bd3e21 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/AsteriskImpl.java @@ -0,0 +1,60 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import org.jooq.Asterisk; +import org.jooq.Clause; +import org.jooq.Context; + +/** + * @author Lukas Eder + */ +final class AsteriskImpl extends AbstractQueryPart implements Asterisk { + + static final AsteriskImpl INSTANCE = new AsteriskImpl(); + + @Override + public final void accept(Context ctx) { + ctx.sql('*'); + } + + @Override + public final Clause[] clauses(Context ctx) { + return null; + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index e12c40d341..40adc6af8d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -113,6 +113,7 @@ import org.jooq.AlterTableStep; import org.jooq.AlterViewStep; import org.jooq.ArrayAggOrderByStep; // ... +import org.jooq.Asterisk; import org.jooq.Block; import org.jooq.Case; import org.jooq.CaseConditionStep; @@ -294,6 +295,7 @@ import org.jooq.SQLDialect; import org.jooq.Schema; import org.jooq.Select; import org.jooq.SelectField; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.SelectSelectStep; import org.jooq.SelectWhereStep; import org.jooq.Sequence; @@ -2733,7 +2735,7 @@ public class DSL { * @see DSLContext#select(Collection) */ @Support - public static SelectSelectStep select(Collection> fields) { + public static SelectSelectStep select(Collection fields) { return dsl().select(fields); } @@ -2773,7 +2775,7 @@ public class DSL { * @see DSLContext#select(SelectField...) */ @Support - public static SelectSelectStep select(SelectField... fields) { + public static SelectSelectStep select(SelectFieldOrAsterisk... fields) { return dsl().select(fields); } @@ -2782,7 +2784,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -2808,8 +2810,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -2820,7 +2822,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -2846,8 +2848,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -2858,7 +2860,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -2884,8 +2886,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -2896,7 +2898,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -2922,8 +2924,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -2934,7 +2936,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -2960,8 +2962,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -2972,7 +2974,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -2998,8 +3000,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3010,7 +3012,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3036,8 +3038,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3048,7 +3050,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3074,8 +3076,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3086,7 +3088,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3112,8 +3114,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3124,7 +3126,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3150,8 +3152,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3162,7 +3164,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3188,8 +3190,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3200,7 +3202,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3226,8 +3228,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3238,7 +3240,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3264,8 +3266,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3276,7 +3278,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3302,8 +3304,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3314,7 +3316,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3340,8 +3342,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3352,7 +3354,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3378,8 +3380,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3390,7 +3392,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3416,8 +3418,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3428,7 +3430,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3454,8 +3456,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3466,7 +3468,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3492,8 +3494,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3504,7 +3506,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3530,8 +3532,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3542,7 +3544,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3568,8 +3570,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3580,7 +3582,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #select(SelectField...)}, except that it declares + * This is the same as {@link #select(SelectFieldOrAsterisk...)}, except that it declares * additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3606,8 +3608,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#select(SelectField...) - * @see #select(SelectField...) + * @see DSLContext#select(SelectFieldOrAsterisk...) + * @see #select(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3653,7 +3655,7 @@ public class DSL { * @see DSLContext#selectDistinct(Collection) */ @Support - public static SelectSelectStep selectDistinct(Collection> fields) { + public static SelectSelectStep selectDistinct(Collection fields) { return dsl().selectDistinct(fields); } @@ -3693,7 +3695,7 @@ public class DSL { * @see DSLContext#selectDistinct(SelectField...) */ @Support - public static SelectSelectStep selectDistinct(SelectField... fields) { + public static SelectSelectStep selectDistinct(SelectFieldOrAsterisk... fields) { return dsl().selectDistinct(fields); } @@ -3702,7 +3704,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Field#in(Select)}, {@link Field#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3728,8 +3730,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3740,7 +3742,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row2#in(Select)}, {@link Row2#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3766,8 +3768,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3778,7 +3780,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row3#in(Select)}, {@link Row3#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3804,8 +3806,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3816,7 +3818,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row4#in(Select)}, {@link Row4#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3842,8 +3844,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3854,7 +3856,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row5#in(Select)}, {@link Row5#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3880,8 +3882,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3892,7 +3894,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row6#in(Select)}, {@link Row6#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3918,8 +3920,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3930,7 +3932,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row7#in(Select)}, {@link Row7#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3956,8 +3958,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -3968,7 +3970,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row8#in(Select)}, {@link Row8#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -3994,8 +3996,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4006,7 +4008,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row9#in(Select)}, {@link Row9#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4032,8 +4034,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4044,7 +4046,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row10#in(Select)}, {@link Row10#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4070,8 +4072,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4082,7 +4084,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row11#in(Select)}, {@link Row11#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4108,8 +4110,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4120,7 +4122,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row12#in(Select)}, {@link Row12#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4146,8 +4148,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4158,7 +4160,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row13#in(Select)}, {@link Row13#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4184,8 +4186,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4196,7 +4198,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row14#in(Select)}, {@link Row14#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4222,8 +4224,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4234,7 +4236,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row15#in(Select)}, {@link Row15#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4260,8 +4262,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4272,7 +4274,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row16#in(Select)}, {@link Row16#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4298,8 +4300,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4310,7 +4312,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row17#in(Select)}, {@link Row17#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4336,8 +4338,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4348,7 +4350,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row18#in(Select)}, {@link Row18#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4374,8 +4376,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4386,7 +4388,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row19#in(Select)}, {@link Row19#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4412,8 +4414,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4424,7 +4426,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row20#in(Select)}, {@link Row20#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4450,8 +4452,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4462,7 +4464,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row21#in(Select)}, {@link Row21#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4488,8 +4490,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -4500,7 +4502,7 @@ public class DSL { /** * Create a new DSL subselect statement. *

- * This is the same as {@link #selectDistinct(SelectField...)}, except that it + * This is the same as {@link #selectDistinct(SelectFieldOrAsterisk...)}, except that it * declares additional record-level typesafety, which is needed by * {@link Row22#in(Select)}, {@link Row22#equal(Select)} and other predicate * building methods taking subselect arguments. @@ -4526,8 +4528,8 @@ public class DSL { * .orderBy(field2); * * - * @see DSLContext#selectDistinct(SelectField...) - * @see #selectDistinct(SelectField...) + * @see DSLContext#selectDistinct(SelectFieldOrAsterisk...) + * @see #selectDistinct(SelectFieldOrAsterisk...) */ @Generated("This method was generated using jOOQ-tools") @Support @@ -20966,6 +20968,14 @@ public class DSL { return (DataType) (field == null ? SQLDataType.OTHER : field.getDataType()); } + /** + * The asterisk (*) to be used in SELECT clauses. + */ + @Support + public static Asterisk asterisk() { + return AsteriskImpl.INSTANCE; + } + /** * A 0 literal. *

diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java index 71de9e0d82..918347e1db 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDSLContext.java @@ -222,6 +222,7 @@ import org.jooq.SQLDialect; import org.jooq.Schema; import org.jooq.Select; import org.jooq.SelectField; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.SelectQuery; import org.jooq.SelectSelectStep; import org.jooq.SelectWhereStep; @@ -2075,12 +2076,12 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri } @Override - public SelectSelectStep select(Collection> fields) { + public SelectSelectStep select(Collection fields) { return new SelectImpl(configuration(), null).select(fields); } @Override - public SelectSelectStep select(SelectField... fields) { + public SelectSelectStep select(SelectFieldOrAsterisk... fields) { return new SelectImpl(configuration(), null).select(fields); } @@ -2221,12 +2222,12 @@ public class DefaultDSLContext extends AbstractScope implements DSLContext, Seri // [jooq-tools] END [select] @Override - public SelectSelectStep selectDistinct(Collection> fields) { + public SelectSelectStep selectDistinct(Collection fields) { return new SelectImpl(configuration(), null, true).select(fields); } @Override - public SelectSelectStep selectDistinct(SelectField... fields) { + public SelectSelectStep selectDistinct(SelectFieldOrAsterisk... fields) { return new SelectImpl(configuration(), null, true).select(fields); } diff --git a/jOOQ/src/main/java/org/jooq/impl/DeleteImpl.java b/jOOQ/src/main/java/org/jooq/impl/DeleteImpl.java index d9cc41ed55..78130f7318 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DeleteImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/DeleteImpl.java @@ -57,6 +57,7 @@ import org.jooq.Record; import org.jooq.Result; import org.jooq.SQL; import org.jooq.Select; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.Table; /** @@ -272,13 +273,13 @@ final class DeleteImpl } @Override - public final DeleteImpl returning(Field... f) { + public final DeleteImpl returning(SelectFieldOrAsterisk... f) { getDelegate().setReturning(f); return this; } @Override - public final DeleteImpl returning(Collection> f) { + public final DeleteImpl returning(Collection f) { getDelegate().setReturning(f); return this; } diff --git a/jOOQ/src/main/java/org/jooq/impl/Function.java b/jOOQ/src/main/java/org/jooq/impl/Function.java index ac3ad24a04..31587ac0e3 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Function.java +++ b/jOOQ/src/main/java/org/jooq/impl/Function.java @@ -312,7 +312,7 @@ class Function extends AbstractField implements final void toSQLGroupConcat(Context ctx) { toSQLFunctionName(ctx); ctx.sql('('); - toSQLArguments1(ctx, new QueryPartList(arguments.get(0))); + toSQLArguments1(ctx, new QueryPartList(Arrays.asList(arguments.get(0)))); if (!withinGroupOrderBy.isEmpty()) ctx.sql(' ').visit(K_ORDER_BY).sql(' ') diff --git a/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java b/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java index c10e786226..a13f7d7670 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/InsertImpl.java @@ -64,14 +64,6 @@ import org.jooq.InsertResultStep; import org.jooq.InsertSetMoreStep; import org.jooq.InsertSetStep; import org.jooq.InsertValuesStep1; -import org.jooq.InsertValuesStep2; -import org.jooq.InsertValuesStep3; -import org.jooq.InsertValuesStep4; -import org.jooq.InsertValuesStep5; -import org.jooq.InsertValuesStep6; -import org.jooq.InsertValuesStep7; -import org.jooq.InsertValuesStep8; -import org.jooq.InsertValuesStep9; import org.jooq.InsertValuesStep10; import org.jooq.InsertValuesStep11; import org.jooq.InsertValuesStep12; @@ -82,9 +74,17 @@ import org.jooq.InsertValuesStep16; import org.jooq.InsertValuesStep17; import org.jooq.InsertValuesStep18; import org.jooq.InsertValuesStep19; +import org.jooq.InsertValuesStep2; import org.jooq.InsertValuesStep20; import org.jooq.InsertValuesStep21; import org.jooq.InsertValuesStep22; +import org.jooq.InsertValuesStep3; +import org.jooq.InsertValuesStep4; +import org.jooq.InsertValuesStep5; +import org.jooq.InsertValuesStep6; +import org.jooq.InsertValuesStep7; +import org.jooq.InsertValuesStep8; +import org.jooq.InsertValuesStep9; import org.jooq.InsertValuesStepN; import org.jooq.Name; import org.jooq.Operator; @@ -94,6 +94,7 @@ import org.jooq.Record1; import org.jooq.Result; import org.jooq.SQL; import org.jooq.Select; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.Table; import org.jooq.UniqueKey; @@ -869,13 +870,13 @@ class InsertImpl... f) { + public final InsertImpl returning(SelectFieldOrAsterisk... f) { getDelegate().setReturning(f); return this; } @Override - public final InsertImpl returning(Collection> f) { + public final InsertImpl returning(Collection f) { getDelegate().setReturning(f); return this; } diff --git a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java index fd2ad72ef5..adc69712d5 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/ParserImpl.java @@ -321,6 +321,7 @@ import org.jooq.OrderedAggregateFunctionOfDeferredType; import org.jooq.Param; import org.jooq.Parser; import org.jooq.Privilege; +import org.jooq.QualifiedAsterisk; import org.jooq.Queries; import org.jooq.Query; import org.jooq.QueryPart; @@ -335,6 +336,7 @@ import org.jooq.RowN; import org.jooq.SQL; import org.jooq.Schema; import org.jooq.Select; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.Sequence; import org.jooq.SortField; import org.jooq.Statement; @@ -908,9 +910,16 @@ final class ParserImpl implements Parser { limit = parseUnsignedInteger(ctx); } - List> select = parseSelectList(ctx); - if (degree != null && select.size() != degree) + List select = parseSelectList(ctx); + + degreeCheck: + if (degree != null && select.size() != degree) { + for (SelectFieldOrAsterisk s : select) + if (!(s instanceof Field)) + break degreeCheck; + throw ctx.exception("Select list must contain " + degree + " columns. Got: " + select.size()); + } Table into = null; List> from = null; @@ -3231,27 +3240,35 @@ final class ParserImpl implements Parser { } } - private static final List> parseSelectList(ParserContext ctx) { + private static final List parseSelectList(ParserContext ctx) { parseWhitespaceIf(ctx); - if (parseIf(ctx, '*')) - return Collections.emptyList(); - - // TODO Support qualified asterisk - List> result = new ArrayList>(); + List result = new ArrayList(); do { if (peekKeyword(ctx, SELECT_KEYWORDS)) throw ctx.unexpectedToken(); - Field field = parseField(ctx); - Name alias = null; + if (parseIf(ctx, '*')) { + result.add(DSL.asterisk()); + } + else { + QueryPart identifier = parseNameOrQualifiedAsteriskIf(ctx); - if (parseKeywordIf(ctx, "AS")) - alias = parseIdentifier(ctx, true); - else if (!peekKeyword(ctx, SELECT_KEYWORDS)) - alias = parseIdentifierIf(ctx, true); + if (identifier != null && identifier instanceof QualifiedAsterisk) { + result.add((QualifiedAsterisk) identifier); + } + else { + Field field = identifier != null ? field((Name) identifier) : parseField(ctx); + Name alias = null; - result.add(alias == null ? field : field.as(alias)); + if (parseKeywordIf(ctx, "AS")) + alias = parseIdentifier(ctx, true); + else if (!peekKeyword(ctx, SELECT_KEYWORDS)) + alias = parseIdentifierIf(ctx, true); + + result.add(alias == null ? field : field.as(alias)); + } + } } while (parseIf(ctx, ',')); return result; @@ -5779,6 +5796,28 @@ final class ParserImpl implements Parser { return result.size() == 1 ? result.get(0) : DSL.name(result.toArray(EMPTY_NAME)); } + private static final QueryPart parseNameOrQualifiedAsteriskIf(ParserContext ctx) { + Name identifier = parseIdentifierIf(ctx); + + if (identifier == null) + return null; + + List result = new ArrayList(); + result.add(identifier); + + while (parseIf(ctx, '.')) { + if ((identifier = parseIdentifierIf(ctx)) != null) { + result.add(identifier); + } + else { + parse(ctx, '*'); + return table(result.size() == 1 ? result.get(0) : DSL.name(result.toArray(EMPTY_NAME))).asterisk(); + } + } + + return result.size() == 1 ? result.get(0) : DSL.name(result.toArray(EMPTY_NAME)); + } + private static final List parseIdentifiers(ParserContext ctx) { LinkedHashSet result = new LinkedHashSet(); diff --git a/jOOQ/src/main/java/org/jooq/impl/Pivot.java b/jOOQ/src/main/java/org/jooq/impl/Pivot.java index 63961766d6..8244f28e46 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Pivot.java +++ b/jOOQ/src/main/java/org/jooq/impl/Pivot.java @@ -79,18 +79,18 @@ implements /** * Generated UID */ - private static final long serialVersionUID = -7918219502110473521L; + private static final long serialVersionUID = -7918219502110473521L; - private final Table table; - private final SelectFieldList aggregateFunctions; - private Field on; - private SelectFieldList in; + private final Table table; + private final SelectFieldList> aggregateFunctions; + private Field on; + private SelectFieldList> in; Pivot(Table table, Field... aggregateFunctions) { super("pivot"); this.table = table; - this.aggregateFunctions = new SelectFieldList(aggregateFunctions); + this.aggregateFunctions = new SelectFieldList>(aggregateFunctions); } // ------------------------------------------------------------------------ diff --git a/jOOQ/src/main/java/org/jooq/impl/QualifiedAsteriskImpl.java b/jOOQ/src/main/java/org/jooq/impl/QualifiedAsteriskImpl.java new file mode 100644 index 0000000000..4fca05fb17 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/QualifiedAsteriskImpl.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: http://www.jooq.org/licenses + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import org.jooq.Clause; +import org.jooq.Context; +import org.jooq.QualifiedAsterisk; +import org.jooq.Table; + +/** + * @author Lukas Eder + */ +final class QualifiedAsteriskImpl extends AbstractQueryPart implements QualifiedAsterisk { + + private static final long serialVersionUID = 4509166418833560865L; + private final Table table; + + QualifiedAsteriskImpl(Table table) { + this.table = table; + } + + @Override + public final void accept(Context ctx) { + ctx.visit(table).sql('.').visit(AsteriskImpl.INSTANCE); + } + + @Override + public final Clause[] clauses(Context ctx) { + return null; + } + + @Override + public final Table qualifier() { + return table; + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/QueryPartList.java b/jOOQ/src/main/java/org/jooq/impl/QueryPartList.java index 214d06409a..0041b9dce6 100644 --- a/jOOQ/src/main/java/org/jooq/impl/QueryPartList.java +++ b/jOOQ/src/main/java/org/jooq/impl/QueryPartList.java @@ -58,28 +58,45 @@ class QueryPartList extends AbstractQueryPart implements Li private static final long serialVersionUID = -2936922742534009564L; private final List wrappedList; + private final boolean qualify; QueryPartList() { - this((Collection) null); + this(true); } QueryPartList(Collection wrappedList) { + this(wrappedList, true); + } + + QueryPartList(T[] wrappedList) { + this(wrappedList, true); + } + + QueryPartList(boolean qualify) { + this((Collection) null, qualify); + } + + QueryPartList(Collection wrappedList, boolean qualify) { super(); this.wrappedList = new ArrayList(); + this.qualify = qualify; // [#4664] Don't allocate the backing array if not necessary! if (wrappedList != null && !wrappedList.isEmpty()) addAll(wrappedList); } - @SafeVarargs - QueryPartList(T... wrappedList) { - this(asList(wrappedList)); + QueryPartList(T[] wrappedList, boolean qualify) { + this(asList(wrappedList), qualify); } @Override - public final void accept(Context ctx) { + public /* non-final */ void accept(Context ctx) { + boolean previous = ctx.qualify(); + + if (!qualify) + ctx.qualify(qualify); // Some lists render different SQL when empty if (isEmpty()) { @@ -106,6 +123,8 @@ class QueryPartList extends AbstractQueryPart implements Li if (indent) ctx.formatIndentEnd().formatNewLine(); } + + ctx.qualify(previous); } @Override diff --git a/jOOQ/src/main/java/org/jooq/impl/RowField.java b/jOOQ/src/main/java/org/jooq/impl/RowField.java index 765e76f144..7273767939 100644 --- a/jOOQ/src/main/java/org/jooq/impl/RowField.java +++ b/jOOQ/src/main/java/org/jooq/impl/RowField.java @@ -108,7 +108,7 @@ final class RowField extends AbstractField< Object previous = ctx.data(DATA_LIST_ALREADY_INDENTED); ctx.data(DATA_LIST_ALREADY_INDENTED, true); - ctx.visit(new SelectFieldList(emulatedFields())); + ctx.visit(new SelectFieldList>(emulatedFields())); ctx.data(DATA_LIST_ALREADY_INDENTED, previous); } else { diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectFieldList.java b/jOOQ/src/main/java/org/jooq/impl/SelectFieldList.java index cfe4ee9c2e..0daa059c1b 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectFieldList.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectFieldList.java @@ -41,13 +41,12 @@ package org.jooq.impl; import java.util.Collection; import org.jooq.Context; -import org.jooq.Field; -import org.jooq.SelectField; +import org.jooq.SelectFieldOrAsterisk; /** * @author Lukas Eder */ -final class SelectFieldList extends QueryPartList> { +final class SelectFieldList extends QueryPartList { private static final long serialVersionUID = 8850104968428500798L; @@ -55,17 +54,29 @@ final class SelectFieldList extends QueryPartList> { super(); } - SelectFieldList(Collection> wrappedList) { - super(Tools.fields(wrappedList)); + SelectFieldList(Collection wrappedList) { + super(wrappedList); } - SelectFieldList(SelectField... wrappedList) { - super(Tools.fields(wrappedList)); + SelectFieldList(F[] wrappedList) { + super(wrappedList); + } + + SelectFieldList(boolean qualify) { + super(qualify); + } + + SelectFieldList(Collection wrappedList, boolean qualify) { + super(wrappedList, qualify); + } + + SelectFieldList(F[] wrappedList, boolean qualify) { + super(wrappedList, qualify); } @Override protected void toSQLEmptyList(Context ctx) { - ctx.sql('*'); + ctx.visit(AsteriskImpl.INSTANCE); } @Override diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectImpl.java b/jOOQ/src/main/java/org/jooq/impl/SelectImpl.java index 3a54258f0e..79efdda580 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectImpl.java @@ -87,7 +87,7 @@ import org.jooq.SelectConditionStep; import org.jooq.SelectConnectByAfterStartWithConditionStep; import org.jooq.SelectConnectByAfterStartWithStep; import org.jooq.SelectConnectByConditionStep; -import org.jooq.SelectField; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.SelectFinalStep; import org.jooq.SelectForUpdateOfStep; import org.jooq.SelectHavingConditionStep; @@ -245,7 +245,7 @@ final class SelectImpl and SelectSelectStep<R> */ @Override - public final SelectImpl select(SelectField... fields) { + public final SelectImpl select(SelectFieldOrAsterisk... fields) { getQuery().addSelect(fields); return this; } @@ -255,29 +255,29 @@ final class SelectImpl and SelectSelectStep<R> */ @Override - public final SelectImpl select(Collection> fields) { + public final SelectImpl select(Collection fields) { getQuery().addSelect(fields); return this; } @Override - public final SelectIntoStep on(SelectField... fields) { + public final SelectIntoStep on(SelectFieldOrAsterisk... fields) { return distinctOn(Arrays.asList(fields)); } @Override - public final SelectIntoStep on(Collection> fields) { + public final SelectIntoStep on(Collection fields) { return distinctOn(fields); } @Override - public final SelectIntoStep distinctOn(SelectField... fields) { + public final SelectIntoStep distinctOn(SelectFieldOrAsterisk... fields) { getQuery().addDistinctOn(fields); return this; } @Override - public final SelectIntoStep distinctOn(Collection> fields) { + public final SelectIntoStep distinctOn(Collection fields) { getQuery().addDistinctOn(fields); return this; } diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java index 396514e7f4..f9ca8f21e9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java @@ -143,6 +143,7 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.stream.Stream; +import org.jooq.Asterisk; import org.jooq.Clause; import org.jooq.Condition; import org.jooq.Configuration; @@ -157,11 +158,12 @@ import org.jooq.Name; import org.jooq.Operator; import org.jooq.OrderField; import org.jooq.Param; +import org.jooq.QualifiedAsterisk; import org.jooq.Record; import org.jooq.Row; import org.jooq.SQLDialect; import org.jooq.Select; -import org.jooq.SelectField; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.SelectQuery; import org.jooq.Table; import org.jooq.TableField; @@ -204,44 +206,44 @@ final class SelectQueryImpl extends AbstractResultQuery imp - private final WithImpl with; - private final SelectFieldList select; - private Table into; - private String hint; - private String option; - private boolean distinct; - private QueryPartList> distinctOn; - private boolean forUpdate; - private QueryPartList> forUpdateOf; - private TableList forUpdateOfTables; - private ForUpdateMode forUpdateMode; - private int forUpdateWait; - private boolean forShare; + private final WithImpl with; + private final SelectFieldList select; + private Table into; + private String hint; + private String option; + private boolean distinct; + private QueryPartList distinctOn; + private boolean forUpdate; + private QueryPartList> forUpdateOf; + private TableList forUpdateOfTables; + private ForUpdateMode forUpdateMode; + private int forUpdateWait; + private boolean forShare; - private final TableList from; - private final ConditionProviderImpl condition; - private final ConditionProviderImpl connectBy; - private boolean connectByNoCycle; - private final ConditionProviderImpl connectByStartWith; - private boolean grouping; - private QueryPartList groupBy; - private final ConditionProviderImpl having; - private WindowList window; - private final SortFieldList orderBy; - private boolean orderBySiblings; - private final QueryPartList> seek; - private boolean seekBefore; - private final Limit limit; - private final List unionOp; - private final List>> union; - private final SortFieldList unionOrderBy; - private boolean unionOrderBySiblings; // [#3579] TODO - private final QueryPartList> unionSeek; - private boolean unionSeekBefore; // [#3579] TODO - private final Limit unionLimit; + private final TableList from; + private final ConditionProviderImpl condition; + private final ConditionProviderImpl connectBy; + private boolean connectByNoCycle; + private final ConditionProviderImpl connectByStartWith; + private boolean grouping; + private QueryPartList groupBy; + private final ConditionProviderImpl having; + private WindowList window; + private final SortFieldList orderBy; + private boolean orderBySiblings; + private final QueryPartList> seek; + private boolean seekBefore; + private final Limit limit; + private final List unionOp; + private final List>> union; + private final SortFieldList unionOrderBy; + private boolean unionOrderBySiblings; // [#3579] TODO + private final QueryPartList> unionSeek; + private boolean unionSeekBefore; // [#3579] TODO + private final Limit unionLimit; SelectQueryImpl(Configuration configuration, WithImpl with) { this(configuration, with, null); @@ -260,7 +262,7 @@ final class SelectQueryImpl extends AbstractResultQuery imp this.with = with; this.distinct = distinct; - this.select = new SelectFieldList(); + this.select = new SelectFieldList(); this.from = new TableList(); this.condition = new ConditionProviderImpl(); this.connectBy = new ConditionProviderImpl(); @@ -861,7 +863,7 @@ final class SelectQueryImpl extends AbstractResultQuery imp ctx.visit(K_SELECT).sql(' ') .declareFields(true) - .visit(new SelectFieldList(unaliasedFields)) + .visit(new SelectFieldList>(unaliasedFields)) .declareFields(false) .formatSeparator() .visit(K_FROM).sql(" (") @@ -1116,9 +1118,9 @@ final class SelectQueryImpl extends AbstractResultQuery imp // non-ambiguous column names as ambiguous column names are not allowed in subqueries if (alternativeFields != null) { if (wrapQueryExpressionBodyInDerivedTable && originalFields.length < alternativeFields.length) - context.visit(new SelectFieldList(Arrays.copyOf(alternativeFields, alternativeFields.length - 1))); + context.visit(new SelectFieldList>(Arrays.copyOf(alternativeFields, alternativeFields.length - 1))); else - context.visit(new SelectFieldList(alternativeFields)); + context.visit(new SelectFieldList>(alternativeFields)); } // [#1905] H2 only knows arrays, no row value expressions. Subqueries @@ -1595,12 +1597,12 @@ final class SelectQueryImpl extends AbstractResultQuery imp } @Override - public final void addSelect(Collection> fields) { - getSelect0().addAll(Tools.fields(fields)); + public final void addSelect(Collection fields) { + getSelect0().addAll(fields); } @Override - public final void addSelect(SelectField... fields) { + public final void addSelect(SelectFieldOrAsterisk... fields) { addSelect(Arrays.asList(fields)); } @@ -1610,14 +1612,14 @@ final class SelectQueryImpl extends AbstractResultQuery imp } @Override - public final void addDistinctOn(SelectField... fields) { + public final void addDistinctOn(SelectFieldOrAsterisk... fields) { addDistinctOn(Arrays.asList(fields)); } @Override - public final void addDistinctOn(Collection> fields) { + public final void addDistinctOn(Collection fields) { if (distinctOn == null) - distinctOn = new QueryPartList>(); + distinctOn = new QueryPartList(); distinctOn.addAll(fields); } @@ -1750,46 +1752,52 @@ final class SelectQueryImpl extends AbstractResultQuery imp @Override public final List> getSelect() { - return getSelect1(); + List> result = new ArrayList>(); + + for (SelectFieldOrAsterisk f : getSelect1()) + if (f instanceof Field) + result.add((Field) f); + else if (f instanceof QualifiedAsterisk) + result.addAll(Arrays.asList(((QualifiedAsterisk) f).qualifier().fields())); + else if (f instanceof Asterisk) + result.addAll(resolveAsterisk(new QueryPartList>())); + + return result; } - final SelectFieldList getSelect0() { + final SelectFieldList getSelect0() { return select; } - final SelectFieldList getSelect1() { - if (getSelect0().isEmpty()) { - SelectFieldList result = new SelectFieldList(); - - // [#109] [#489]: SELECT * is only applied when at least one table - // from the table source is "unknown", i.e. not generated from a - // physical table. Otherwise, the fields are selected explicitly - if (knownTableSource()) { - for (TableLike table : getFrom()) { - for (Field field : table.asTable().fields()) { - result.add(field); - } - } - } - - // The default is SELECT 1, when projections and table sources are - // both empty - if (getFrom().isEmpty()) { - result.add(one()); - } - - return result; - } + final SelectFieldList getSelect1() { + if (getSelect0().isEmpty()) + return resolveAsterisk(new SelectFieldList()); return getSelect0(); } + private >> Q resolveAsterisk(Q result) { + + // [#109] [#489]: SELECT * is only applied when at least one table + // from the table source is "unknown", i.e. not generated from a + // physical table. Otherwise, the fields are selected explicitly + if (knownTableSource()) + for (TableLike table : getFrom()) + for (Field field : table.asTable().fields()) + result.add(field); + + // The default is SELECT 1, when projections and table sources are + // both empty + if (getFrom().isEmpty()) + result.add(one()); + + return result; + } + private final boolean knownTableSource() { - for (Table table : getFrom()) { - if (!knownTable(table)) { + for (Table table : getFrom()) + if (!knownTable(table)) return false; - } - } return true; } diff --git a/jOOQ/src/main/java/org/jooq/impl/Tools.java b/jOOQ/src/main/java/org/jooq/impl/Tools.java index d7f0561840..991e052f58 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Tools.java +++ b/jOOQ/src/main/java/org/jooq/impl/Tools.java @@ -218,7 +218,6 @@ import org.jooq.RowN; import org.jooq.SQLDialect; import org.jooq.Schema; import org.jooq.Select; -import org.jooq.SelectField; import org.jooq.SortField; import org.jooq.Table; import org.jooq.TableRecord; @@ -1468,51 +1467,19 @@ final class Tools { static final List> fields(Object[] values, DataType[] types) { List> result = new ArrayList>(); - if (values != null && types != null) { - for (int i = 0; i < values.length && i < types.length; i++) { + if (values != null && types != null) + for (int i = 0; i < values.length && i < types.length; i++) result.add(field(values[i], types[i])); - } - } return result; } - static final List> fields(Collection> fields) { - List> result = new ArrayList>(); - - if (fields != null) { - for (SelectField field : fields) { - result.add(DSL.field(field)); - } - } - - return result; - } - - static final List> fields(SelectField... fields) { - return fields == null ? fields(Collections.>emptyList()) : fields(Arrays.asList(fields)); - } - static final List> inline(T[] values) { List> result = new ArrayList>(); - if (values != null) { - for (T value : values) { + if (values != null) + for (T value : values) result.add(DSL.inline(value)); - } - } - - return result; - } - - /** - * Return a list of unqualified {@link Field}s. - */ - static final List> unqualify(List> fields) { - QueryPartList> result = new QueryPartList>(); - - for (Field field : fields) - result.add(DSL.field(name(field.getName()))); return result; } diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java index 3499399fd4..e5ff671a71 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/UpdateImpl.java @@ -104,6 +104,7 @@ import org.jooq.Row9; import org.jooq.RowN; import org.jooq.SQL; import org.jooq.Select; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.Table; import org.jooq.TableLike; import org.jooq.UpdateConditionStep; @@ -730,13 +731,13 @@ final class UpdateImpl } @Override - public final UpdateImpl returning(Field... f) { + public final UpdateImpl returning(SelectFieldOrAsterisk... f) { getDelegate().setReturning(f); return this; } @Override - public final UpdateImpl returning(Collection> f) { + public final UpdateImpl returning(Collection f) { getDelegate().setReturning(f); return this; } diff --git a/jOOQ/src/main/java/org/jooq/impl/WithImpl.java b/jOOQ/src/main/java/org/jooq/impl/WithImpl.java index d2c73cb5ef..a35d299bde 100644 --- a/jOOQ/src/main/java/org/jooq/impl/WithImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/WithImpl.java @@ -90,6 +90,7 @@ import org.jooq.Record9; import org.jooq.SQLDialect; import org.jooq.Select; import org.jooq.SelectField; +import org.jooq.SelectFieldOrAsterisk; import org.jooq.SelectSelectStep; import org.jooq.SelectWhereStep; import org.jooq.Table; @@ -514,12 +515,12 @@ implements } @Override - public final SelectSelectStep select(Collection> fields) { + public final SelectSelectStep select(Collection fields) { return new SelectImpl(configuration, this).select(fields); } @Override - public final SelectSelectStep select(SelectField... fields) { + public final SelectSelectStep select(SelectFieldOrAsterisk... fields) { return new SelectImpl(configuration, this).select(fields); } @@ -660,12 +661,12 @@ implements // [jooq-tools] END [select] @Override - public final SelectSelectStep selectDistinct(Collection> fields) { + public final SelectSelectStep selectDistinct(Collection fields) { return new SelectImpl(configuration, this, true).select(fields); } @Override - public final SelectSelectStep selectDistinct(SelectField... fields) { + public final SelectSelectStep selectDistinct(SelectFieldOrAsterisk... fields) { return new SelectImpl(configuration, this, true).select(fields); }