From f97c9d008d5d826f0e26bcbba768efa4fa89d116 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 9 Jan 2024 12:10:03 +0100 Subject: [PATCH] [#10] Add to-many path examples as well as join path correlation --- .../org/jooq/demo/java/Demo01Querying.java | 54 ++++++++++++++---- .../org/jooq/demo/kotlin/Demo01Querying.kt | 57 +++++++++++++++---- .../org/jooq/demo/skala/Demo01Querying.scala | 2 +- .../org/jooq/demo/java/Demo01Querying.java | 54 ++++++++++++++---- .../org/jooq/demo/kotlin/db/DefaultCatalog.kt | 6 +- .../kotlin/db/routines/GetCustomerBalance.kt | 14 ++--- .../demo/kotlin/db/routines/GroupConcat.kt | 8 +-- .../db/routines/InventoryHeldByCustomer.kt | 8 +-- .../kotlin/db/routines/InventoryInStock.kt | 8 +-- .../jooq/demo/kotlin/db/routines/LastDay.kt | 8 +-- .../demo/kotlin/db/routines/_GroupConcat.kt | 14 ++--- .../org/jooq/demo/kotlin/db/tables/Actor.kt | 8 +-- .../jooq/demo/kotlin/db/tables/ActorInfo.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Address.kt | 8 +-- .../jooq/demo/kotlin/db/tables/Category.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/City.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Country.kt | 8 +-- .../jooq/demo/kotlin/db/tables/Customer.kt | 8 +-- .../demo/kotlin/db/tables/CustomerList.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Film.kt | 8 +-- .../jooq/demo/kotlin/db/tables/FilmActor.kt | 8 +-- .../demo/kotlin/db/tables/FilmCategory.kt | 8 +-- .../jooq/demo/kotlin/db/tables/FilmList.kt | 8 +-- .../jooq/demo/kotlin/db/tables/Inventory.kt | 8 +-- .../jooq/demo/kotlin/db/tables/Language.kt | 8 +-- .../db/tables/NicerButSlowerFilmList.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Payment.kt | 8 +-- .../demo/kotlin/db/tables/PaymentP2007_01.kt | 8 +-- .../demo/kotlin/db/tables/PaymentP2007_02.kt | 8 +-- .../demo/kotlin/db/tables/PaymentP2007_03.kt | 8 +-- .../demo/kotlin/db/tables/PaymentP2007_04.kt | 8 +-- .../demo/kotlin/db/tables/PaymentP2007_05.kt | 8 +-- .../demo/kotlin/db/tables/PaymentP2007_06.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Rental.kt | 8 +-- .../kotlin/db/tables/SalesByFilmCategory.kt | 8 +-- .../demo/kotlin/db/tables/SalesByStore.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Staff.kt | 8 +-- .../jooq/demo/kotlin/db/tables/StaffList.kt | 8 +-- .../org/jooq/demo/kotlin/db/tables/Store.kt | 8 +-- .../org/jooq/demo/kotlin/Demo01Querying.kt | 57 +++++++++++++++---- .../org/jooq/demo/skala/Demo01Querying.scala | 2 +- sakila/postgres/V6__postgres-sakila-types.sql | 35 ++++++++++++ 42 files changed, 364 insertions(+), 187 deletions(-) create mode 100644 sakila/postgres/V6__postgres-sakila-types.sql diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java b/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java index 47cb836..8b8e3ed 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java @@ -1,6 +1,7 @@ package org.jooq.demo.java; import org.jooq.*; +import org.jooq.conf.RenderImplicitJoinType; import org.jooq.demo.AbstractDemo; import org.jooq.demo.java.db.tables.Actor; import org.jooq.demo.java.db.tables.FilmActor; @@ -185,7 +186,7 @@ public void typeSafetyAliasing() { } @Test - public void implicitJoins() { + public void implicitToOneJoins() { title("No need to spell out trivial to-one joins"); ctx.select( CUSTOMER.FIRST_NAME, @@ -197,6 +198,41 @@ public void implicitJoins() { .fetch(); } + @Test + public void implicitToManyJoins() { + title("No need to spell out to-many joins either. Either use explicit to-many joins..."); + ctx.select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + countDistinct(CUSTOMER.rental().inventory().FILM_ID).as("distinct film rentals")) + .from(CUSTOMER) + + // Add an explicit path join for the to-many path + .leftJoin(CUSTOMER.rental().inventory()) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch(); + + title("... or enable implicit to-many joins if you are OK with the 'interesting' semantics."); + ctx.configuration() + .deriveSettings(s -> s.withRenderImplicitJoinToManyType(RenderImplicitJoinType.LEFT_JOIN)) + .dsl() + .select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + + // Now, the to-many path can be implicitly joined. Beware that this may produce very unexpected + // cartesian products (just like any JOIN, of course), which may be hard to debug because of the + // implicitness! + countDistinct(CUSTOMER.rental().inventory().FILM_ID).as("distinct film rentals")) + .from(CUSTOMER) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch(); + } + // There's a bug here @Test(expected = Throwable.class) public void nestedRecords() { @@ -261,16 +297,14 @@ public void nestingToManyRelationships() { FILM.TITLE, multiset( select( - FILM_ACTOR.actor().FIRST_NAME, - FILM_ACTOR.actor().LAST_NAME) - .from(FILM_ACTOR) - .where(FILM_ACTOR.FILM_ID.eq(FILM.FILM_ID)) + FILM.actor().FIRST_NAME, + FILM.actor().LAST_NAME) + + // Implicit path correlation is very powerful! + // https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-path-correlation/ + .from(FILM.actor()) ), - multiset( - select(FILM_CATEGORY.category().NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID)) - ) + multiset(select(FILM.category().NAME).from(FILM.category())) ) .from(FILM) .orderBy(FILM.TITLE) diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt index 94cbb64..6529c83 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt @@ -2,6 +2,8 @@ package org.jooq.demo.kotlin import org.jooq.* import org.jooq.Records.mapping +import org.jooq.conf.RenderImplicitJoinType +import org.jooq.conf.Settings import org.jooq.demo.AbstractDemo import org.jooq.demo.kotlin.db.tables.references.* import org.jooq.impl.DSL.* @@ -183,7 +185,7 @@ class Demo01Querying : AbstractDemo() { } @Test - fun implicitJoins() { + fun implicitToOneJoins() { title("No need to spell out trivial to-one joins") ctx.select( CUSTOMER.FIRST_NAME, @@ -196,6 +198,43 @@ class Demo01Querying : AbstractDemo() { .fetch() } + @Test + fun implicitToManyJoins() { + title("No need to spell out to-many joins either. Either use explicit to-many joins...") + ctx.select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + countDistinct(CUSTOMER.rental().inventory().FILM_ID).`as`("distinct film rentals") + ) + .from(CUSTOMER) + + // Add an explicit path join for the to-many path + .leftJoin(CUSTOMER.rental().inventory()) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch() + + title("... or enable implicit to-many joins if you are OK with the 'interesting' semantics.") + ctx.configuration() + .deriveSettings { s -> s.withRenderImplicitJoinToManyType(RenderImplicitJoinType.LEFT_JOIN) } + .dsl() + .select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + + // Now, the to-many path can be implicitly joined. Beware that this may produce very unexpected + // cartesian products (just like any JOIN, of course), which may be hard to debug because of the + // implicitness! + countDistinct(CUSTOMER.rental().inventory().FILM_ID).`as`("distinct film rentals") + ) + .from(CUSTOMER) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch() + } + @Test fun nestedRecords() { title("Need all columns of those active records?") @@ -258,17 +297,15 @@ class Demo01Querying : AbstractDemo() { FILM.TITLE, multiset( select( - FILM_ACTOR.actor.FIRST_NAME, - FILM_ACTOR.actor.LAST_UPDATE + FILM.actor.FIRST_NAME, + FILM.actor.LAST_UPDATE ) - .from(FILM_ACTOR) - .where(FILM_ACTOR.FILM_ID.eq(FILM.FILM_ID)) + + // Implicit path correlation is very powerful! + // https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-path-correlation/ + .from(FILM.actor) ), - multiset( - select(FILM_CATEGORY.category().NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID)) - ) + multiset(select(FILM.category.NAME).from(FILM.category)) ) .from(FILM) .orderBy(FILM.TITLE) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala index e75e36e..8c26bd3 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala @@ -160,7 +160,7 @@ class Demo01Querying extends AbstractDemo { } @Test - def implicitJoins(): Unit = { + def implicitToOneJoins(): Unit = { title("No need to spell out trivial to-one joins") ctx.select( CUSTOMER.FIRST_NAME, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java b/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java index 47cb836..8b8e3ed 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo01Querying.java @@ -1,6 +1,7 @@ package org.jooq.demo.java; import org.jooq.*; +import org.jooq.conf.RenderImplicitJoinType; import org.jooq.demo.AbstractDemo; import org.jooq.demo.java.db.tables.Actor; import org.jooq.demo.java.db.tables.FilmActor; @@ -185,7 +186,7 @@ public void typeSafetyAliasing() { } @Test - public void implicitJoins() { + public void implicitToOneJoins() { title("No need to spell out trivial to-one joins"); ctx.select( CUSTOMER.FIRST_NAME, @@ -197,6 +198,41 @@ public void implicitJoins() { .fetch(); } + @Test + public void implicitToManyJoins() { + title("No need to spell out to-many joins either. Either use explicit to-many joins..."); + ctx.select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + countDistinct(CUSTOMER.rental().inventory().FILM_ID).as("distinct film rentals")) + .from(CUSTOMER) + + // Add an explicit path join for the to-many path + .leftJoin(CUSTOMER.rental().inventory()) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch(); + + title("... or enable implicit to-many joins if you are OK with the 'interesting' semantics."); + ctx.configuration() + .deriveSettings(s -> s.withRenderImplicitJoinToManyType(RenderImplicitJoinType.LEFT_JOIN)) + .dsl() + .select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + + // Now, the to-many path can be implicitly joined. Beware that this may produce very unexpected + // cartesian products (just like any JOIN, of course), which may be hard to debug because of the + // implicitness! + countDistinct(CUSTOMER.rental().inventory().FILM_ID).as("distinct film rentals")) + .from(CUSTOMER) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch(); + } + // There's a bug here @Test(expected = Throwable.class) public void nestedRecords() { @@ -261,16 +297,14 @@ public void nestingToManyRelationships() { FILM.TITLE, multiset( select( - FILM_ACTOR.actor().FIRST_NAME, - FILM_ACTOR.actor().LAST_NAME) - .from(FILM_ACTOR) - .where(FILM_ACTOR.FILM_ID.eq(FILM.FILM_ID)) + FILM.actor().FIRST_NAME, + FILM.actor().LAST_NAME) + + // Implicit path correlation is very powerful! + // https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-path-correlation/ + .from(FILM.actor()) ), - multiset( - select(FILM_CATEGORY.category().NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID)) - ) + multiset(select(FILM.category().NAME).from(FILM.category())) ) .from(FILM) .orderBy(FILM.TITLE) diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt index e45347a..5a04730 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt @@ -34,10 +34,10 @@ open class DefaultCatalog : CatalogImpl("") { ) /** - * A reference to the 3.19 minor release of the code generator. If this + * A reference to the 3.20 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.19. You can turn off the generation of this reference + * release, namely: 3.20. You can turn off the generation of this reference * by specifying /configuration/generator/generate/jooqVersionReference */ - private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19 + private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_20 } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GetCustomerBalance.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GetCustomerBalance.kt index f71559e..dc8f3ce 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GetCustomerBalance.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GetCustomerBalance.kt @@ -40,34 +40,34 @@ open class GetCustomerBalance : AbstractRoutine("get_customer_balanc } init { - returnParameter = RETURN_VALUE - addInParameter(P_CUSTOMER_ID) - addInParameter(P_EFFECTIVE_DATE) + returnParameter = GetCustomerBalance.RETURN_VALUE + addInParameter(GetCustomerBalance.P_CUSTOMER_ID) + addInParameter(GetCustomerBalance.P_EFFECTIVE_DATE) } /** * Set the p_customer_id parameter IN value to the routine */ - fun setPCustomerId(value: Long?): Unit = setValue(P_CUSTOMER_ID, value) + fun setPCustomerId(value: Long?): Unit = setValue(GetCustomerBalance.P_CUSTOMER_ID, value) /** * Set the p_customer_id parameter to the function to be used * with a {@link org.jooq.Select} statement */ fun setPCustomerId(field: Field): Unit { - setField(P_CUSTOMER_ID, field) + setField(GetCustomerBalance.P_CUSTOMER_ID, field) } /** * Set the p_effective_date parameter IN value to the routine */ - fun setPEffectiveDate(value: LocalDateTime?): Unit = setValue(P_EFFECTIVE_DATE, value) + fun setPEffectiveDate(value: LocalDateTime?): Unit = setValue(GetCustomerBalance.P_EFFECTIVE_DATE, value) /** * Set the p_effective_date parameter to the function to be * used with a {@link org.jooq.Select} statement */ fun setPEffectiveDate(field: Field): Unit { - setField(P_EFFECTIVE_DATE, field) + setField(GetCustomerBalance.P_EFFECTIVE_DATE, field) } } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GroupConcat.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GroupConcat.kt index a08ab15..3ba8734 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GroupConcat.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/GroupConcat.kt @@ -31,20 +31,20 @@ open class GroupConcat : AbstractRoutine("group_concat", Public.PUBLIC, } init { - returnParameter = RETURN_VALUE - addInParameter(_1) + returnParameter = GroupConcat.RETURN_VALUE + addInParameter(GroupConcat._1) } /** * Set the _1 parameter IN value to the routine */ - fun set__1(value: String?): Unit = setValue(_1, value) + fun set__1(value: String?): Unit = setValue(GroupConcat._1, value) /** * Set the _1 parameter to the function to be used with a * {@link org.jooq.Select} statement */ fun set__1(field: Field): Unit { - setField(_1, field) + setField(GroupConcat._1, field) } } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryHeldByCustomer.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryHeldByCustomer.kt index ee7cf6d..7f244e7 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryHeldByCustomer.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryHeldByCustomer.kt @@ -33,20 +33,20 @@ open class InventoryHeldByCustomer : AbstractRoutine("inventory_held_by_cus } init { - returnParameter = RETURN_VALUE - addInParameter(P_INVENTORY_ID) + returnParameter = InventoryHeldByCustomer.RETURN_VALUE + addInParameter(InventoryHeldByCustomer.P_INVENTORY_ID) } /** * Set the p_inventory_id parameter IN value to the routine */ - fun setPInventoryId(value: Long?): Unit = setValue(P_INVENTORY_ID, value) + fun setPInventoryId(value: Long?): Unit = setValue(InventoryHeldByCustomer.P_INVENTORY_ID, value) /** * Set the p_inventory_id parameter to the function to be used * with a {@link org.jooq.Select} statement */ fun setPInventoryId(field: Field): Unit { - setField(P_INVENTORY_ID, field) + setField(InventoryHeldByCustomer.P_INVENTORY_ID, field) } } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryInStock.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryInStock.kt index 8b98bab..7687318 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryInStock.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/InventoryInStock.kt @@ -31,20 +31,20 @@ open class InventoryInStock : AbstractRoutine("inventory_in_stock", Pub } init { - returnParameter = RETURN_VALUE - addInParameter(P_INVENTORY_ID) + returnParameter = InventoryInStock.RETURN_VALUE + addInParameter(InventoryInStock.P_INVENTORY_ID) } /** * Set the p_inventory_id parameter IN value to the routine */ - fun setPInventoryId(value: Long?): Unit = setValue(P_INVENTORY_ID, value) + fun setPInventoryId(value: Long?): Unit = setValue(InventoryInStock.P_INVENTORY_ID, value) /** * Set the p_inventory_id parameter to the function to be used * with a {@link org.jooq.Select} statement */ fun setPInventoryId(field: Field): Unit { - setField(P_INVENTORY_ID, field) + setField(InventoryInStock.P_INVENTORY_ID, field) } } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/LastDay.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/LastDay.kt index 75c270a..98b208f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/LastDay.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/LastDay.kt @@ -34,20 +34,20 @@ open class LastDay : AbstractRoutine("last_day", Public.PUBLIC, SQLDa } init { - returnParameter = RETURN_VALUE - addInParameter(_1) + returnParameter = LastDay.RETURN_VALUE + addInParameter(LastDay._1) } /** * Set the _1 parameter IN value to the routine */ - fun set__1(value: LocalDateTime?): Unit = setValue(_1, value) + fun set__1(value: LocalDateTime?): Unit = setValue(LastDay._1, value) /** * Set the _1 parameter to the function to be used with a * {@link org.jooq.Select} statement */ fun set__1(field: Field): Unit { - setField(_1, field) + setField(LastDay._1, field) } } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/_GroupConcat.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/_GroupConcat.kt index 1b39ec4..a025df9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/_GroupConcat.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/routines/_GroupConcat.kt @@ -36,34 +36,34 @@ open class _GroupConcat : AbstractRoutine("_group_concat", Public.PUBLIC } init { - returnParameter = RETURN_VALUE - addInParameter(_1) - addInParameter(_2) + returnParameter = _GroupConcat.RETURN_VALUE + addInParameter(_GroupConcat._1) + addInParameter(_GroupConcat._2) } /** * Set the _1 parameter IN value to the routine */ - fun set__1(value: String?): Unit = setValue(_1, value) + fun set__1(value: String?): Unit = setValue(_GroupConcat._1, value) /** * Set the _1 parameter to the function to be used with a * {@link org.jooq.Select} statement */ fun set__1(field: Field): Unit { - setField(_1, field) + setField(_GroupConcat._1, field) } /** * Set the _2 parameter IN value to the routine */ - fun set__2(value: String?): Unit = setValue(_2, value) + fun set__2(value: String?): Unit = setValue(_GroupConcat._2, value) /** * Set the _2 parameter to the function to be used with a * {@link org.jooq.Select} statement */ fun set__2(field: Field): Unit { - setField(_2, field) + setField(_GroupConcat._2, field) } } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt index 87f90e8..9adb359 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt @@ -102,7 +102,7 @@ open class Actor( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.actor table reference @@ -181,7 +181,7 @@ open class Actor( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Actor = Actor(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Actor = Actor(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -191,12 +191,12 @@ open class Actor( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Actor = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Actor = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Actor = where(DSL.condition(condition)) + override fun where(condition: Field?): Actor = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt index 947eaee..4b21fd1 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt @@ -102,7 +102,7 @@ open class ActorInfo( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.actor_info table reference @@ -141,7 +141,7 @@ open class ActorInfo( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): ActorInfo = ActorInfo(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): ActorInfo = ActorInfo(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -151,12 +151,12 @@ open class ActorInfo( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): ActorInfo = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): ActorInfo = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): ActorInfo = where(DSL.condition(condition)) + override fun where(condition: Field?): ActorInfo = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt index 0c50e63..e1639d5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt @@ -125,7 +125,7 @@ open class Address( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.address table reference @@ -242,7 +242,7 @@ open class Address( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Address = Address(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Address = Address(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -252,12 +252,12 @@ open class Address( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Address = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Address = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Address = where(DSL.condition(condition)) + override fun where(condition: Field?): Address = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt index c8777c7..387bbec 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt @@ -92,7 +92,7 @@ open class Category( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.category table reference @@ -169,7 +169,7 @@ open class Category( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Category = Category(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Category = Category(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -179,12 +179,12 @@ open class Category( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Category = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Category = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Category = where(DSL.condition(condition)) + override fun where(condition: Field?): Category = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt index 47a4982..8fabf4c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt @@ -101,7 +101,7 @@ open class City( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.city table reference @@ -188,7 +188,7 @@ open class City( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): City = City(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): City = City(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -198,12 +198,12 @@ open class City( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): City = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): City = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): City = where(DSL.condition(condition)) + override fun where(condition: Field?): City = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt index 70696ff..d01cf20 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt @@ -91,7 +91,7 @@ open class Country( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.country table reference @@ -160,7 +160,7 @@ open class Country( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Country = Country(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Country = Country(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -170,12 +170,12 @@ open class Country( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Country = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Country = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Country = where(DSL.condition(condition)) + override fun where(condition: Field?): Country = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt index 53a521f..2eb7594 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt @@ -150,7 +150,7 @@ open class Customer( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.customer table reference @@ -364,7 +364,7 @@ open class Customer( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Customer = Customer(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Customer = Customer(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -374,12 +374,12 @@ open class Customer( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Customer = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Customer = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Customer = where(DSL.condition(condition)) + override fun where(condition: Field?): Customer = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt index a818b7f..1bcfe44 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt @@ -129,7 +129,7 @@ open class CustomerList( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.customer_list table reference @@ -168,7 +168,7 @@ open class CustomerList( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): CustomerList = CustomerList(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): CustomerList = CustomerList(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -178,12 +178,12 @@ open class CustomerList( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): CustomerList = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): CustomerList = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): CustomerList = where(DSL.condition(condition)) + override fun where(condition: Field?): CustomerList = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt index f28c1b9..60703a3 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt @@ -164,7 +164,7 @@ open class Film( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film table reference @@ -315,7 +315,7 @@ open class Film( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Film = Film(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Film = Film(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -325,12 +325,12 @@ open class Film( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Film = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Film = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Film = where(DSL.condition(condition)) + override fun where(condition: Field?): Film = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt index 3d788b0..90073a9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt @@ -95,7 +95,7 @@ open class FilmActor( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_actor table reference @@ -180,7 +180,7 @@ open class FilmActor( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): FilmActor = FilmActor(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): FilmActor = FilmActor(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -190,12 +190,12 @@ open class FilmActor( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): FilmActor = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): FilmActor = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): FilmActor = where(DSL.condition(condition)) + override fun where(condition: Field?): FilmActor = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt index 022b096..fdda434 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt @@ -93,7 +93,7 @@ open class FilmCategory( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_category table reference @@ -177,7 +177,7 @@ open class FilmCategory( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): FilmCategory = FilmCategory(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): FilmCategory = FilmCategory(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -187,12 +187,12 @@ open class FilmCategory( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): FilmCategory = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): FilmCategory = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): FilmCategory = where(DSL.condition(condition)) + override fun where(condition: Field?): FilmCategory = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt index 29ab2a2..1fe911b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt @@ -125,7 +125,7 @@ open class FilmList( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_list table reference @@ -164,7 +164,7 @@ open class FilmList( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): FilmList = FilmList(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): FilmList = FilmList(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -174,12 +174,12 @@ open class FilmList( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): FilmList = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): FilmList = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): FilmList = where(DSL.condition(condition)) + override fun where(condition: Field?): FilmList = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt index e2e1d39..ca3c54e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt @@ -103,7 +103,7 @@ open class Inventory( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.inventory table reference @@ -205,7 +205,7 @@ open class Inventory( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Inventory = Inventory(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Inventory = Inventory(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -215,12 +215,12 @@ open class Inventory( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Inventory = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Inventory = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Inventory = where(DSL.condition(condition)) + override fun where(condition: Field?): Inventory = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt index b5f29b5..4710463 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt @@ -92,7 +92,7 @@ open class Language( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.language table reference @@ -178,7 +178,7 @@ open class Language( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Language = Language(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Language = Language(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -188,12 +188,12 @@ open class Language( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Language = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Language = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Language = where(DSL.condition(condition)) + override fun where(condition: Field?): Language = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt index da560a7..bf37d5b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt @@ -126,7 +126,7 @@ open class NicerButSlowerFilmList( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.nicer_but_slower_film_list table @@ -167,7 +167,7 @@ open class NicerButSlowerFilmList( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): NicerButSlowerFilmList = NicerButSlowerFilmList(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): NicerButSlowerFilmList = NicerButSlowerFilmList(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -177,12 +177,12 @@ open class NicerButSlowerFilmList( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): NicerButSlowerFilmList = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): NicerButSlowerFilmList = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): NicerButSlowerFilmList = where(DSL.condition(condition)) + override fun where(condition: Field?): NicerButSlowerFilmList = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt index 2188606..a034b93 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt @@ -115,7 +115,7 @@ open class Payment( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment table reference @@ -216,7 +216,7 @@ open class Payment( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Payment = Payment(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Payment = Payment(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -226,12 +226,12 @@ open class Payment( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Payment = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Payment = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Payment = where(DSL.condition(condition)) + override fun where(condition: Field?): Payment = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt index 7e9f17f..4f56fd5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt @@ -114,7 +114,7 @@ open class PaymentP2007_01( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_01 table reference @@ -217,7 +217,7 @@ open class PaymentP2007_01( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): PaymentP2007_01 = PaymentP2007_01(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): PaymentP2007_01 = PaymentP2007_01(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -227,12 +227,12 @@ open class PaymentP2007_01( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): PaymentP2007_01 = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): PaymentP2007_01 = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): PaymentP2007_01 = where(DSL.condition(condition)) + override fun where(condition: Field?): PaymentP2007_01 = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt index 93fac7f..c7a532e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt @@ -114,7 +114,7 @@ open class PaymentP2007_02( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_02 table reference @@ -217,7 +217,7 @@ open class PaymentP2007_02( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): PaymentP2007_02 = PaymentP2007_02(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): PaymentP2007_02 = PaymentP2007_02(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -227,12 +227,12 @@ open class PaymentP2007_02( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): PaymentP2007_02 = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): PaymentP2007_02 = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): PaymentP2007_02 = where(DSL.condition(condition)) + override fun where(condition: Field?): PaymentP2007_02 = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt index a527e24..4b53766 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt @@ -114,7 +114,7 @@ open class PaymentP2007_03( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_03 table reference @@ -217,7 +217,7 @@ open class PaymentP2007_03( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): PaymentP2007_03 = PaymentP2007_03(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): PaymentP2007_03 = PaymentP2007_03(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -227,12 +227,12 @@ open class PaymentP2007_03( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): PaymentP2007_03 = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): PaymentP2007_03 = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): PaymentP2007_03 = where(DSL.condition(condition)) + override fun where(condition: Field?): PaymentP2007_03 = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt index a9a7ade..e49f561 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt @@ -114,7 +114,7 @@ open class PaymentP2007_04( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_04 table reference @@ -217,7 +217,7 @@ open class PaymentP2007_04( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): PaymentP2007_04 = PaymentP2007_04(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): PaymentP2007_04 = PaymentP2007_04(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -227,12 +227,12 @@ open class PaymentP2007_04( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): PaymentP2007_04 = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): PaymentP2007_04 = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): PaymentP2007_04 = where(DSL.condition(condition)) + override fun where(condition: Field?): PaymentP2007_04 = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt index c6fa36f..9a0f669 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt @@ -114,7 +114,7 @@ open class PaymentP2007_05( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_05 table reference @@ -217,7 +217,7 @@ open class PaymentP2007_05( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): PaymentP2007_05 = PaymentP2007_05(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): PaymentP2007_05 = PaymentP2007_05(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -227,12 +227,12 @@ open class PaymentP2007_05( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): PaymentP2007_05 = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): PaymentP2007_05 = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): PaymentP2007_05 = where(DSL.condition(condition)) + override fun where(condition: Field?): PaymentP2007_05 = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt index ae02856..422a9fb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt @@ -114,7 +114,7 @@ open class PaymentP2007_06( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_06 table reference @@ -217,7 +217,7 @@ open class PaymentP2007_06( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): PaymentP2007_06 = PaymentP2007_06(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): PaymentP2007_06 = PaymentP2007_06(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -227,12 +227,12 @@ open class PaymentP2007_06( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): PaymentP2007_06 = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): PaymentP2007_06 = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): PaymentP2007_06 = where(DSL.condition(condition)) + override fun where(condition: Field?): PaymentP2007_06 = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt index c79c633..1d888d0 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt @@ -133,7 +133,7 @@ open class Rental( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.rental table reference @@ -346,7 +346,7 @@ open class Rental( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Rental = Rental(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Rental = Rental(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -356,12 +356,12 @@ open class Rental( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Rental = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Rental = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Rental = where(DSL.condition(condition)) + override fun where(condition: Field?): Rental = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt index 5574e0e..22945dd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt @@ -90,7 +90,7 @@ open class SalesByFilmCategory( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.sales_by_film_category table @@ -131,7 +131,7 @@ open class SalesByFilmCategory( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): SalesByFilmCategory = SalesByFilmCategory(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): SalesByFilmCategory = SalesByFilmCategory(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -141,12 +141,12 @@ open class SalesByFilmCategory( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): SalesByFilmCategory = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): SalesByFilmCategory = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): SalesByFilmCategory = where(DSL.condition(condition)) + override fun where(condition: Field?): SalesByFilmCategory = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt index c9dc23d..4800803 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt @@ -98,7 +98,7 @@ open class SalesByStore( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.sales_by_store table reference @@ -137,7 +137,7 @@ open class SalesByStore( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): SalesByStore = SalesByStore(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): SalesByStore = SalesByStore(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -147,12 +147,12 @@ open class SalesByStore( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): SalesByStore = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): SalesByStore = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): SalesByStore = where(DSL.condition(condition)) + override fun where(condition: Field?): SalesByStore = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt index 922e2d9..0c0b08a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt @@ -160,7 +160,7 @@ open class Staff( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.staff table reference @@ -373,7 +373,7 @@ open class Staff( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Staff = Staff(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Staff = Staff(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -383,12 +383,12 @@ open class Staff( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Staff = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Staff = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Staff = where(DSL.condition(condition)) + override fun where(condition: Field?): Staff = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt index e48571f..68cf699 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt @@ -120,7 +120,7 @@ open class StaffList( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.staff_list table reference @@ -159,7 +159,7 @@ open class StaffList( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): StaffList = StaffList(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): StaffList = StaffList(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -169,12 +169,12 @@ open class StaffList( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): StaffList = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): StaffList = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): StaffList = where(DSL.condition(condition)) + override fun where(condition: Field?): StaffList = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt index 0db02c6..fb32272 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt @@ -110,7 +110,7 @@ open class Store( private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, null, null) private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) - private constructor(alias: Name, aliased: Table?, where: Condition): this(alias, null, null, null, aliased, null, where) + private constructor(alias: Name, aliased: Table?, where: Condition?): this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.store table reference @@ -228,7 +228,7 @@ open class Store( /** * Create an inline derived table from this table */ - override fun where(condition: Condition): Store = Store(qualifiedName, if (aliased()) this else null, condition) + override fun where(condition: Condition?): Store = Store(qualifiedName, if (aliased()) this else null, condition) /** * Create an inline derived table from this table @@ -238,12 +238,12 @@ open class Store( /** * Create an inline derived table from this table */ - override fun where(vararg conditions: Condition): Store = where(DSL.and(*conditions)) + override fun where(vararg conditions: Condition?): Store = where(DSL.and(*conditions)) /** * Create an inline derived table from this table */ - override fun where(condition: Field): Store = where(DSL.condition(condition)) + override fun where(condition: Field?): Store = where(DSL.condition(condition)) /** * Create an inline derived table from this table diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt index 94cbb64..6529c83 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo01Querying.kt @@ -2,6 +2,8 @@ package org.jooq.demo.kotlin import org.jooq.* import org.jooq.Records.mapping +import org.jooq.conf.RenderImplicitJoinType +import org.jooq.conf.Settings import org.jooq.demo.AbstractDemo import org.jooq.demo.kotlin.db.tables.references.* import org.jooq.impl.DSL.* @@ -183,7 +185,7 @@ class Demo01Querying : AbstractDemo() { } @Test - fun implicitJoins() { + fun implicitToOneJoins() { title("No need to spell out trivial to-one joins") ctx.select( CUSTOMER.FIRST_NAME, @@ -196,6 +198,43 @@ class Demo01Querying : AbstractDemo() { .fetch() } + @Test + fun implicitToManyJoins() { + title("No need to spell out to-many joins either. Either use explicit to-many joins...") + ctx.select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + countDistinct(CUSTOMER.rental().inventory().FILM_ID).`as`("distinct film rentals") + ) + .from(CUSTOMER) + + // Add an explicit path join for the to-many path + .leftJoin(CUSTOMER.rental().inventory()) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch() + + title("... or enable implicit to-many joins if you are OK with the 'interesting' semantics.") + ctx.configuration() + .deriveSettings { s -> s.withRenderImplicitJoinToManyType(RenderImplicitJoinType.LEFT_JOIN) } + .dsl() + .select( + CUSTOMER.FIRST_NAME, + CUSTOMER.LAST_NAME, + + // Now, the to-many path can be implicitly joined. Beware that this may produce very unexpected + // cartesian products (just like any JOIN, of course), which may be hard to debug because of the + // implicitness! + countDistinct(CUSTOMER.rental().inventory().FILM_ID).`as`("distinct film rentals") + ) + .from(CUSTOMER) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc()) + .limit(5) + .fetch() + } + @Test fun nestedRecords() { title("Need all columns of those active records?") @@ -258,17 +297,15 @@ class Demo01Querying : AbstractDemo() { FILM.TITLE, multiset( select( - FILM_ACTOR.actor.FIRST_NAME, - FILM_ACTOR.actor.LAST_UPDATE + FILM.actor.FIRST_NAME, + FILM.actor.LAST_UPDATE ) - .from(FILM_ACTOR) - .where(FILM_ACTOR.FILM_ID.eq(FILM.FILM_ID)) + + // Implicit path correlation is very powerful! + // https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-path-correlation/ + .from(FILM.actor) ), - multiset( - select(FILM_CATEGORY.category().NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID)) - ) + multiset(select(FILM.category.NAME).from(FILM.category)) ) .from(FILM) .orderBy(FILM.TITLE) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala index e75e36e..8c26bd3 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo01Querying.scala @@ -160,7 +160,7 @@ class Demo01Querying extends AbstractDemo { } @Test - def implicitJoins(): Unit = { + def implicitToOneJoins(): Unit = { title("No need to spell out trivial to-one joins") ctx.select( CUSTOMER.FIRST_NAME, diff --git a/sakila/postgres/V6__postgres-sakila-types.sql b/sakila/postgres/V6__postgres-sakila-types.sql new file mode 100644 index 0000000..1755565 --- /dev/null +++ b/sakila/postgres/V6__postgres-sakila-types.sql @@ -0,0 +1,35 @@ +-- This script contains a few jOOQ demo specific tables, that aren't otherwise part of the Sakila database. + +/* + +-- Cannot activate this yet due to https://github.com/jOOQ/jOOQ/issues/16039 +SET search_path = public, pg_catalog; +SET default_tablespace = ''; +SET default_with_oids = false; + + +CREATE TYPE monetary_amount AS (amount numeric, currency CHAR(3)); + + +CREATE SEQUENCE transaction_transaction_id_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + +ALTER TABLE public.transaction_transaction_id_seq OWNER TO postgres; + +CREATE TABLE transaction ( + transaction_id bigint DEFAULT nextval('transaction_transaction_id_seq'::regclass) NOT NULL, + value_date timestamp without time zone NOT NULL, + amount monetary_amount NOT NULL, + last_update timestamp without time zone DEFAULT now() NOT NULL, + + CONSTRAINT transaction_pkey PRIMARY KEY (transaction_id) +); + +INSERT INTO transaction (value_date, amount) +VALUES + (TIMESTAMP '2000-01-01', ROW (10.0, 'USD')::monetary_amount), + (TIMESTAMP '2000-01-02', ROW (15.0, 'EUR')::monetary_amount); +*/ \ No newline at end of file