From a6c71f073e72231ec7f7bad2979ec161417d8fd2 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 15 Jan 2024 09:37:01 +0100 Subject: [PATCH] [#10] [jOOQ/jOOQ#16037] Generate to-many paths also in Scala demo --- jOOQ-demo-oss/jOOQ-demo-scala/pom.xml | 5 - .../org/jooq/demo/skala/db/tables/Actor.scala | 14 +++ .../jooq/demo/skala/db/tables/Address.scala | 19 ++++ .../jooq/demo/skala/db/tables/Category.scala | 14 +++ .../org/jooq/demo/skala/db/tables/City.scala | 6 ++ .../jooq/demo/skala/db/tables/Country.scala | 6 ++ .../jooq/demo/skala/db/tables/Customer.scala | 54 +++++++++++ .../org/jooq/demo/skala/db/tables/Film.scala | 35 +++++++ .../jooq/demo/skala/db/tables/FilmActor.scala | 9 ++ .../demo/skala/db/tables/FilmCategory.scala | 9 ++ .../jooq/demo/skala/db/tables/Inventory.scala | 6 ++ .../jooq/demo/skala/db/tables/Language.scala | 13 +++ .../jooq/demo/skala/db/tables/Payment.scala | 9 ++ .../skala/db/tables/PaymentP2007_01.scala | 8 ++ .../skala/db/tables/PaymentP2007_02.scala | 8 ++ .../skala/db/tables/PaymentP2007_03.scala | 8 ++ .../skala/db/tables/PaymentP2007_04.scala | 8 ++ .../skala/db/tables/PaymentP2007_05.scala | 8 ++ .../skala/db/tables/PaymentP2007_06.scala | 8 ++ .../jooq/demo/skala/db/tables/Rental.scala | 48 ++++++++++ .../org/jooq/demo/skala/db/tables/Staff.scala | 54 +++++++++++ .../org/jooq/demo/skala/db/tables/Store.scala | 14 +++ .../org/jooq/demo/skala/Demo01Querying.scala | 96 ++++++++++++++++--- .../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 +- jOOQ-demo-pro/jOOQ-demo-scala/pom.xml | 5 - .../org/jooq/demo/skala/db/tables/Actor.scala | 14 +++ .../jooq/demo/skala/db/tables/Address.scala | 19 ++++ .../jooq/demo/skala/db/tables/Category.scala | 14 +++ .../org/jooq/demo/skala/db/tables/City.scala | 6 ++ .../jooq/demo/skala/db/tables/Country.scala | 6 ++ .../jooq/demo/skala/db/tables/Customer.scala | 54 +++++++++++ .../org/jooq/demo/skala/db/tables/Film.scala | 35 +++++++ .../jooq/demo/skala/db/tables/FilmActor.scala | 9 ++ .../demo/skala/db/tables/FilmCategory.scala | 9 ++ .../jooq/demo/skala/db/tables/Inventory.scala | 6 ++ .../jooq/demo/skala/db/tables/Language.scala | 13 +++ .../jooq/demo/skala/db/tables/Payment.scala | 9 ++ .../skala/db/tables/PaymentP2007_01.scala | 8 ++ .../skala/db/tables/PaymentP2007_02.scala | 8 ++ .../skala/db/tables/PaymentP2007_03.scala | 8 ++ .../skala/db/tables/PaymentP2007_04.scala | 8 ++ .../skala/db/tables/PaymentP2007_05.scala | 8 ++ .../skala/db/tables/PaymentP2007_06.scala | 8 ++ .../jooq/demo/skala/db/tables/Rental.scala | 48 ++++++++++ .../org/jooq/demo/skala/db/tables/Staff.scala | 54 +++++++++++ .../org/jooq/demo/skala/db/tables/Store.scala | 14 +++ .../org/jooq/demo/skala/Demo01Querying.scala | 96 ++++++++++++++++--- 80 files changed, 1022 insertions(+), 180 deletions(-) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml b/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml index 6a2b206..3fc02d5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml +++ b/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml @@ -134,11 +134,6 @@ https://www.jooq.org/doc/latest/manual/code-generation/codegen-version-control/ --> src/main/scala - - - - false - diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala index 0a6cb3e..5e24489 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala @@ -34,6 +34,8 @@ import org.jooq.UniqueKey import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Film.FilmPath +import org.jooq.demo.skala.db.tables.FilmActor.FilmActorPath import org.jooq.demo.skala.db.tables.records.ActorRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -133,6 +135,18 @@ extends TableImpl[ActorRecord]( override def getIdentity: Identity[ActorRecord, Long] = super.getIdentity.asInstanceOf[ Identity[ActorRecord, Long] ] override def getPrimaryKey: UniqueKey[ActorRecord] = Keys.ACTOR_PKEY + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + lazy val filmActor: FilmActorPath = { new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + def film: FilmPath = filmActor.film override def as(alias: String): Actor = new Actor(DSL.name(alias), this) override def as(alias: Name): Actor = new Actor(alias, this) override def as(alias: Table[_]): Actor = new Actor(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala index 399f614..6206876 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala @@ -35,6 +35,9 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.City.CityPath +import org.jooq.demo.skala.db.tables.Customer.CustomerPath +import org.jooq.demo.skala.db.tables.Staff.StaffPath +import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.AddressRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -161,6 +164,22 @@ extends TableImpl[AddressRecord]( * Get the implicit join path to the public.city table. */ lazy val city: CityPath = { new CityPath(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + lazy val customer: CustomerPath = { new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.staff table + */ + lazy val staff: StaffPath = { new StaffPath(this, null, Keys.STAFF__STAFF_ADDRESS_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.store table + */ + lazy val store: StorePath = { new StorePath(this, null, Keys.STORE__STORE_ADDRESS_ID_FKEY.getInverseKey()) } override def as(alias: String): Address = new Address(DSL.name(alias), this) override def as(alias: Name): Address = new Address(alias, this) override def as(alias: Table[_]): Address = new Address(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala index c2b6586..11d951d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala @@ -30,6 +30,8 @@ import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Film.FilmPath +import org.jooq.demo.skala.db.tables.FilmCategory.FilmCategoryPath import org.jooq.demo.skala.db.tables.records.CategoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -122,6 +124,18 @@ extends TableImpl[CategoryRecord]( override def getIdentity: Identity[CategoryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CategoryRecord, Long] ] override def getPrimaryKey: UniqueKey[CategoryRecord] = Keys.CATEGORY_PKEY + + /** + * Get the implicit to-many join path to the public.film_category + * table + */ + lazy val filmCategory: FilmCategoryPath = { new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + def film: FilmPath = filmCategory.film override def as(alias: String): Category = new Category(DSL.name(alias), this) override def as(alias: Name): Category = new Category(alias, this) override def as(alias: Table[_]): Category = new Category(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala index b103bfb..f919afb 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala @@ -34,6 +34,7 @@ import org.jooq.UniqueKey import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Address.AddressPath import org.jooq.demo.skala.db.tables.Country.CountryPath import org.jooq.demo.skala.db.tables.records.CityRecord import org.jooq.impl.DSL @@ -141,6 +142,11 @@ extends TableImpl[CityRecord]( * Get the implicit join path to the public.country table. */ lazy val country: CountryPath = { new CountryPath(this, Keys.CITY__CITY_COUNTRY_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.address table + */ + lazy val address: AddressPath = { new AddressPath(this, null, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY.getInverseKey()) } override def as(alias: String): City = new City(DSL.name(alias), this) override def as(alias: Name): City = new City(alias, this) override def as(alias: Table[_]): City = new City(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala index 28a942f..c12b361 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala @@ -30,6 +30,7 @@ import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.City.CityPath import org.jooq.demo.skala.db.tables.records.CountryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -122,6 +123,11 @@ extends TableImpl[CountryRecord]( override def getIdentity: Identity[CountryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CountryRecord, Long] ] override def getPrimaryKey: UniqueKey[CountryRecord] = Keys.COUNTRY_PKEY + + /** + * Get the implicit to-many join path to the public.city table + */ + lazy val city: CityPath = { new CityPath(this, null, Keys.CITY__CITY_COUNTRY_ID_FKEY.getInverseKey()) } override def as(alias: String): Country = new Country(DSL.name(alias), this) override def as(alias: Name): Country = new Country(alias, this) override def as(alias: Table[_]): Country = new Country(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala index df8c86f..e4b3cf2 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala @@ -37,6 +37,14 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Address.AddressPath +import org.jooq.demo.skala.db.tables.Payment.PaymentPath +import org.jooq.demo.skala.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.skala.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.skala.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.skala.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.skala.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.skala.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.CustomerRecord import org.jooq.impl.DSL @@ -179,6 +187,52 @@ extends TableImpl[CustomerRecord]( * Get the implicit join path to the public.address table. */ lazy val address: AddressPath = { new AddressPath(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.payment table + */ + lazy val payment: PaymentPath = { new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + lazy val paymentP2007_01: PaymentP2007_01Path = { new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + lazy val paymentP2007_02: PaymentP2007_02Path = { new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + lazy val paymentP2007_03: PaymentP2007_03Path = { new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + lazy val paymentP2007_04: PaymentP2007_04Path = { new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + lazy val paymentP2007_05: PaymentP2007_05Path = { new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + lazy val paymentP2007_06: PaymentP2007_06Path = { new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.rental table + */ + lazy val rental: RentalPath = { new RentalPath(this, null, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY.getInverseKey()) } override def as(alias: String): Customer = new Customer(DSL.name(alias), this) override def as(alias: Name): Customer = new Customer(alias, this) override def as(alias: Table[_]): Customer = new Customer(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala index 35a989e..2a9b16f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala @@ -41,6 +41,11 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.enums.MpaaRating +import org.jooq.demo.skala.db.tables.Actor.ActorPath +import org.jooq.demo.skala.db.tables.Category.CategoryPath +import org.jooq.demo.skala.db.tables.FilmActor.FilmActorPath +import org.jooq.demo.skala.db.tables.FilmCategory.FilmCategoryPath +import org.jooq.demo.skala.db.tables.Inventory.InventoryPath import org.jooq.demo.skala.db.tables.Language.LanguagePath import org.jooq.demo.skala.db.tables.records.FilmRecord import org.jooq.impl.DSL @@ -211,6 +216,36 @@ extends TableImpl[FilmRecord]( * the film_original_language_id_fkey key. */ lazy val filmOriginalLanguageIdFkey: LanguagePath = { new LanguagePath(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + lazy val filmActor: FilmActorPath = { new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.film_category + * table + */ + lazy val filmCategory: FilmCategoryPath = { new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + lazy val inventory: InventoryPath = { new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit many-to-many join path to the public.actor + * table + */ + def actor: ActorPath = filmActor.actor + + /** + * Get the implicit many-to-many join path to the public.category + * table + */ + def category: CategoryPath = filmCategory.category override def as(alias: String): Film = new Film(DSL.name(alias), this) override def as(alias: Name): Film = new Film(alias, this) override def as(alias: Table[_]): Film = new Film(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala index c1bae94..41d3e7d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala @@ -19,6 +19,7 @@ import org.jooq.ForeignKey import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -36,6 +37,7 @@ import org.jooq.demo.skala.db.tables.Actor.ActorPath import org.jooq.demo.skala.db.tables.Film.FilmPath import org.jooq.demo.skala.db.tables.records.FilmActorRecord import org.jooq.impl.DSL +import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -48,6 +50,11 @@ object FilmActor { * The reference instance of public.film_actor */ val FILM_ACTOR = new FilmActor + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class FilmActorPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmActorRecord], parentPath: InverseForeignKey[_ <: Record, FilmActorRecord]) extends FilmActor(path, childPath, parentPath) with Path[FilmActorRecord] } /** @@ -113,6 +120,8 @@ extends TableImpl[FilmActorRecord]( */ def this() = this(DSL.name("film_actor"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmActorRecord], parentPath: InverseForeignKey[_ <: Record, FilmActorRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.FilmActor.FILM_ACTOR, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_FILM_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala index a60488d..be67f7a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala @@ -18,6 +18,7 @@ import org.jooq.Field import org.jooq.ForeignKey import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -34,6 +35,7 @@ import org.jooq.demo.skala.db.tables.Category.CategoryPath import org.jooq.demo.skala.db.tables.Film.FilmPath import org.jooq.demo.skala.db.tables.records.FilmCategoryRecord import org.jooq.impl.DSL +import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -46,6 +48,11 @@ object FilmCategory { * The reference instance of public.film_category */ val FILM_CATEGORY = new FilmCategory + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class FilmCategoryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmCategoryRecord], parentPath: InverseForeignKey[_ <: Record, FilmCategoryRecord]) extends FilmCategory(path, childPath, parentPath) with Path[FilmCategoryRecord] } /** @@ -111,6 +118,8 @@ extends TableImpl[FilmCategoryRecord]( */ def this() = this(DSL.name("film_category"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmCategoryRecord], parentPath: InverseForeignKey[_ <: Record, FilmCategoryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.FilmCategory.FILM_CATEGORY, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getPrimaryKey: UniqueKey[FilmCategoryRecord] = Keys.FILM_CATEGORY_PKEY diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala index e0b9206..db4a2df 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala @@ -35,6 +35,7 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Film.FilmPath +import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.InventoryRecord import org.jooq.impl.DSL @@ -147,6 +148,11 @@ extends TableImpl[InventoryRecord]( * Get the implicit join path to the public.store table. */ lazy val store: StorePath = { new StorePath(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.rental table + */ + lazy val rental: RentalPath = { new RentalPath(this, null, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY.getInverseKey()) } override def as(alias: String): Inventory = new Inventory(DSL.name(alias), this) override def as(alias: Name): Inventory = new Inventory(alias, this) override def as(alias: Table[_]): Inventory = new Inventory(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala index 2846cbb..61f7b42 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala @@ -30,6 +30,7 @@ import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Film.FilmPath import org.jooq.demo.skala.db.tables.records.LanguageRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -122,6 +123,18 @@ extends TableImpl[LanguageRecord]( override def getIdentity: Identity[LanguageRecord, Long] = super.getIdentity.asInstanceOf[ Identity[LanguageRecord, Long] ] override def getPrimaryKey: UniqueKey[LanguageRecord] = Keys.LANGUAGE_PKEY + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_language_id_fkey key + */ + lazy val filmLanguageIdFkey: FilmPath = { new FilmPath(this, null, Keys.FILM__FILM_LANGUAGE_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_original_language_id_fkey key + */ + lazy val filmOriginalLanguageIdFkey: FilmPath = { new FilmPath(this, null, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY.getInverseKey()) } override def as(alias: String): Language = new Language(DSL.name(alias), this) override def as(alias: Name): Language = new Language(alias, this) override def as(alias: Table[_]): Language = new Language(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala index 1db126e..5bf5d5f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala @@ -21,6 +21,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -39,6 +40,7 @@ import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.PaymentRecord import org.jooq.impl.DSL +import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -51,6 +53,11 @@ object Payment { * The reference instance of public.payment */ val PAYMENT = new Payment + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentRecord], parentPath: InverseForeignKey[_ <: Record, PaymentRecord]) extends Payment(path, childPath, parentPath) with Path[PaymentRecord] } /** @@ -131,6 +138,8 @@ extends TableImpl[PaymentRecord]( */ def this() = this(DSL.name("payment"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentRecord], parentPath: InverseForeignKey[_ <: Record, PaymentRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Payment.PAYMENT, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_CUSTOMER_ID, Indexes.IDX_FK_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala index 9cd61a3..90c10cd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_01 { * The reference instance of public.payment_p2007_01 */ val PAYMENT_P2007_01 = new PaymentP2007_01 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_01Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_01Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_01Record]) extends PaymentP2007_01(path, childPath, parentPath) with Path[PaymentP2007_01Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_01Record]( */ def this() = this(DSL.name("payment_p2007_01"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_01Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_01Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_01.PAYMENT_P2007_01, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_01_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_01_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala index 0065717..d2b10cc 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_02 { * The reference instance of public.payment_p2007_02 */ val PAYMENT_P2007_02 = new PaymentP2007_02 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_02Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_02Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_02Record]) extends PaymentP2007_02(path, childPath, parentPath) with Path[PaymentP2007_02Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_02Record]( */ def this() = this(DSL.name("payment_p2007_02"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_02Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_02Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_02.PAYMENT_P2007_02, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_02_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_02_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala index 7baecf3..60d0648 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_03 { * The reference instance of public.payment_p2007_03 */ val PAYMENT_P2007_03 = new PaymentP2007_03 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_03Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_03Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_03Record]) extends PaymentP2007_03(path, childPath, parentPath) with Path[PaymentP2007_03Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_03Record]( */ def this() = this(DSL.name("payment_p2007_03"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_03Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_03Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_03.PAYMENT_P2007_03, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_03_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_03_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala index a55709b..173c28e 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_04 { * The reference instance of public.payment_p2007_04 */ val PAYMENT_P2007_04 = new PaymentP2007_04 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_04Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_04Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_04Record]) extends PaymentP2007_04(path, childPath, parentPath) with Path[PaymentP2007_04Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_04Record]( */ def this() = this(DSL.name("payment_p2007_04"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_04Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_04Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_04.PAYMENT_P2007_04, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_04_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_04_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala index 73a15c7..3b4e75c 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_05 { * The reference instance of public.payment_p2007_05 */ val PAYMENT_P2007_05 = new PaymentP2007_05 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_05Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_05Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_05Record]) extends PaymentP2007_05(path, childPath, parentPath) with Path[PaymentP2007_05Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_05Record]( */ def this() = this(DSL.name("payment_p2007_05"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_05Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_05Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_05.PAYMENT_P2007_05, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_05_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_05_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala index 8d44fa3..19fd7a4 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_06 { * The reference instance of public.payment_p2007_06 */ val PAYMENT_P2007_06 = new PaymentP2007_06 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_06Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_06Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_06Record]) extends PaymentP2007_06(path, childPath, parentPath) with Path[PaymentP2007_06Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_06Record]( */ def this() = this(DSL.name("payment_p2007_06"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_06Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_06Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_06.PAYMENT_P2007_06, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_06_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_06_STAFF_ID) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala index 63275ef..42d6cb1 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala @@ -36,6 +36,13 @@ import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Customer.CustomerPath import org.jooq.demo.skala.db.tables.Inventory.InventoryPath +import org.jooq.demo.skala.db.tables.Payment.PaymentPath +import org.jooq.demo.skala.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.skala.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.skala.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.skala.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.skala.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.skala.db.tables.PaymentP2007_06.PaymentP2007_06Path import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.RentalRecord import org.jooq.impl.DSL @@ -168,6 +175,47 @@ extends TableImpl[RentalRecord]( * Get the implicit join path to the public.staff table. */ lazy val staff: StaffPath = { new StaffPath(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.payment table + */ + lazy val payment: PaymentPath = { new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + lazy val paymentP2007_01: PaymentP2007_01Path = { new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + lazy val paymentP2007_02: PaymentP2007_02Path = { new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + lazy val paymentP2007_03: PaymentP2007_03Path = { new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + lazy val paymentP2007_04: PaymentP2007_04Path = { new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + lazy val paymentP2007_05: PaymentP2007_05Path = { new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + lazy val paymentP2007_06: PaymentP2007_06Path = { new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY.getInverseKey()) } override def as(alias: String): Rental = new Rental(DSL.name(alias), this) override def as(alias: Name): Rental = new Rental(alias, this) override def as(alias: Table[_]): Rental = new Rental(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala index d0a9eb1..0eb8733 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala @@ -33,6 +33,14 @@ import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Address.AddressPath +import org.jooq.demo.skala.db.tables.Payment.PaymentPath +import org.jooq.demo.skala.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.skala.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.skala.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.skala.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.skala.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.skala.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.StaffRecord import org.jooq.impl.DSL @@ -179,6 +187,52 @@ extends TableImpl[StaffRecord]( * Get the implicit join path to the public.store table. */ lazy val store: StorePath = { new StorePath(this, Keys.STAFF__STAFF_STORE_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.payment table + */ + lazy val payment: PaymentPath = { new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + lazy val paymentP2007_01: PaymentP2007_01Path = { new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + lazy val paymentP2007_02: PaymentP2007_02Path = { new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + lazy val paymentP2007_03: PaymentP2007_03Path = { new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + lazy val paymentP2007_04: PaymentP2007_04Path = { new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + lazy val paymentP2007_05: PaymentP2007_05Path = { new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + lazy val paymentP2007_06: PaymentP2007_06Path = { new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.rental table + */ + lazy val rental: RentalPath = { new RentalPath(this, null, Keys.RENTAL__RENTAL_STAFF_ID_FKEY.getInverseKey()) } override def as(alias: String): Staff = new Staff(DSL.name(alias), this) override def as(alias: Name): Staff = new Staff(alias, this) override def as(alias: Table[_]): Staff = new Staff(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala index 55fa896..2870263 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala @@ -35,6 +35,8 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Address.AddressPath +import org.jooq.demo.skala.db.tables.Customer.CustomerPath +import org.jooq.demo.skala.db.tables.Inventory.InventoryPath import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.StoreRecord import org.jooq.impl.DSL @@ -147,6 +149,18 @@ extends TableImpl[StoreRecord]( * Get the implicit join path to the public.address table. */ lazy val address: AddressPath = { new AddressPath(this, Keys.STORE__STORE_ADDRESS_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + lazy val customer: CustomerPath = { new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + lazy val inventory: InventoryPath = { new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY.getInverseKey()) } override def as(alias: String): Store = new Store(DSL.name(alias), this) override def as(alias: Name): Store = new Store(alias, this) override def as(alias: Table[_]): Store = new Store(alias.getQualifiedName(), this) 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 ee6447f..c163e87 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 @@ -1,6 +1,7 @@ package org.jooq.demo.skala import org.jooq.Records.intoMap +import org.jooq.conf.RenderImplicitJoinType import org.jooq.demo.AbstractDemo import org.jooq.demo.AbstractDemo._ import org.jooq.demo.skala.db.Tables._ @@ -238,6 +239,79 @@ class Demo01Querying extends AbstractDemo { // - https://blog.jooq.org/why-you-should-use-jooq-with-code-generation/ } + @Test + def implicitToManyJoins(): Unit = { + // Navigating foreign keys from parent to children is possible as well. By default, all such paths must be + // declared explicitly in the FROM clause: + + 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) + .leftJoin(CUSTOMER.rental.inventory) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc) + .limit(5) + .fetch + + // If you can live with the quirkiness of implicit to-many join paths, then this feature can be enabled with + // a Settings. Now, implicit to-many join paths work just like implicit to-one join paths, with the exception + // that now, a seemingly scalar expression can produce cartesian products in your query! + // This may be hard to debug because of the implicitness, so use this only sparingly! + 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 + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-to-many-join/ + // - https://blog.jooq.org/why-you-should-use-jooq-with-code-generation/ + } + + @Test + def implicitPathCorrelation(): Unit = { + // Correlated subqueries are frequent in SQL. For example, find all actors without any films: + + title("Ordinary correlated subquery") + ctx.select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME) + .from(ACTOR) + .where(notExists( + selectOne + .from(FILM_ACTOR) + .where(FILM_ACTOR.ACTOR_ID.eq(ACTOR.ACTOR_ID)))) + .fetch + + // Spelling out the correlation predicate FILM_ACTOR.ACTOR_ID.eq(ACTOR.ACTOR_ID) is equally tedious (and error + // prone) as spelling out a JOIN predicate. After all, this is an ANTI JOIN, so it works in a similar way. With + // jOOQ, you can use paths again to implicitly correlate a subquery as follows, by starting declaring a path + // in the subquery's FROM clause, starting again from ACTOR, which is declared in the outer scope: + + title("Implicitly path-correlated subquery") + ctx + .select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME) + .from(ACTOR) + .where(notExists( + selectOne.from(ACTOR.filmActor))) + .fetch + + // More information: + // - https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-path-correlation/ + } + @Test def nestedRecords(): Unit = { // In jOOQ, a Table expression is also a SelectField, meaning that you can project any table and retrieve the @@ -336,14 +410,10 @@ class Demo01Querying extends AbstractDemo { val r = ctx .select( 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))), - multiset( - select(FILM_CATEGORY.category.NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID))) + + // Implicit path correlation is again very powerful! + multiset(select(FILM.actor.FIRST_NAME, FILM.actor.LAST_NAME).from(FILM.actor)), + multiset(select(FILM.category.NAME).from(FILM.category)) ) .from(FILM) .orderBy(FILM.TITLE) @@ -380,13 +450,11 @@ class Demo01Querying extends AbstractDemo { .select( FILM.TITLE, multiset( - select(row(FILM_ACTOR.actor.FIRST_NAME, FILM_ACTOR.actor.LAST_NAME).mapping(Name(_, _))) - .from(FILM_ACTOR) - .where(FILM_ACTOR.FILM_ID.eq(FILM.FILM_ID))).mapping(Actor), + select(row(FILM.actor.FIRST_NAME, FILM.actor.LAST_NAME).mapping(Name(_, _))) + .from(FILM.actor)).mapping(Actor), multiset( - select(FILM_CATEGORY.category.NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID))).mapping(Category)) + select(FILM.category.NAME) + .from(FILM.category)).mapping(Category)) .from(FILM) .orderBy(FILM.TITLE) .limit(5) 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-scala/pom.xml b/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml index 831b77e..81763a7 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml +++ b/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml @@ -134,11 +134,6 @@ https://www.jooq.org/doc/latest/manual/code-generation/codegen-version-control/ --> src/main/scala - - - - false - diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala index 2eb1e83..f1fa53a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Actor.scala @@ -36,6 +36,8 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.Triggers +import org.jooq.demo.skala.db.tables.Film.FilmPath +import org.jooq.demo.skala.db.tables.FilmActor.FilmActorPath import org.jooq.demo.skala.db.tables.records.ActorRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -135,6 +137,18 @@ extends TableImpl[ActorRecord]( override def getIdentity: Identity[ActorRecord, Long] = super.getIdentity.asInstanceOf[ Identity[ActorRecord, Long] ] override def getPrimaryKey: UniqueKey[ActorRecord] = Keys.ACTOR_PKEY + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + lazy val filmActor: FilmActorPath = { new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + def film: FilmPath = filmActor.film override def getTriggers: List[Trigger] = Arrays.asList[Trigger](Triggers.LAST_UPDATED) override def as(alias: String): Actor = new Actor(DSL.name(alias), this) override def as(alias: Name): Actor = new Actor(alias, this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala index d0dabb0..ec35e7a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Address.scala @@ -35,6 +35,9 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.City.CityPath +import org.jooq.demo.skala.db.tables.Customer.CustomerPath +import org.jooq.demo.skala.db.tables.Staff.StaffPath +import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.AddressRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -161,6 +164,22 @@ extends TableImpl[AddressRecord]( * Get the implicit join path to the public.city table. */ lazy val city: CityPath = { new CityPath(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + lazy val customer: CustomerPath = { new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.staff table + */ + lazy val staff: StaffPath = { new StaffPath(this, null, Keys.STAFF__STAFF_ADDRESS_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.store table + */ + lazy val store: StorePath = { new StorePath(this, null, Keys.STORE__STORE_ADDRESS_ID_FKEY.getInverseKey()) } override def as(alias: String): Address = new Address(DSL.name(alias), this) override def as(alias: Name): Address = new Address(alias, this) override def as(alias: Table[_]): Address = new Address(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala index b892505..36cd881 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Category.scala @@ -30,6 +30,8 @@ import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Film.FilmPath +import org.jooq.demo.skala.db.tables.FilmCategory.FilmCategoryPath import org.jooq.demo.skala.db.tables.records.CategoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -122,6 +124,18 @@ extends TableImpl[CategoryRecord]( override def getIdentity: Identity[CategoryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CategoryRecord, Long] ] override def getPrimaryKey: UniqueKey[CategoryRecord] = Keys.CATEGORY_PKEY + + /** + * Get the implicit to-many join path to the public.film_category + * table + */ + lazy val filmCategory: FilmCategoryPath = { new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + def film: FilmPath = filmCategory.film override def as(alias: String): Category = new Category(DSL.name(alias), this) override def as(alias: Name): Category = new Category(alias, this) override def as(alias: Table[_]): Category = new Category(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala index 0f0db2e..ab0e891 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/City.scala @@ -34,6 +34,7 @@ import org.jooq.UniqueKey import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Address.AddressPath import org.jooq.demo.skala.db.tables.Country.CountryPath import org.jooq.demo.skala.db.tables.records.CityRecord import org.jooq.impl.DSL @@ -141,6 +142,11 @@ extends TableImpl[CityRecord]( * Get the implicit join path to the public.country table. */ lazy val country: CountryPath = { new CountryPath(this, Keys.CITY__CITY_COUNTRY_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.address table + */ + lazy val address: AddressPath = { new AddressPath(this, null, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY.getInverseKey()) } override def as(alias: String): City = new City(DSL.name(alias), this) override def as(alias: Name): City = new City(alias, this) override def as(alias: Table[_]): City = new City(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala index 7327ab6..3a4b1fc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Country.scala @@ -30,6 +30,7 @@ import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.City.CityPath import org.jooq.demo.skala.db.tables.records.CountryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -122,6 +123,11 @@ extends TableImpl[CountryRecord]( override def getIdentity: Identity[CountryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CountryRecord, Long] ] override def getPrimaryKey: UniqueKey[CountryRecord] = Keys.COUNTRY_PKEY + + /** + * Get the implicit to-many join path to the public.city table + */ + lazy val city: CityPath = { new CityPath(this, null, Keys.CITY__CITY_COUNTRY_ID_FKEY.getInverseKey()) } override def as(alias: String): Country = new Country(DSL.name(alias), this) override def as(alias: Name): Country = new Country(alias, this) override def as(alias: Table[_]): Country = new Country(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala index d943f19..ee7d57b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Customer.scala @@ -37,6 +37,14 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Address.AddressPath +import org.jooq.demo.skala.db.tables.Payment.PaymentPath +import org.jooq.demo.skala.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.skala.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.skala.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.skala.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.skala.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.skala.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.CustomerRecord import org.jooq.impl.DSL @@ -179,6 +187,52 @@ extends TableImpl[CustomerRecord]( * Get the implicit join path to the public.address table. */ lazy val address: AddressPath = { new AddressPath(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.payment table + */ + lazy val payment: PaymentPath = { new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + lazy val paymentP2007_01: PaymentP2007_01Path = { new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + lazy val paymentP2007_02: PaymentP2007_02Path = { new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + lazy val paymentP2007_03: PaymentP2007_03Path = { new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + lazy val paymentP2007_04: PaymentP2007_04Path = { new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + lazy val paymentP2007_05: PaymentP2007_05Path = { new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + lazy val paymentP2007_06: PaymentP2007_06Path = { new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.rental table + */ + lazy val rental: RentalPath = { new RentalPath(this, null, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY.getInverseKey()) } override def as(alias: String): Customer = new Customer(DSL.name(alias), this) override def as(alias: Name): Customer = new Customer(alias, this) override def as(alias: Table[_]): Customer = new Customer(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala index 9fedf24..20b3436 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Film.scala @@ -43,6 +43,11 @@ import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.Triggers import org.jooq.demo.skala.db.enums.MpaaRating +import org.jooq.demo.skala.db.tables.Actor.ActorPath +import org.jooq.demo.skala.db.tables.Category.CategoryPath +import org.jooq.demo.skala.db.tables.FilmActor.FilmActorPath +import org.jooq.demo.skala.db.tables.FilmCategory.FilmCategoryPath +import org.jooq.demo.skala.db.tables.Inventory.InventoryPath import org.jooq.demo.skala.db.tables.Language.LanguagePath import org.jooq.demo.skala.db.tables.records.FilmRecord import org.jooq.impl.DSL @@ -213,6 +218,36 @@ extends TableImpl[FilmRecord]( * the film_original_language_id_fkey key. */ lazy val filmOriginalLanguageIdFkey: LanguagePath = { new LanguagePath(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + lazy val filmActor: FilmActorPath = { new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.film_category + * table + */ + lazy val filmCategory: FilmCategoryPath = { new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + lazy val inventory: InventoryPath = { new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit many-to-many join path to the public.actor + * table + */ + def actor: ActorPath = filmActor.actor + + /** + * Get the implicit many-to-many join path to the public.category + * table + */ + def category: CategoryPath = filmCategory.category override def getTriggers: List[Trigger] = Arrays.asList[Trigger](Triggers.FILM_FULLTEXT_TRIGGER) override def as(alias: String): Film = new Film(DSL.name(alias), this) override def as(alias: Name): Film = new Film(alias, this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala index e5154ab..1720aea 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmActor.scala @@ -19,6 +19,7 @@ import org.jooq.ForeignKey import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -36,6 +37,7 @@ import org.jooq.demo.skala.db.tables.Actor.ActorPath import org.jooq.demo.skala.db.tables.Film.FilmPath import org.jooq.demo.skala.db.tables.records.FilmActorRecord import org.jooq.impl.DSL +import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -48,6 +50,11 @@ object FilmActor { * The reference instance of public.film_actor */ val FILM_ACTOR = new FilmActor + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class FilmActorPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmActorRecord], parentPath: InverseForeignKey[_ <: Record, FilmActorRecord]) extends FilmActor(path, childPath, parentPath) with Path[FilmActorRecord] } /** @@ -113,6 +120,8 @@ extends TableImpl[FilmActorRecord]( */ def this() = this(DSL.name("film_actor"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmActorRecord], parentPath: InverseForeignKey[_ <: Record, FilmActorRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.FilmActor.FILM_ACTOR, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_FILM_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala index 9e2cbf4..403791a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmCategory.scala @@ -18,6 +18,7 @@ import org.jooq.Field import org.jooq.ForeignKey import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -34,6 +35,7 @@ import org.jooq.demo.skala.db.tables.Category.CategoryPath import org.jooq.demo.skala.db.tables.Film.FilmPath import org.jooq.demo.skala.db.tables.records.FilmCategoryRecord import org.jooq.impl.DSL +import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -46,6 +48,11 @@ object FilmCategory { * The reference instance of public.film_category */ val FILM_CATEGORY = new FilmCategory + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class FilmCategoryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmCategoryRecord], parentPath: InverseForeignKey[_ <: Record, FilmCategoryRecord]) extends FilmCategory(path, childPath, parentPath) with Path[FilmCategoryRecord] } /** @@ -111,6 +118,8 @@ extends TableImpl[FilmCategoryRecord]( */ def this() = this(DSL.name("film_category"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmCategoryRecord], parentPath: InverseForeignKey[_ <: Record, FilmCategoryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.FilmCategory.FILM_CATEGORY, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getPrimaryKey: UniqueKey[FilmCategoryRecord] = Keys.FILM_CATEGORY_PKEY diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala index e59652f..a424a90 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Inventory.scala @@ -35,6 +35,7 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Film.FilmPath +import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.InventoryRecord import org.jooq.impl.DSL @@ -147,6 +148,11 @@ extends TableImpl[InventoryRecord]( * Get the implicit join path to the public.store table. */ lazy val store: StorePath = { new StorePath(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.rental table + */ + lazy val rental: RentalPath = { new RentalPath(this, null, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY.getInverseKey()) } override def as(alias: String): Inventory = new Inventory(DSL.name(alias), this) override def as(alias: Name): Inventory = new Inventory(alias, this) override def as(alias: Table[_]): Inventory = new Inventory(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala index ea1ac65..dbb2368 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Language.scala @@ -30,6 +30,7 @@ import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public +import org.jooq.demo.skala.db.tables.Film.FilmPath import org.jooq.demo.skala.db.tables.records.LanguageRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -122,6 +123,18 @@ extends TableImpl[LanguageRecord]( override def getIdentity: Identity[LanguageRecord, Long] = super.getIdentity.asInstanceOf[ Identity[LanguageRecord, Long] ] override def getPrimaryKey: UniqueKey[LanguageRecord] = Keys.LANGUAGE_PKEY + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_language_id_fkey key + */ + lazy val filmLanguageIdFkey: FilmPath = { new FilmPath(this, null, Keys.FILM__FILM_LANGUAGE_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_original_language_id_fkey key + */ + lazy val filmOriginalLanguageIdFkey: FilmPath = { new FilmPath(this, null, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY.getInverseKey()) } override def as(alias: String): Language = new Language(DSL.name(alias), this) override def as(alias: Name): Language = new Language(alias, this) override def as(alias: Table[_]): Language = new Language(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala index 1db126e..5bf5d5f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Payment.scala @@ -21,6 +21,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -39,6 +40,7 @@ import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.PaymentRecord import org.jooq.impl.DSL +import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -51,6 +53,11 @@ object Payment { * The reference instance of public.payment */ val PAYMENT = new Payment + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentRecord], parentPath: InverseForeignKey[_ <: Record, PaymentRecord]) extends Payment(path, childPath, parentPath) with Path[PaymentRecord] } /** @@ -131,6 +138,8 @@ extends TableImpl[PaymentRecord]( */ def this() = this(DSL.name("payment"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentRecord], parentPath: InverseForeignKey[_ <: Record, PaymentRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Payment.PAYMENT, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_CUSTOMER_ID, Indexes.IDX_FK_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala index 9cd61a3..90c10cd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_01.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_01 { * The reference instance of public.payment_p2007_01 */ val PAYMENT_P2007_01 = new PaymentP2007_01 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_01Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_01Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_01Record]) extends PaymentP2007_01(path, childPath, parentPath) with Path[PaymentP2007_01Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_01Record]( */ def this() = this(DSL.name("payment_p2007_01"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_01Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_01Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_01.PAYMENT_P2007_01, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_01_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_01_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala index 0065717..d2b10cc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_02.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_02 { * The reference instance of public.payment_p2007_02 */ val PAYMENT_P2007_02 = new PaymentP2007_02 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_02Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_02Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_02Record]) extends PaymentP2007_02(path, childPath, parentPath) with Path[PaymentP2007_02Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_02Record]( */ def this() = this(DSL.name("payment_p2007_02"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_02Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_02Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_02.PAYMENT_P2007_02, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_02_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_02_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala index 7baecf3..60d0648 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_03.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_03 { * The reference instance of public.payment_p2007_03 */ val PAYMENT_P2007_03 = new PaymentP2007_03 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_03Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_03Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_03Record]) extends PaymentP2007_03(path, childPath, parentPath) with Path[PaymentP2007_03Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_03Record]( */ def this() = this(DSL.name("payment_p2007_03"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_03Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_03Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_03.PAYMENT_P2007_03, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_03_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_03_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala index a55709b..173c28e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_04.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_04 { * The reference instance of public.payment_p2007_04 */ val PAYMENT_P2007_04 = new PaymentP2007_04 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_04Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_04Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_04Record]) extends PaymentP2007_04(path, childPath, parentPath) with Path[PaymentP2007_04Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_04Record]( */ def this() = this(DSL.name("payment_p2007_04"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_04Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_04Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_04.PAYMENT_P2007_04, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_04_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_04_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala index 73a15c7..3b4e75c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_05.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_05 { * The reference instance of public.payment_p2007_05 */ val PAYMENT_P2007_05 = new PaymentP2007_05 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_05Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_05Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_05Record]) extends PaymentP2007_05(path, childPath, parentPath) with Path[PaymentP2007_05Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_05Record]( */ def this() = this(DSL.name("payment_p2007_05"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_05Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_05Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_05.PAYMENT_P2007_05, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_05_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_05_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala index 8d44fa3..19fd7a4 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/PaymentP2007_06.scala @@ -22,6 +22,7 @@ import org.jooq.Identity import org.jooq.Index import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path import org.jooq.PlainSQL import org.jooq.Record import org.jooq.SQL @@ -52,6 +53,11 @@ object PaymentP2007_06 { * The reference instance of public.payment_p2007_06 */ val PAYMENT_P2007_06 = new PaymentP2007_06 + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class PaymentP2007_06Path(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_06Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_06Record]) extends PaymentP2007_06(path, childPath, parentPath) with Path[PaymentP2007_06Record] } /** @@ -132,6 +138,8 @@ extends TableImpl[PaymentP2007_06Record]( */ def this() = this(DSL.name("payment_p2007_06"), null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, PaymentP2007_06Record], parentPath: InverseForeignKey[_ <: Record, PaymentP2007_06Record]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.PaymentP2007_06.PAYMENT_P2007_06, null, null) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_PAYMENT_P2007_06_CUSTOMER_ID, Indexes.IDX_FK_PAYMENT_P2007_06_STAFF_ID) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala index 1994256..4264385 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Rental.scala @@ -36,6 +36,13 @@ import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Customer.CustomerPath import org.jooq.demo.skala.db.tables.Inventory.InventoryPath +import org.jooq.demo.skala.db.tables.Payment.PaymentPath +import org.jooq.demo.skala.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.skala.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.skala.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.skala.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.skala.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.skala.db.tables.PaymentP2007_06.PaymentP2007_06Path import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.RentalRecord import org.jooq.impl.DSL @@ -168,6 +175,47 @@ extends TableImpl[RentalRecord]( * Get the implicit join path to the public.staff table. */ lazy val staff: StaffPath = { new StaffPath(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.payment table + */ + lazy val payment: PaymentPath = { new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + lazy val paymentP2007_01: PaymentP2007_01Path = { new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + lazy val paymentP2007_02: PaymentP2007_02Path = { new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + lazy val paymentP2007_03: PaymentP2007_03Path = { new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + lazy val paymentP2007_04: PaymentP2007_04Path = { new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + lazy val paymentP2007_05: PaymentP2007_05Path = { new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + lazy val paymentP2007_06: PaymentP2007_06Path = { new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY.getInverseKey()) } override def as(alias: String): Rental = new Rental(DSL.name(alias), this) override def as(alias: Name): Rental = new Rental(alias, this) override def as(alias: Table[_]): Rental = new Rental(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala index 4618e09..c802b74 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Staff.scala @@ -33,6 +33,14 @@ import org.jooq.UniqueKey import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Address.AddressPath +import org.jooq.demo.skala.db.tables.Payment.PaymentPath +import org.jooq.demo.skala.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.skala.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.skala.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.skala.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.skala.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.skala.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.skala.db.tables.Rental.RentalPath import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.StaffRecord import org.jooq.impl.DSL @@ -189,6 +197,52 @@ extends TableImpl[StaffRecord]( * Get the implicit join path to the public.store table. */ lazy val store: StorePath = { new StorePath(this, Keys.STAFF__STAFF_STORE_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.payment table + */ + lazy val payment: PaymentPath = { new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + lazy val paymentP2007_01: PaymentP2007_01Path = { new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + lazy val paymentP2007_02: PaymentP2007_02Path = { new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + lazy val paymentP2007_03: PaymentP2007_03Path = { new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + lazy val paymentP2007_04: PaymentP2007_04Path = { new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + lazy val paymentP2007_05: PaymentP2007_05Path = { new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + lazy val paymentP2007_06: PaymentP2007_06Path = { new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.rental table + */ + lazy val rental: RentalPath = { new RentalPath(this, null, Keys.RENTAL__RENTAL_STAFF_ID_FKEY.getInverseKey()) } override def as(alias: String): Staff = new Staff(DSL.name(alias), this) override def as(alias: Name): Staff = new Staff(alias, this) override def as(alias: Table[_]): Staff = new Staff(alias.getQualifiedName(), this) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala index 08909d9..495de31 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/Store.scala @@ -35,6 +35,8 @@ import org.jooq.demo.skala.db.Indexes import org.jooq.demo.skala.db.Keys import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.Address.AddressPath +import org.jooq.demo.skala.db.tables.Customer.CustomerPath +import org.jooq.demo.skala.db.tables.Inventory.InventoryPath import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.StoreRecord import org.jooq.impl.DSL @@ -152,6 +154,18 @@ extends TableImpl[StoreRecord]( * Get the implicit join path to the public.address table. */ lazy val address: AddressPath = { new AddressPath(this, Keys.STORE__STORE_ADDRESS_ID_FKEY, null) } + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + lazy val customer: CustomerPath = { new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY.getInverseKey()) } + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + lazy val inventory: InventoryPath = { new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY.getInverseKey()) } override def as(alias: String): Store = new Store(DSL.name(alias), this) override def as(alias: Name): Store = new Store(alias, this) override def as(alias: Table[_]): Store = new Store(alias.getQualifiedName(), this) 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 ee6447f..c163e87 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 @@ -1,6 +1,7 @@ package org.jooq.demo.skala import org.jooq.Records.intoMap +import org.jooq.conf.RenderImplicitJoinType import org.jooq.demo.AbstractDemo import org.jooq.demo.AbstractDemo._ import org.jooq.demo.skala.db.Tables._ @@ -238,6 +239,79 @@ class Demo01Querying extends AbstractDemo { // - https://blog.jooq.org/why-you-should-use-jooq-with-code-generation/ } + @Test + def implicitToManyJoins(): Unit = { + // Navigating foreign keys from parent to children is possible as well. By default, all such paths must be + // declared explicitly in the FROM clause: + + 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) + .leftJoin(CUSTOMER.rental.inventory) + .groupBy(CUSTOMER.CUSTOMER_ID) + .orderBy(inline(3).desc) + .limit(5) + .fetch + + // If you can live with the quirkiness of implicit to-many join paths, then this feature can be enabled with + // a Settings. Now, implicit to-many join paths work just like implicit to-one join paths, with the exception + // that now, a seemingly scalar expression can produce cartesian products in your query! + // This may be hard to debug because of the implicitness, so use this only sparingly! + 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 + + // More information here: + // - https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-to-many-join/ + // - https://blog.jooq.org/why-you-should-use-jooq-with-code-generation/ + } + + @Test + def implicitPathCorrelation(): Unit = { + // Correlated subqueries are frequent in SQL. For example, find all actors without any films: + + title("Ordinary correlated subquery") + ctx.select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME) + .from(ACTOR) + .where(notExists( + selectOne + .from(FILM_ACTOR) + .where(FILM_ACTOR.ACTOR_ID.eq(ACTOR.ACTOR_ID)))) + .fetch + + // Spelling out the correlation predicate FILM_ACTOR.ACTOR_ID.eq(ACTOR.ACTOR_ID) is equally tedious (and error + // prone) as spelling out a JOIN predicate. After all, this is an ANTI JOIN, so it works in a similar way. With + // jOOQ, you can use paths again to implicitly correlate a subquery as follows, by starting declaring a path + // in the subquery's FROM clause, starting again from ACTOR, which is declared in the outer scope: + + title("Implicitly path-correlated subquery") + ctx + .select(ACTOR.FIRST_NAME, ACTOR.LAST_NAME) + .from(ACTOR) + .where(notExists( + selectOne.from(ACTOR.filmActor))) + .fetch + + // More information: + // - https://www.jooq.org/doc/latest/manual/sql-building/sql-statements/select-statement/implicit-path-correlation/ + } + @Test def nestedRecords(): Unit = { // In jOOQ, a Table expression is also a SelectField, meaning that you can project any table and retrieve the @@ -336,14 +410,10 @@ class Demo01Querying extends AbstractDemo { val r = ctx .select( 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))), - multiset( - select(FILM_CATEGORY.category.NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID))) + + // Implicit path correlation is again very powerful! + multiset(select(FILM.actor.FIRST_NAME, FILM.actor.LAST_NAME).from(FILM.actor)), + multiset(select(FILM.category.NAME).from(FILM.category)) ) .from(FILM) .orderBy(FILM.TITLE) @@ -380,13 +450,11 @@ class Demo01Querying extends AbstractDemo { .select( FILM.TITLE, multiset( - select(row(FILM_ACTOR.actor.FIRST_NAME, FILM_ACTOR.actor.LAST_NAME).mapping(Name(_, _))) - .from(FILM_ACTOR) - .where(FILM_ACTOR.FILM_ID.eq(FILM.FILM_ID))).mapping(Actor), + select(row(FILM.actor.FIRST_NAME, FILM.actor.LAST_NAME).mapping(Name(_, _))) + .from(FILM.actor)).mapping(Actor), multiset( - select(FILM_CATEGORY.category.NAME) - .from(FILM_CATEGORY) - .where(FILM_CATEGORY.FILM_ID.eq(FILM.FILM_ID))).mapping(Category)) + select(FILM.category.NAME) + .from(FILM.category)).mapping(Category)) .from(FILM) .orderBy(FILM.TITLE) .limit(5)