diff --git a/jOOQ-demo-oss/jOOQ-demo-java/pom.xml b/jOOQ-demo-oss/jOOQ-demo-java/pom.xml index 3cf1ab1..af3a966 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/pom.xml +++ b/jOOQ-demo-oss/jOOQ-demo-java/pom.xml @@ -6,7 +6,7 @@ org.jooq jooq-demo - 3.18.7 + 3.19.1 jooq-demo-java diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java index 4b1de9d..ed66269 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java @@ -45,10 +45,10 @@ public final List getSchemas() { } /** - * A reference to the 3.18 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.18. You can turn off the generation of this reference + * release, namely: 3.19. You can turn off the generation of this reference * by specifying /configuration/generator/generate/jooqVersionReference */ - private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18; + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19; } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java index 8d8f203..68e6551 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java @@ -53,7 +53,9 @@ public String getLiteral() { } /** - * Lookup a value of this EnumType by its literal + * Lookup a value of this EnumType by its literal. Returns + * null, if no such value could be found, see {@link + * EnumType#lookupLiteral(Class, String)}. */ public static MpaaRating lookupLiteral(String literal) { return EnumType.lookupLiteral(MpaaRating.class, literal); diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java index 9fac11c..b5ee3dd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,8 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; +import org.jooq.demo.java.db.tables.FilmActor.FilmActorPath; import org.jooq.demo.java.db.tables.records.ActorRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -75,11 +81,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Actor(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Actor(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Actor(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +109,35 @@ public Actor() { this(DSL.name("actor"), null); } - public Actor(Table child, ForeignKey key) { - super(child, key, ACTOR); + public Actor(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, ACTOR); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class ActorPath extends Actor implements Path { + public ActorPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private ActorPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public ActorPath as(String alias) { + return new ActorPath(DSL.name(alias), this); + } + + @Override + public ActorPath as(Name alias) { + return new ActorPath(alias, this); + } + + @Override + public ActorPath as(Table alias) { + return new ActorPath(alias.getQualifiedName(), this); + } } @Override @@ -127,6 +160,27 @@ public UniqueKey getPrimaryKey() { return Keys.ACTOR_PKEY; } + private transient FilmActorPath _filmActor; + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + public FilmActorPath filmActor() { + if (_filmActor == null) + _filmActor = new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY.getInverseKey()); + + return _filmActor; + } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + public FilmPath film() { + return filmActor().film(); + } + @Override public Actor as(String alias) { return new Actor(DSL.name(alias), this); @@ -166,27 +220,87 @@ public Actor rename(Table name) { return new Actor(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Actor where(Condition condition) { + return new Actor(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Actor where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Actor where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Actor where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Actor where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Actor where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + @PlainSQL + public Actor where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Actor where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Actor whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Actor whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java index aacbcd8..21799dc 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java @@ -4,17 +4,17 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function4; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -67,10 +67,10 @@ public Class getRecordType() { public final TableField FILM_INFO = createField(DSL.name("film_info"), SQLDataType.CLOB, this, ""); private ActorInfo(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private ActorInfo(Name alias, Table aliased, Field[] parameters) { + private ActorInfo(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "actor_info" as SELECT a.actor_id, a.first_name, @@ -86,7 +86,7 @@ LEFT JOIN film_actor fa ON ((a.actor_id = fa.actor_id))) LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name; - """)); + """), where); } /** @@ -110,10 +110,6 @@ public ActorInfo() { this(DSL.name("actor_info"), null); } - public ActorInfo(Table child, ForeignKey key) { - super(child, key, ACTOR_INFO); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -158,27 +154,87 @@ public ActorInfo rename(Table name) { return new ActorInfo(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Condition condition) { + return new ActorInfo(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ActorInfo where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ActorInfo where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ActorInfo where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + @PlainSQL + public ActorInfo where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public ActorInfo whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public ActorInfo whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java index 89da3ac..4b090ca 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function8; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,10 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.City.CityPath; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.AddressRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -95,11 +103,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Address(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Address(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Address(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -123,8 +131,35 @@ public Address() { this(DSL.name("address"), null); } - public Address(Table child, ForeignKey key) { - super(child, key, ADDRESS); + public Address(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, ADDRESS); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class AddressPath extends Address implements Path { + public AddressPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private AddressPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public AddressPath as(String alias) { + return new AddressPath(DSL.name(alias), this); + } + + @Override + public AddressPath as(Name alias) { + return new AddressPath(alias, this); + } + + @Override + public AddressPath as(Table alias) { + return new AddressPath(alias.getQualifiedName(), this); + } } @Override @@ -152,18 +187,55 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.ADDRESS__ADDRESS_CITY_ID_FKEY); } - private transient City _city; + private transient CityPath _city; /** * Get the implicit join path to the public.city table. */ - public City city() { + public CityPath city() { if (_city == null) - _city = new City(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY); + _city = new CityPath(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY, null); return _city; } + private transient CustomerPath _customer; + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + public CustomerPath customer() { + if (_customer == null) + _customer = new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY.getInverseKey()); + + return _customer; + } + + private transient StaffPath _staff; + + /** + * Get the implicit to-many join path to the public.staff table + */ + public StaffPath staff() { + if (_staff == null) + _staff = new StaffPath(this, null, Keys.STAFF__STAFF_ADDRESS_ID_FKEY.getInverseKey()); + + return _staff; + } + + private transient StorePath _store; + + /** + * Get the implicit to-many join path to the public.store table + */ + public StorePath store() { + if (_store == null) + _store = new StorePath(this, null, Keys.STORE__STORE_ADDRESS_ID_FKEY.getInverseKey()); + + return _store; + } + @Override public Address as(String alias) { return new Address(DSL.name(alias), this); @@ -203,27 +275,87 @@ public Address rename(Table name) { return new Address(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Condition condition) { + return new Address(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Address where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Address where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public Address where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Address where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Address whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java index 574c4df..c51bc58 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java @@ -5,24 +5,30 @@ import java.time.LocalDateTime; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; +import org.jooq.demo.java.db.tables.FilmCategory.FilmCategoryPath; import org.jooq.demo.java.db.tables.records.CategoryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -66,11 +72,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Category(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Category(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Category(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -94,8 +100,35 @@ public Category() { this(DSL.name("category"), null); } - public Category(Table child, ForeignKey key) { - super(child, key, CATEGORY); + public Category(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, CATEGORY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CategoryPath extends Category implements Path { + public CategoryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CategoryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CategoryPath as(String alias) { + return new CategoryPath(DSL.name(alias), this); + } + + @Override + public CategoryPath as(Name alias) { + return new CategoryPath(alias, this); + } + + @Override + public CategoryPath as(Table alias) { + return new CategoryPath(alias.getQualifiedName(), this); + } } @Override @@ -113,6 +146,27 @@ public UniqueKey getPrimaryKey() { return Keys.CATEGORY_PKEY; } + private transient FilmCategoryPath _filmCategory; + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + public FilmCategoryPath filmCategory() { + if (_filmCategory == null) + _filmCategory = new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY.getInverseKey()); + + return _filmCategory; + } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + public FilmPath film() { + return filmCategory().film(); + } + @Override public Category as(String alias) { return new Category(DSL.name(alias), this); @@ -152,27 +206,87 @@ public Category rename(Table name) { return new Category(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Category where(Condition condition) { + return new Category(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Category where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public Category where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Category where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Category whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Category whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java index 62257ac..c6b7595 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,8 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Country.CountryPath; import org.jooq.demo.java.db.tables.records.CityRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -75,11 +81,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private City(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private City(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private City(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +109,35 @@ public City() { this(DSL.name("city"), null); } - public City(Table child, ForeignKey key) { - super(child, key, CITY); + public City(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, CITY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CityPath extends City implements Path { + public CityPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CityPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CityPath as(String alias) { + return new CityPath(DSL.name(alias), this); + } + + @Override + public CityPath as(Name alias) { + return new CityPath(alias, this); + } + + @Override + public CityPath as(Table alias) { + return new CityPath(alias.getQualifiedName(), this); + } } @Override @@ -132,18 +165,31 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.CITY__CITY_COUNTRY_ID_FKEY); } - private transient Country _country; + private transient CountryPath _country; /** * Get the implicit join path to the public.country table. */ - public Country country() { + public CountryPath country() { if (_country == null) - _country = new Country(this, Keys.CITY__CITY_COUNTRY_ID_FKEY); + _country = new CountryPath(this, Keys.CITY__CITY_COUNTRY_ID_FKEY, null); return _country; } + private transient AddressPath _address; + + /** + * Get the implicit to-many join path to the public.address + * table + */ + public AddressPath address() { + if (_address == null) + _address = new AddressPath(this, null, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY.getInverseKey()); + + return _address; + } + @Override public City as(String alias) { return new City(DSL.name(alias), this); @@ -183,27 +229,87 @@ public City rename(Table name) { return new City(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public City where(Condition condition) { + return new City(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public City where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public City where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public City where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public City where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public City where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public City where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + @PlainSQL + public City where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public City whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public City whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java index 65788a0..7eef045 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java @@ -5,24 +5,29 @@ import java.time.LocalDateTime; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.City.CityPath; import org.jooq.demo.java.db.tables.records.CountryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -66,11 +71,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Country(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Country(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Country(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -94,8 +99,35 @@ public Country() { this(DSL.name("country"), null); } - public Country(Table child, ForeignKey key) { - super(child, key, COUNTRY); + public Country(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, COUNTRY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CountryPath extends Country implements Path { + public CountryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CountryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CountryPath as(String alias) { + return new CountryPath(DSL.name(alias), this); + } + + @Override + public CountryPath as(Name alias) { + return new CountryPath(alias, this); + } + + @Override + public CountryPath as(Table alias) { + return new CountryPath(alias.getQualifiedName(), this); + } } @Override @@ -113,6 +145,18 @@ public UniqueKey getPrimaryKey() { return Keys.COUNTRY_PKEY; } + private transient CityPath _city; + + /** + * Get the implicit to-many join path to the public.city table + */ + public CityPath city() { + if (_city == null) + _city = new CityPath(this, null, Keys.CITY__CITY_COUNTRY_ID_FKEY.getInverseKey()); + + return _city; + } + @Override public Country as(String alias) { return new Country(DSL.name(alias), this); @@ -152,27 +196,87 @@ public Country rename(Table name) { return new Country(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Country where(Condition condition) { + return new Country(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Country where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public Country where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Country where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Country whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Country whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java index b241c86..7a7e606 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java @@ -7,20 +7,24 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function10; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row10; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,6 +32,16 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Payment.PaymentPath; +import org.jooq.demo.java.db.tables.PaymentP2007_01.PaymentP2007_01Path; +import org.jooq.demo.java.db.tables.PaymentP2007_02.PaymentP2007_02Path; +import org.jooq.demo.java.db.tables.PaymentP2007_03.PaymentP2007_03Path; +import org.jooq.demo.java.db.tables.PaymentP2007_04.PaymentP2007_04Path; +import org.jooq.demo.java.db.tables.PaymentP2007_05.PaymentP2007_05Path; +import org.jooq.demo.java.db.tables.PaymentP2007_06.PaymentP2007_06Path; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.CustomerRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -106,11 +120,11 @@ public Class getRecordType() { public final TableField ACTIVE = createField(DSL.name("active"), SQLDataType.INTEGER, this, ""); private Customer(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Customer(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Customer(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -134,8 +148,35 @@ public Customer() { this(DSL.name("customer"), null); } - public Customer(Table child, ForeignKey key) { - super(child, key, CUSTOMER); + public Customer(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, CUSTOMER); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CustomerPath extends Customer implements Path { + public CustomerPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CustomerPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CustomerPath as(String alias) { + return new CustomerPath(DSL.name(alias), this); + } + + @Override + public CustomerPath as(Name alias) { + return new CustomerPath(alias, this); + } + + @Override + public CustomerPath as(Table alias) { + return new CustomerPath(alias.getQualifiedName(), this); + } } @Override @@ -163,29 +204,134 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY); } - private transient Store _store; - private transient Address _address; + private transient StorePath _store; /** * Get the implicit join path to the public.store table. */ - public Store store() { + public StorePath store() { if (_store == null) - _store = new Store(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY); + _store = new StorePath(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY, null); return _store; } + private transient AddressPath _address; + /** * Get the implicit join path to the public.address table. */ - public Address address() { + public AddressPath address() { if (_address == null) - _address = new Address(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY); + _address = new AddressPath(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null); return _address; } + private transient PaymentPath _payment; + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + public PaymentPath payment() { + if (_payment == null) + _payment = new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY.getInverseKey()); + + return _payment; + } + + private transient PaymentP2007_01Path _paymentP2007_01; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + public PaymentP2007_01Path paymentP2007_01() { + if (_paymentP2007_01 == null) + _paymentP2007_01 = new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_01; + } + + private transient PaymentP2007_02Path _paymentP2007_02; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + public PaymentP2007_02Path paymentP2007_02() { + if (_paymentP2007_02 == null) + _paymentP2007_02 = new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_02; + } + + private transient PaymentP2007_03Path _paymentP2007_03; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + public PaymentP2007_03Path paymentP2007_03() { + if (_paymentP2007_03 == null) + _paymentP2007_03 = new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_03; + } + + private transient PaymentP2007_04Path _paymentP2007_04; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + public PaymentP2007_04Path paymentP2007_04() { + if (_paymentP2007_04 == null) + _paymentP2007_04 = new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_04; + } + + private transient PaymentP2007_05Path _paymentP2007_05; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + public PaymentP2007_05Path paymentP2007_05() { + if (_paymentP2007_05 == null) + _paymentP2007_05 = new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_05; + } + + private transient PaymentP2007_06Path _paymentP2007_06; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + public PaymentP2007_06Path paymentP2007_06() { + if (_paymentP2007_06 == null) + _paymentP2007_06 = new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_06; + } + + private transient RentalPath _rental; + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + public RentalPath rental() { + if (_rental == null) + _rental = new RentalPath(this, null, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY.getInverseKey()); + + return _rental; + } + @Override public Customer as(String alias) { return new Customer(DSL.name(alias), this); @@ -225,27 +371,87 @@ public Customer rename(Table name) { return new Customer(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Customer where(Condition condition) { + return new Customer(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); + public Customer where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function10 from) { - return convertFrom(Records.mapping(from)); + @Override + public Customer where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function10 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Customer where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Customer whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Customer whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java index 6d61d47..7bbc685 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java @@ -4,17 +4,17 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function9; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row9; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -92,10 +92,10 @@ public Class getRecordType() { public final TableField SID = createField(DSL.name("sid"), SQLDataType.BIGINT, this, ""); private CustomerList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private CustomerList(Name alias, Table aliased, Field[] parameters) { + private CustomerList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "customer_list" as SELECT cu.customer_id AS id, (((cu.first_name)::text || ' '::text) || (cu.last_name)::text) AS name, @@ -113,7 +113,7 @@ private CustomerList(Name alias, Table aliased, Field[] p JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """)); + """), where); } /** @@ -137,10 +137,6 @@ public CustomerList() { this(DSL.name("customer_list"), null); } - public CustomerList(Table child, ForeignKey key) { - super(child, key, CUSTOMER_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -185,27 +181,87 @@ public CustomerList rename(Table name) { return new CustomerList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Condition condition) { + return new CustomerList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public CustomerList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public CustomerList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public CustomerList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); + @PlainSQL + public CustomerList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function9 from) { - return convertFrom(Records.mapping(from)); + @Override + public CustomerList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function9 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public CustomerList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java index 57b68df..e1da507 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java @@ -7,30 +7,42 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function14; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row14; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; +import org.jooq.demo.java.db.Domains; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; import org.jooq.demo.java.db.enums.MpaaRating; +import org.jooq.demo.java.db.tables.Actor.ActorPath; +import org.jooq.demo.java.db.tables.Category.CategoryPath; +import org.jooq.demo.java.db.tables.FilmActor.FilmActorPath; +import org.jooq.demo.java.db.tables.FilmCategory.FilmCategoryPath; +import org.jooq.demo.java.db.tables.Inventory.InventoryPath; +import org.jooq.demo.java.db.tables.Language.LanguagePath; import org.jooq.demo.java.db.tables.records.FilmRecord; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -74,7 +86,7 @@ public Class getRecordType() { /** * The column public.film.release_year. */ - public final TableField RELEASE_YEAR = createField(DSL.name("release_year"), org.jooq.demo.java.db.Domains.YEAR.getDataType(), this, ""); + public final TableField RELEASE_YEAR = createField(DSL.name("release_year"), Domains.YEAR.getDataType(), this, ""); /** * The column public.film.language_id. @@ -109,7 +121,7 @@ public Class getRecordType() { /** * The column public.film.rating. */ - public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(org.jooq.demo.java.db.enums.MpaaRating.class), this, ""); + public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(MpaaRating.class), this, ""); /** * The column public.film.last_update. @@ -130,14 +142,14 @@ public Class getRecordType() { * configuration. */ @Deprecated - public final TableField FULLTEXT = createField(DSL.name("fulltext"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, ""); + public final TableField FULLTEXT = createField(DSL.name("fulltext"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, ""); private Film(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Film(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Film(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -161,8 +173,35 @@ public Film() { this(DSL.name("film"), null); } - public Film(Table child, ForeignKey key) { - super(child, key, FILM); + public Film(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, FILM); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class FilmPath extends Film implements Path { + public FilmPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private FilmPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public FilmPath as(String alias) { + return new FilmPath(DSL.name(alias), this); + } + + @Override + public FilmPath as(Name alias) { + return new FilmPath(alias, this); + } + + @Override + public FilmPath as(Table alias) { + return new FilmPath(alias.getQualifiedName(), this); + } } @Override @@ -190,31 +229,87 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.FILM__FILM_LANGUAGE_ID_FKEY, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY); } - private transient Language _filmLanguageIdFkey; - private transient Language _filmOriginalLanguageIdFkey; + private transient LanguagePath _filmLanguageIdFkey; /** * Get the implicit join path to the public.language table, via * the film_language_id_fkey key. */ - public Language filmLanguageIdFkey() { + public LanguagePath filmLanguageIdFkey() { if (_filmLanguageIdFkey == null) - _filmLanguageIdFkey = new Language(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY); + _filmLanguageIdFkey = new LanguagePath(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY, null); return _filmLanguageIdFkey; } + private transient LanguagePath _filmOriginalLanguageIdFkey; + /** * Get the implicit join path to the public.language table, via * the film_original_language_id_fkey key. */ - public Language filmOriginalLanguageIdFkey() { + public LanguagePath filmOriginalLanguageIdFkey() { if (_filmOriginalLanguageIdFkey == null) - _filmOriginalLanguageIdFkey = new Language(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY); + _filmOriginalLanguageIdFkey = new LanguagePath(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null); return _filmOriginalLanguageIdFkey; } + private transient FilmActorPath _filmActor; + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + public FilmActorPath filmActor() { + if (_filmActor == null) + _filmActor = new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY.getInverseKey()); + + return _filmActor; + } + + private transient FilmCategoryPath _filmCategory; + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + public FilmCategoryPath filmCategory() { + if (_filmCategory == null) + _filmCategory = new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY.getInverseKey()); + + return _filmCategory; + } + + private transient InventoryPath _inventory; + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + public InventoryPath inventory() { + if (_inventory == null) + _inventory = new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY.getInverseKey()); + + return _inventory; + } + + /** + * Get the implicit many-to-many join path to the public.actor + * table + */ + public ActorPath actor() { + return filmActor().actor(); + } + + /** + * Get the implicit many-to-many join path to the + * public.category table + */ + public CategoryPath category() { + return filmCategory().category(); + } + @Override public Film as(String alias) { return new Film(DSL.name(alias), this); @@ -254,27 +349,87 @@ public Film rename(Table name) { return new Film(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row14 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Condition condition) { + return new Film(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ @Override - public Row14 fieldsRow() { - return (Row14) super.fieldsRow(); + @PlainSQL + public Film where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function14 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Film where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function14 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public Film where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Film where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java index f61850c..4498a17 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java @@ -6,19 +6,23 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Index; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -26,6 +30,8 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Actor.ActorPath; +import org.jooq.demo.java.db.tables.Film.FilmPath; import org.jooq.demo.java.db.tables.records.FilmActorRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -69,11 +75,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private FilmActor(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private FilmActor(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private FilmActor(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -97,8 +103,35 @@ public FilmActor() { this(DSL.name("film_actor"), null); } - public FilmActor(Table child, ForeignKey key) { - super(child, key, FILM_ACTOR); + public FilmActor(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, FILM_ACTOR); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class FilmActorPath extends FilmActor implements Path { + public FilmActorPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private FilmActorPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public FilmActorPath as(String alias) { + return new FilmActorPath(DSL.name(alias), this); + } + + @Override + public FilmActorPath as(Name alias) { + return new FilmActorPath(alias, this); + } + + @Override + public FilmActorPath as(Table alias) { + return new FilmActorPath(alias.getQualifiedName(), this); + } } @Override @@ -121,25 +154,26 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY); } - private transient Actor _actor; - private transient Film _film; + private transient ActorPath _actor; /** * Get the implicit join path to the public.actor table. */ - public Actor actor() { + public ActorPath actor() { if (_actor == null) - _actor = new Actor(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY); + _actor = new ActorPath(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, null); return _actor; } + private transient FilmPath _film; + /** * Get the implicit join path to the public.film table. */ - public Film film() { + public FilmPath film() { if (_film == null) - _film = new Film(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY); + _film = new FilmPath(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY, null); return _film; } @@ -183,27 +217,87 @@ public FilmActor rename(Table name) { return new FilmActor(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor where(Condition condition) { + return new FilmActor(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor where(Condition... conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public FilmActor where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public FilmActor where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public FilmActor where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmActor where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmActor where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java index 199c87a..3b817a5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java @@ -6,24 +6,30 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Category.CategoryPath; +import org.jooq.demo.java.db.tables.Film.FilmPath; import org.jooq.demo.java.db.tables.records.FilmCategoryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -67,11 +73,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private FilmCategory(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private FilmCategory(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private FilmCategory(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -95,8 +101,35 @@ public FilmCategory() { this(DSL.name("film_category"), null); } - public FilmCategory(Table child, ForeignKey key) { - super(child, key, FILM_CATEGORY); + public FilmCategory(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, FILM_CATEGORY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class FilmCategoryPath extends FilmCategory implements Path { + public FilmCategoryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private FilmCategoryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public FilmCategoryPath as(String alias) { + return new FilmCategoryPath(DSL.name(alias), this); + } + + @Override + public FilmCategoryPath as(Name alias) { + return new FilmCategoryPath(alias, this); + } + + @Override + public FilmCategoryPath as(Table alias) { + return new FilmCategoryPath(alias.getQualifiedName(), this); + } } @Override @@ -114,25 +147,26 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY); } - private transient Film _film; - private transient Category _category; + private transient FilmPath _film; /** * Get the implicit join path to the public.film table. */ - public Film film() { + public FilmPath film() { if (_film == null) - _film = new Film(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY); + _film = new FilmPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, null); return _film; } + private transient CategoryPath _category; + /** * Get the implicit join path to the public.category table. */ - public Category category() { + public CategoryPath category() { if (_category == null) - _category = new Category(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY); + _category = new CategoryPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY, null); return _category; } @@ -176,27 +210,87 @@ public FilmCategory rename(Table name) { return new FilmCategory(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory where(Condition condition) { + return new FilmCategory(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory where(Condition... conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public FilmCategory where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public FilmCategory where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public FilmCategory where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmCategory where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmCategory where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java index c9380bf..d26e4f0 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java @@ -4,15 +4,10 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; - +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.Function1; import org.jooq.Name; -import org.jooq.Records; -import org.jooq.Row1; import org.jooq.Schema; -import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -57,7 +52,11 @@ private FilmInStock(Name alias, Table aliased) { } private FilmInStock(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + this(alias, aliased, parameters, null); + } + + private FilmInStock(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); } /** @@ -125,15 +124,6 @@ public FilmInStock rename(Table name) { return new FilmInStock(name.getQualifiedName(), null, parameters); } - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - /** * Call this table-valued function */ @@ -163,19 +153,4 @@ public FilmInStock call( return aliased() ? result.as(getUnqualifiedName()) : result; } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - public SelectField mapping(Function1 from) { - return convertFrom(Records.mapping(from)); - } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - public SelectField mapping(Class toType, Function1 from) { - return convertFrom(toType, Records.mapping(from)); - } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java index e0456ec..d6721c4 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function8; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -81,7 +81,7 @@ public Class getRecordType() { /** * The column public.film_list.rating. */ - public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.java.db.enums.MpaaRating.class), this, ""); + public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating.class), this, ""); /** * The column public.film_list.actors. @@ -89,10 +89,10 @@ public Class getRecordType() { public final TableField ACTORS = createField(DSL.name("actors"), SQLDataType.CLOB, this, ""); private FilmList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private FilmList(Name alias, Table aliased, Field[] parameters) { + private FilmList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "film_list" as SELECT film.film_id AS fid, film.title, @@ -108,7 +108,7 @@ LEFT JOIN film ON ((film_category.film_id = film.film_id))) JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """)); + """), where); } /** @@ -132,10 +132,6 @@ public FilmList() { this(DSL.name("film_list"), null); } - public FilmList(Table child, ForeignKey key) { - super(child, key, FILM_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -180,27 +176,87 @@ public FilmList rename(Table name) { return new FilmList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Condition condition) { + return new FilmList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public FilmList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + public FilmList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public FilmList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java index 3f57087..c10e519 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java @@ -4,15 +4,10 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; - +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.Function1; import org.jooq.Name; -import org.jooq.Records; -import org.jooq.Row1; import org.jooq.Schema; -import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -57,7 +52,11 @@ private FilmNotInStock(Name alias, Table aliased) { } private FilmNotInStock(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + this(alias, aliased, parameters, null); + } + + private FilmNotInStock(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); } /** @@ -125,15 +124,6 @@ public FilmNotInStock rename(Table name) { return new FilmNotInStock(name.getQualifiedName(), null, parameters); } - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - /** * Call this table-valued function */ @@ -163,19 +153,4 @@ public FilmNotInStock call( return aliased() ? result.as(getUnqualifiedName()) : result; } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - public SelectField mapping(Function1 from) { - return convertFrom(Records.mapping(from)); - } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - public SelectField mapping(Class toType, Function1 from) { - return convertFrom(toType, Records.mapping(from)); - } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java index 4c64bde..577c4dc 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,9 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.InventoryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -75,11 +82,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Inventory(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Inventory(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Inventory(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +110,35 @@ public Inventory() { this(DSL.name("inventory"), null); } - public Inventory(Table child, ForeignKey key) { - super(child, key, INVENTORY); + public Inventory(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, INVENTORY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class InventoryPath extends Inventory implements Path { + public InventoryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private InventoryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public InventoryPath as(String alias) { + return new InventoryPath(DSL.name(alias), this); + } + + @Override + public InventoryPath as(Name alias) { + return new InventoryPath(alias, this); + } + + @Override + public InventoryPath as(Table alias) { + return new InventoryPath(alias.getQualifiedName(), this); + } } @Override @@ -132,29 +166,43 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.INVENTORY__INVENTORY_FILM_ID_FKEY, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY); } - private transient Film _film; - private transient Store _store; + private transient FilmPath _film; /** * Get the implicit join path to the public.film table. */ - public Film film() { + public FilmPath film() { if (_film == null) - _film = new Film(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY); + _film = new FilmPath(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY, null); return _film; } + private transient StorePath _store; + /** * Get the implicit join path to the public.store table. */ - public Store store() { + public StorePath store() { if (_store == null) - _store = new Store(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY); + _store = new StorePath(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY, null); return _store; } + private transient RentalPath _rental; + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + public RentalPath rental() { + if (_rental == null) + _rental = new RentalPath(this, null, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY.getInverseKey()); + + return _rental; + } + @Override public Inventory as(String alias) { return new Inventory(DSL.name(alias), this); @@ -194,27 +242,87 @@ public Inventory rename(Table name) { return new Inventory(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Inventory where(Condition condition) { + return new Inventory(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Inventory where(Collection conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + public Inventory where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public Inventory where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public Inventory where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Inventory where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Inventory where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Inventory where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Inventory whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Inventory whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java index 8b916da..5b1f980 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java @@ -5,24 +5,29 @@ import java.time.LocalDateTime; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; import org.jooq.demo.java.db.tables.records.LanguageRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -66,11 +71,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Language(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Language(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Language(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -94,8 +99,35 @@ public Language() { this(DSL.name("language"), null); } - public Language(Table child, ForeignKey key) { - super(child, key, LANGUAGE); + public Language(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, LANGUAGE); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class LanguagePath extends Language implements Path { + public LanguagePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private LanguagePath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public LanguagePath as(String alias) { + return new LanguagePath(DSL.name(alias), this); + } + + @Override + public LanguagePath as(Name alias) { + return new LanguagePath(alias, this); + } + + @Override + public LanguagePath as(Table alias) { + return new LanguagePath(alias.getQualifiedName(), this); + } } @Override @@ -113,6 +145,32 @@ public UniqueKey getPrimaryKey() { return Keys.LANGUAGE_PKEY; } + private transient FilmPath _filmLanguageIdFkey; + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_language_id_fkey key + */ + public FilmPath filmLanguageIdFkey() { + if (_filmLanguageIdFkey == null) + _filmLanguageIdFkey = new FilmPath(this, null, Keys.FILM__FILM_LANGUAGE_ID_FKEY.getInverseKey()); + + return _filmLanguageIdFkey; + } + + private transient FilmPath _filmOriginalLanguageIdFkey; + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_original_language_id_fkey key + */ + public FilmPath filmOriginalLanguageIdFkey() { + if (_filmOriginalLanguageIdFkey == null) + _filmOriginalLanguageIdFkey = new FilmPath(this, null, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY.getInverseKey()); + + return _filmOriginalLanguageIdFkey; + } + @Override public Language as(String alias) { return new Language(DSL.name(alias), this); @@ -152,27 +210,87 @@ public Language rename(Table name) { return new Language(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Language where(Condition condition) { + return new Language(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Language where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public Language where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Language where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Language whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Language whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java index b3c57ec..fd9b865 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function8; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -81,7 +81,7 @@ public Class getRecordType() { /** * The column public.nicer_but_slower_film_list.rating. */ - public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.java.db.enums.MpaaRating.class), this, ""); + public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating.class), this, ""); /** * The column public.nicer_but_slower_film_list.actors. @@ -89,10 +89,10 @@ public Class getRecordType() { public final TableField ACTORS = createField(DSL.name("actors"), SQLDataType.CLOB, this, ""); private NicerButSlowerFilmList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private NicerButSlowerFilmList(Name alias, Table aliased, Field[] parameters) { + private NicerButSlowerFilmList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "nicer_but_slower_film_list" as SELECT film.film_id AS fid, film.title, @@ -108,7 +108,7 @@ LEFT JOIN film ON ((film_category.film_id = film.film_id))) JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """)); + """), where); } /** @@ -134,10 +134,6 @@ public NicerButSlowerFilmList() { this(DSL.name("nicer_but_slower_film_list"), null); } - public NicerButSlowerFilmList(Table child, ForeignKey key) { - super(child, key, NICER_BUT_SLOWER_FILM_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -182,27 +178,87 @@ public NicerButSlowerFilmList rename(Table name) { return new NicerButSlowerFilmList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Condition condition) { + return new NicerButSlowerFilmList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public NicerButSlowerFilmList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public NicerButSlowerFilmList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public NicerButSlowerFilmList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public NicerButSlowerFilmList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + public NicerButSlowerFilmList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public NicerButSlowerFilmList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java index aae065d..5b53284 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java @@ -7,20 +7,24 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,6 +32,9 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -86,11 +93,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private Payment(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Payment(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Payment(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -114,8 +121,35 @@ public Payment() { this(DSL.name("payment"), null); } - public Payment(Table child, ForeignKey key) { - super(child, key, PAYMENT); + public Payment(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentPath extends Payment implements Path { + public PaymentPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentPath as(String alias) { + return new PaymentPath(DSL.name(alias), this); + } + + @Override + public PaymentPath as(Name alias) { + return new PaymentPath(alias, this); + } + + @Override + public PaymentPath as(Table alias) { + return new PaymentPath(alias.getQualifiedName(), this); + } } @Override @@ -143,36 +177,38 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY, null); return _rental; } @@ -216,27 +252,87 @@ public Payment rename(Table name) { return new Payment(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Condition condition) { + return new Payment(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Payment where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Payment where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Payment where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public Payment where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public Payment whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Payment whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java index b31daba..f671637 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_01Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_01(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_01(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_01(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_01() { this(DSL.name("payment_p2007_01"), null); } - public PaymentP2007_01(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_01); + public PaymentP2007_01(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_01); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_01Path extends PaymentP2007_01 implements Path { + public PaymentP2007_01Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_01Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_01Path as(String alias) { + return new PaymentP2007_01Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_01Path as(Name alias) { + return new PaymentP2007_01Path(alias, this); + } + + @Override + public PaymentP2007_01Path as(Table alias) { + return new PaymentP2007_01Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_01 rename(Table name) { return new PaymentP2007_01(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Condition condition) { + return new PaymentP2007_01(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_01 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_01 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_01 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_01 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_01 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_01 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java index a63a351..f68f11f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_02Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_02(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_02(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_02(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_02() { this(DSL.name("payment_p2007_02"), null); } - public PaymentP2007_02(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_02); + public PaymentP2007_02(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_02); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_02Path extends PaymentP2007_02 implements Path { + public PaymentP2007_02Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_02Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_02Path as(String alias) { + return new PaymentP2007_02Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_02Path as(Name alias) { + return new PaymentP2007_02Path(alias, this); + } + + @Override + public PaymentP2007_02Path as(Table alias) { + return new PaymentP2007_02Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_02 rename(Table name) { return new PaymentP2007_02(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Condition condition) { + return new PaymentP2007_02(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_02 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_02 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_02 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_02 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_02 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_02 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java index 2f8ad14..2c3e0dc 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_03Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_03(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_03(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_03(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_03() { this(DSL.name("payment_p2007_03"), null); } - public PaymentP2007_03(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_03); + public PaymentP2007_03(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_03); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_03Path extends PaymentP2007_03 implements Path { + public PaymentP2007_03Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_03Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_03Path as(String alias) { + return new PaymentP2007_03Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_03Path as(Name alias) { + return new PaymentP2007_03Path(alias, this); + } + + @Override + public PaymentP2007_03Path as(Table alias) { + return new PaymentP2007_03Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_03 rename(Table name) { return new PaymentP2007_03(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Condition condition) { + return new PaymentP2007_03(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_03 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_03 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_03 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_03 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_03 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_03 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java index 162af87..068c6cb 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_04Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_04(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_04(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_04(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_04() { this(DSL.name("payment_p2007_04"), null); } - public PaymentP2007_04(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_04); + public PaymentP2007_04(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_04); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_04Path extends PaymentP2007_04 implements Path { + public PaymentP2007_04Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_04Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_04Path as(String alias) { + return new PaymentP2007_04Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_04Path as(Name alias) { + return new PaymentP2007_04Path(alias, this); + } + + @Override + public PaymentP2007_04Path as(Table alias) { + return new PaymentP2007_04Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_04 rename(Table name) { return new PaymentP2007_04(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Condition condition) { + return new PaymentP2007_04(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_04 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_04 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_04 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_04 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_04 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_04 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java index 44679d2..09fb199 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_05Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_05(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_05(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_05(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_05() { this(DSL.name("payment_p2007_05"), null); } - public PaymentP2007_05(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_05); + public PaymentP2007_05(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_05); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_05Path extends PaymentP2007_05 implements Path { + public PaymentP2007_05Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_05Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_05Path as(String alias) { + return new PaymentP2007_05Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_05Path as(Name alias) { + return new PaymentP2007_05Path(alias, this); + } + + @Override + public PaymentP2007_05Path as(Table alias) { + return new PaymentP2007_05Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_05 rename(Table name) { return new PaymentP2007_05(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Condition condition) { + return new PaymentP2007_05(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_05 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_05 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_05 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_05 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_05 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_05 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java index dc95a6c..7c9b51c 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_06Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_06(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_06(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_06(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_06() { this(DSL.name("payment_p2007_06"), null); } - public PaymentP2007_06(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_06); + public PaymentP2007_06(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_06); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_06Path extends PaymentP2007_06 implements Path { + public PaymentP2007_06Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_06Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_06Path as(String alias) { + return new PaymentP2007_06Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_06Path as(Name alias) { + return new PaymentP2007_06Path(alias, this); + } + + @Override + public PaymentP2007_06Path as(Table alias) { + return new PaymentP2007_06Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_06 rename(Table name) { return new PaymentP2007_06(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Condition condition) { + return new PaymentP2007_06(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_06 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_06 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_06 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_06 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_06 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_06 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java index 4b2d42d..361ae9a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function7; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row7; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,16 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Inventory.InventoryPath; +import org.jooq.demo.java.db.tables.Payment.PaymentPath; +import org.jooq.demo.java.db.tables.PaymentP2007_01.PaymentP2007_01Path; +import org.jooq.demo.java.db.tables.PaymentP2007_02.PaymentP2007_02Path; +import org.jooq.demo.java.db.tables.PaymentP2007_03.PaymentP2007_03Path; +import org.jooq.demo.java.db.tables.PaymentP2007_04.PaymentP2007_04Path; +import org.jooq.demo.java.db.tables.PaymentP2007_05.PaymentP2007_05Path; +import org.jooq.demo.java.db.tables.PaymentP2007_06.PaymentP2007_06Path; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.RentalRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -90,11 +104,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Rental(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Rental(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Rental(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -118,8 +132,35 @@ public Rental() { this(DSL.name("rental"), null); } - public Rental(Table child, ForeignKey key) { - super(child, key, RENTAL); + public Rental(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, RENTAL); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class RentalPath extends Rental implements Path { + public RentalPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private RentalPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public RentalPath as(String alias) { + return new RentalPath(DSL.name(alias), this); + } + + @Override + public RentalPath as(Name alias) { + return new RentalPath(alias, this); + } + + @Override + public RentalPath as(Table alias) { + return new RentalPath(alias.getQualifiedName(), this); + } } @Override @@ -147,40 +188,133 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY, Keys.RENTAL__RENTAL_STAFF_ID_FKEY); } - private transient Inventory _inventory; - private transient Customer _customer; - private transient Staff _staff; + private transient InventoryPath _inventory; /** * Get the implicit join path to the public.inventory table. */ - public Inventory inventory() { + public InventoryPath inventory() { if (_inventory == null) - _inventory = new Inventory(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY); + _inventory = new InventoryPath(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY, null); return _inventory; } + private transient CustomerPath _customer; + /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY, null); return _staff; } + private transient PaymentPath _payment; + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + public PaymentPath payment() { + if (_payment == null) + _payment = new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY.getInverseKey()); + + return _payment; + } + + private transient PaymentP2007_01Path _paymentP2007_01; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + public PaymentP2007_01Path paymentP2007_01() { + if (_paymentP2007_01 == null) + _paymentP2007_01 = new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_01; + } + + private transient PaymentP2007_02Path _paymentP2007_02; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + public PaymentP2007_02Path paymentP2007_02() { + if (_paymentP2007_02 == null) + _paymentP2007_02 = new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_02; + } + + private transient PaymentP2007_03Path _paymentP2007_03; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + public PaymentP2007_03Path paymentP2007_03() { + if (_paymentP2007_03 == null) + _paymentP2007_03 = new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_03; + } + + private transient PaymentP2007_04Path _paymentP2007_04; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + public PaymentP2007_04Path paymentP2007_04() { + if (_paymentP2007_04 == null) + _paymentP2007_04 = new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_04; + } + + private transient PaymentP2007_05Path _paymentP2007_05; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + public PaymentP2007_05Path paymentP2007_05() { + if (_paymentP2007_05 == null) + _paymentP2007_05 = new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_05; + } + + private transient PaymentP2007_06Path _paymentP2007_06; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + public PaymentP2007_06Path paymentP2007_06() { + if (_paymentP2007_06 == null) + _paymentP2007_06 = new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_06; + } + @Override public Rental as(String alias) { return new Rental(DSL.name(alias), this); @@ -220,27 +354,87 @@ public Rental rename(Table name) { return new Rental(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Rental where(Condition condition) { + return new Rental(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental where(Condition... conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); + public Rental where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function7 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Rental where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function7 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public Rental where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Rental where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Rental where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java index b719268..c48fd86 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java @@ -7,16 +7,12 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.Function10; import org.jooq.Identity; import org.jooq.Name; -import org.jooq.Records; -import org.jooq.Row10; import org.jooq.Schema; -import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -106,7 +102,11 @@ private RewardsReport(Name alias, Table aliased) { } private RewardsReport(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + this(alias, aliased, parameters, null); + } + + private RewardsReport(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); } /** @@ -179,15 +179,6 @@ public RewardsReport rename(Table name) { return new RewardsReport(name.getQualifiedName(), null, parameters); } - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - - @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); - } - /** * Call this table-valued function */ @@ -217,19 +208,4 @@ public RewardsReport call( return aliased() ? result.as(getUnqualifiedName()) : result; } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - public SelectField mapping(Function10 from) { - return convertFrom(Records.mapping(from)); - } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - public SelectField mapping(Class toType, Function10 from) { - return convertFrom(toType, Records.mapping(from)); - } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java index 810d757..4943404 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function2; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row2; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -58,10 +58,10 @@ public Class getRecordType() { public final TableField TOTAL_SALES = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, ""); private SalesByFilmCategory(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private SalesByFilmCategory(Name alias, Table aliased, Field[] parameters) { + private SalesByFilmCategory(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "sales_by_film_category" as SELECT c.name AS category, sum(p.amount) AS total_sales @@ -73,7 +73,7 @@ JOIN film_category fc ON ((f.film_id = fc.film_id))) JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY (sum(p.amount)) DESC; - """)); + """), where); } /** @@ -99,10 +99,6 @@ public SalesByFilmCategory() { this(DSL.name("sales_by_film_category"), null); } - public SalesByFilmCategory(Table child, ForeignKey key) { - super(child, key, SALES_BY_FILM_CATEGORY); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -147,27 +143,87 @@ public SalesByFilmCategory rename(Table name) { return new SalesByFilmCategory(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Condition condition) { + return new SalesByFilmCategory(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByFilmCategory where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByFilmCategory where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByFilmCategory where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); + @PlainSQL + public SalesByFilmCategory where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function2 from) { - return convertFrom(Records.mapping(from)); + @Override + public SalesByFilmCategory whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function2 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public SalesByFilmCategory whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java index a9aa12c..e986a34 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -63,10 +63,10 @@ public Class getRecordType() { public final TableField TOTAL_SALES = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, ""); private SalesByStore(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private SalesByStore(Name alias, Table aliased, Field[] parameters) { + private SalesByStore(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "sales_by_store" as SELECT (((c.city)::text || ','::text) || (cy.country)::text) AS store, (((m.first_name)::text || ' '::text) || (m.last_name)::text) AS manager, @@ -81,7 +81,7 @@ JOIN country cy ON ((c.country_id = cy.country_id))) JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city; - """)); + """), where); } /** @@ -105,10 +105,6 @@ public SalesByStore() { this(DSL.name("sales_by_store"), null); } - public SalesByStore(Table child, ForeignKey key) { - super(child, key, SALES_BY_STORE); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -153,27 +149,87 @@ public SalesByStore rename(Table name) { return new SalesByStore(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Condition condition) { + return new SalesByStore(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByStore where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByStore where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByStore where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + @PlainSQL + public SalesByStore where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public SalesByStore whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public SalesByStore whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java index 50aebca..0f8301a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java @@ -6,25 +6,39 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function11; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row11; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Payment.PaymentPath; +import org.jooq.demo.java.db.tables.PaymentP2007_01.PaymentP2007_01Path; +import org.jooq.demo.java.db.tables.PaymentP2007_02.PaymentP2007_02Path; +import org.jooq.demo.java.db.tables.PaymentP2007_03.PaymentP2007_03Path; +import org.jooq.demo.java.db.tables.PaymentP2007_04.PaymentP2007_04Path; +import org.jooq.demo.java.db.tables.PaymentP2007_05.PaymentP2007_05Path; +import org.jooq.demo.java.db.tables.PaymentP2007_06.PaymentP2007_06Path; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.StaffRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -108,11 +122,11 @@ public Class getRecordType() { public final TableField PICTURE = createField(DSL.name("picture"), SQLDataType.BLOB, this, ""); private Staff(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Staff(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Staff(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -136,8 +150,35 @@ public Staff() { this(DSL.name("staff"), null); } - public Staff(Table child, ForeignKey key) { - super(child, key, STAFF); + public Staff(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, STAFF); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class StaffPath extends Staff implements Path { + public StaffPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private StaffPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public StaffPath as(String alias) { + return new StaffPath(DSL.name(alias), this); + } + + @Override + public StaffPath as(Name alias) { + return new StaffPath(alias, this); + } + + @Override + public StaffPath as(Table alias) { + return new StaffPath(alias.getQualifiedName(), this); + } } @Override @@ -160,29 +201,134 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.STAFF__STAFF_ADDRESS_ID_FKEY, Keys.STAFF__STAFF_STORE_ID_FKEY); } - private transient Address _address; - private transient Store _store; + private transient AddressPath _address; /** * Get the implicit join path to the public.address table. */ - public Address address() { + public AddressPath address() { if (_address == null) - _address = new Address(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY); + _address = new AddressPath(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY, null); return _address; } + private transient StorePath _store; + /** * Get the implicit join path to the public.store table. */ - public Store store() { + public StorePath store() { if (_store == null) - _store = new Store(this, Keys.STAFF__STAFF_STORE_ID_FKEY); + _store = new StorePath(this, Keys.STAFF__STAFF_STORE_ID_FKEY, null); return _store; } + private transient PaymentPath _payment; + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + public PaymentPath payment() { + if (_payment == null) + _payment = new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY.getInverseKey()); + + return _payment; + } + + private transient PaymentP2007_01Path _paymentP2007_01; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + public PaymentP2007_01Path paymentP2007_01() { + if (_paymentP2007_01 == null) + _paymentP2007_01 = new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_01; + } + + private transient PaymentP2007_02Path _paymentP2007_02; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + public PaymentP2007_02Path paymentP2007_02() { + if (_paymentP2007_02 == null) + _paymentP2007_02 = new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_02; + } + + private transient PaymentP2007_03Path _paymentP2007_03; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + public PaymentP2007_03Path paymentP2007_03() { + if (_paymentP2007_03 == null) + _paymentP2007_03 = new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_03; + } + + private transient PaymentP2007_04Path _paymentP2007_04; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + public PaymentP2007_04Path paymentP2007_04() { + if (_paymentP2007_04 == null) + _paymentP2007_04 = new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_04; + } + + private transient PaymentP2007_05Path _paymentP2007_05; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + public PaymentP2007_05Path paymentP2007_05() { + if (_paymentP2007_05 == null) + _paymentP2007_05 = new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_05; + } + + private transient PaymentP2007_06Path _paymentP2007_06; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + public PaymentP2007_06Path paymentP2007_06() { + if (_paymentP2007_06 == null) + _paymentP2007_06 = new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_06; + } + + private transient RentalPath _rental; + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + public RentalPath rental() { + if (_rental == null) + _rental = new RentalPath(this, null, Keys.RENTAL__RENTAL_STAFF_ID_FKEY.getInverseKey()); + + return _rental; + } + @Override public Staff as(String alias) { return new Staff(DSL.name(alias), this); @@ -222,27 +368,87 @@ public Staff rename(Table name) { return new Staff(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Staff where(Condition condition) { + return new Staff(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); + public Staff where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function11 from) { - return convertFrom(Records.mapping(from)); + @Override + public Staff where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function11 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Staff where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Staff whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Staff whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java index 066faff..88e16fb 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java @@ -4,17 +4,17 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function8; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -87,10 +87,10 @@ public Class getRecordType() { public final TableField SID = createField(DSL.name("sid"), SQLDataType.BIGINT, this, ""); private StaffList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private StaffList(Name alias, Table aliased, Field[] parameters) { + private StaffList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "staff_list" as SELECT s.staff_id AS id, (((s.first_name)::text || ' '::text) || (s.last_name)::text) AS name, @@ -104,7 +104,7 @@ private StaffList(Name alias, Table aliased, Field[] paramet JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """)); + """), where); } /** @@ -128,10 +128,6 @@ public StaffList() { this(DSL.name("staff_list"), null); } - public StaffList(Table child, ForeignKey key) { - super(child, key, STAFF_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -176,27 +172,87 @@ public StaffList rename(Table name) { return new StaffList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Condition condition) { + return new StaffList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public StaffList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public StaffList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public StaffList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public StaffList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + public StaffList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public StaffList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java index 27c6020..22a827b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,10 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Inventory.InventoryPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.StoreRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -75,11 +83,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Store(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Store(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Store(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +111,35 @@ public Store() { this(DSL.name("store"), null); } - public Store(Table child, ForeignKey key) { - super(child, key, STORE); + public Store(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, STORE); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class StorePath extends Store implements Path { + public StorePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private StorePath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public StorePath as(String alias) { + return new StorePath(DSL.name(alias), this); + } + + @Override + public StorePath as(Name alias) { + return new StorePath(alias, this); + } + + @Override + public StorePath as(Table alias) { + return new StorePath(alias.getQualifiedName(), this); + } } @Override @@ -132,29 +167,56 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY, Keys.STORE__STORE_ADDRESS_ID_FKEY); } - private transient Staff _staff; - private transient Address _address; + private transient StaffPath _staff; /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY, null); return _staff; } + private transient AddressPath _address; + /** * Get the implicit join path to the public.address table. */ - public Address address() { + public AddressPath address() { if (_address == null) - _address = new Address(this, Keys.STORE__STORE_ADDRESS_ID_FKEY); + _address = new AddressPath(this, Keys.STORE__STORE_ADDRESS_ID_FKEY, null); return _address; } + private transient CustomerPath _customer; + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + public CustomerPath customer() { + if (_customer == null) + _customer = new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY.getInverseKey()); + + return _customer; + } + + private transient InventoryPath _inventory; + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + public InventoryPath inventory() { + if (_inventory == null) + _inventory = new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY.getInverseKey()); + + return _inventory; + } + @Override public Store as(String alias) { return new Store(DSL.name(alias), this); @@ -194,27 +256,87 @@ public Store rename(Table name) { return new Store(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Store where(Condition condition) { + return new Store(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + public Store where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public Store where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Store where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Store whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Store whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java index 72e0e5f..7740837 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.ActorInfo; import org.jooq.impl.TableRecordImpl; @@ -15,7 +12,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class ActorInfoRecord extends TableRecordImpl implements Record4 { +public class ActorInfoRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -75,113 +72,6 @@ public String getFilmInfo() { return (String) get(3); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return ActorInfo.ACTOR_INFO.ACTOR_ID; - } - - @Override - public Field field2() { - return ActorInfo.ACTOR_INFO.FIRST_NAME; - } - - @Override - public Field field3() { - return ActorInfo.ACTOR_INFO.LAST_NAME; - } - - @Override - public Field field4() { - return ActorInfo.ACTOR_INFO.FILM_INFO; - } - - @Override - public Long component1() { - return getActorId(); - } - - @Override - public String component2() { - return getFirstName(); - } - - @Override - public String component3() { - return getLastName(); - } - - @Override - public String component4() { - return getFilmInfo(); - } - - @Override - public Long value1() { - return getActorId(); - } - - @Override - public String value2() { - return getFirstName(); - } - - @Override - public String value3() { - return getLastName(); - } - - @Override - public String value4() { - return getFilmInfo(); - } - - @Override - public ActorInfoRecord value1(Long value) { - setActorId(value); - return this; - } - - @Override - public ActorInfoRecord value2(String value) { - setFirstName(value); - return this; - } - - @Override - public ActorInfoRecord value3(String value) { - setLastName(value); - return this; - } - - @Override - public ActorInfoRecord value4(String value) { - setFilmInfo(value); - return this; - } - - @Override - public ActorInfoRecord values(Long value1, String value2, String value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java index 95df2fc..0c0fe02 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.Actor; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class ActorRecord extends UpdatableRecordImpl implements Record4 { +public class ActorRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return Actor.ACTOR.ACTOR_ID; - } - - @Override - public Field field2() { - return Actor.ACTOR.FIRST_NAME; - } - - @Override - public Field field3() { - return Actor.ACTOR.LAST_NAME; - } - - @Override - public Field field4() { - return Actor.ACTOR.LAST_UPDATE; - } - - @Override - public Long component1() { - return getActorId(); - } - - @Override - public String component2() { - return getFirstName(); - } - - @Override - public String component3() { - return getLastName(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getActorId(); - } - - @Override - public String value2() { - return getFirstName(); - } - - @Override - public String value3() { - return getLastName(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public ActorRecord value1(Long value) { - setActorId(value); - return this; - } - - @Override - public ActorRecord value2(String value) { - setFirstName(value); - return this; - } - - @Override - public ActorRecord value3(String value) { - setLastName(value); - return this; - } - - @Override - public ActorRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public ActorRecord values(Long value1, String value2, String value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java index 8a67c4c..dd82258 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.tables.Address; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class AddressRecord extends UpdatableRecordImpl implements Record8 { +public class AddressRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -143,201 +140,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return Address.ADDRESS.ADDRESS_ID; - } - - @Override - public Field field2() { - return Address.ADDRESS.ADDRESS_; - } - - @Override - public Field field3() { - return Address.ADDRESS.ADDRESS2; - } - - @Override - public Field field4() { - return Address.ADDRESS.DISTRICT; - } - - @Override - public Field field5() { - return Address.ADDRESS.CITY_ID; - } - - @Override - public Field field6() { - return Address.ADDRESS.POSTAL_CODE; - } - - @Override - public Field field7() { - return Address.ADDRESS.PHONE; - } - - @Override - public Field field8() { - return Address.ADDRESS.LAST_UPDATE; - } - - @Override - public Long component1() { - return getAddressId(); - } - - @Override - public String component2() { - return getAddress(); - } - - @Override - public String component3() { - return getAddress2(); - } - - @Override - public String component4() { - return getDistrict(); - } - - @Override - public Long component5() { - return getCityId(); - } - - @Override - public String component6() { - return getPostalCode(); - } - - @Override - public String component7() { - return getPhone(); - } - - @Override - public LocalDateTime component8() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getAddressId(); - } - - @Override - public String value2() { - return getAddress(); - } - - @Override - public String value3() { - return getAddress2(); - } - - @Override - public String value4() { - return getDistrict(); - } - - @Override - public Long value5() { - return getCityId(); - } - - @Override - public String value6() { - return getPostalCode(); - } - - @Override - public String value7() { - return getPhone(); - } - - @Override - public LocalDateTime value8() { - return getLastUpdate(); - } - - @Override - public AddressRecord value1(Long value) { - setAddressId(value); - return this; - } - - @Override - public AddressRecord value2(String value) { - setAddress(value); - return this; - } - - @Override - public AddressRecord value3(String value) { - setAddress2(value); - return this; - } - - @Override - public AddressRecord value4(String value) { - setDistrict(value); - return this; - } - - @Override - public AddressRecord value5(Long value) { - setCityId(value); - return this; - } - - @Override - public AddressRecord value6(String value) { - setPostalCode(value); - return this; - } - - @Override - public AddressRecord value7(String value) { - setPhone(value); - return this; - } - - @Override - public AddressRecord value8(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public AddressRecord values(Long value1, String value2, String value3, String value4, Long value5, String value6, String value7, LocalDateTime value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java index 132792f..a9f81cc 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.Category; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class CategoryRecord extends UpdatableRecordImpl implements Record3 { +public class CategoryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return Category.CATEGORY.CATEGORY_ID; - } - - @Override - public Field field2() { - return Category.CATEGORY.NAME; - } - - @Override - public Field field3() { - return Category.CATEGORY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getCategoryId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getCategoryId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public CategoryRecord value1(Long value) { - setCategoryId(value); - return this; - } - - @Override - public CategoryRecord value2(String value) { - setName(value); - return this; - } - - @Override - public CategoryRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CategoryRecord values(Long value1, String value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java index 7c5ea07..c58b8d1 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.City; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class CityRecord extends UpdatableRecordImpl implements Record4 { +public class CityRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return City.CITY.CITY_ID; - } - - @Override - public Field field2() { - return City.CITY.CITY_; - } - - @Override - public Field field3() { - return City.CITY.COUNTRY_ID; - } - - @Override - public Field field4() { - return City.CITY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getCityId(); - } - - @Override - public String component2() { - return getCity(); - } - - @Override - public Long component3() { - return getCountryId(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getCityId(); - } - - @Override - public String value2() { - return getCity(); - } - - @Override - public Long value3() { - return getCountryId(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public CityRecord value1(Long value) { - setCityId(value); - return this; - } - - @Override - public CityRecord value2(String value) { - setCity(value); - return this; - } - - @Override - public CityRecord value3(Long value) { - setCountryId(value); - return this; - } - - @Override - public CityRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CityRecord values(Long value1, String value2, Long value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java index aee92bc..904f4cd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.Country; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class CountryRecord extends UpdatableRecordImpl implements Record3 { +public class CountryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return Country.COUNTRY.COUNTRY_ID; - } - - @Override - public Field field2() { - return Country.COUNTRY.COUNTRY_; - } - - @Override - public Field field3() { - return Country.COUNTRY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getCountryId(); - } - - @Override - public String component2() { - return getCountry(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getCountryId(); - } - - @Override - public String value2() { - return getCountry(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public CountryRecord value1(Long value) { - setCountryId(value); - return this; - } - - @Override - public CountryRecord value2(String value) { - setCountry(value); - return this; - } - - @Override - public CountryRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CountryRecord values(Long value1, String value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java index ce04e4f..67f72f2 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record9; -import org.jooq.Row9; import org.jooq.demo.java.db.tables.CustomerList; import org.jooq.impl.TableRecordImpl; @@ -15,7 +12,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class CustomerListRecord extends TableRecordImpl implements Record9 { +public class CustomerListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -145,223 +142,6 @@ public Long getSid() { return (Long) get(8); } - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return CustomerList.CUSTOMER_LIST.ID; - } - - @Override - public Field field2() { - return CustomerList.CUSTOMER_LIST.NAME; - } - - @Override - public Field field3() { - return CustomerList.CUSTOMER_LIST.ADDRESS; - } - - @Override - public Field field4() { - return CustomerList.CUSTOMER_LIST.ZIP_CODE; - } - - @Override - public Field field5() { - return CustomerList.CUSTOMER_LIST.PHONE; - } - - @Override - public Field field6() { - return CustomerList.CUSTOMER_LIST.CITY; - } - - @Override - public Field field7() { - return CustomerList.CUSTOMER_LIST.COUNTRY; - } - - @Override - public Field field8() { - return CustomerList.CUSTOMER_LIST.NOTES; - } - - @Override - public Field field9() { - return CustomerList.CUSTOMER_LIST.SID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getAddress(); - } - - @Override - public String component4() { - return getZipCode(); - } - - @Override - public String component5() { - return getPhone(); - } - - @Override - public String component6() { - return getCity(); - } - - @Override - public String component7() { - return getCountry(); - } - - @Override - public String component8() { - return getNotes(); - } - - @Override - public Long component9() { - return getSid(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getAddress(); - } - - @Override - public String value4() { - return getZipCode(); - } - - @Override - public String value5() { - return getPhone(); - } - - @Override - public String value6() { - return getCity(); - } - - @Override - public String value7() { - return getCountry(); - } - - @Override - public String value8() { - return getNotes(); - } - - @Override - public Long value9() { - return getSid(); - } - - @Override - public CustomerListRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public CustomerListRecord value2(String value) { - setName(value); - return this; - } - - @Override - public CustomerListRecord value3(String value) { - setAddress(value); - return this; - } - - @Override - public CustomerListRecord value4(String value) { - setZipCode(value); - return this; - } - - @Override - public CustomerListRecord value5(String value) { - setPhone(value); - return this; - } - - @Override - public CustomerListRecord value6(String value) { - setCity(value); - return this; - } - - @Override - public CustomerListRecord value7(String value) { - setCountry(value); - return this; - } - - @Override - public CustomerListRecord value8(String value) { - setNotes(value); - return this; - } - - @Override - public CustomerListRecord value9(Long value) { - setSid(value); - return this; - } - - @Override - public CustomerListRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, Long value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java index 44b7f93..00aa9b8 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java @@ -7,10 +7,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record10; -import org.jooq.Row10; import org.jooq.demo.java.db.tables.Customer; import org.jooq.impl.UpdatableRecordImpl; @@ -19,7 +16,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class CustomerRecord extends UpdatableRecordImpl implements Record10 { +public class CustomerRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -172,245 +169,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); - } - - @Override - public Row10 valuesRow() { - return (Row10) super.valuesRow(); - } - - @Override - public Field field1() { - return Customer.CUSTOMER.CUSTOMER_ID; - } - - @Override - public Field field2() { - return Customer.CUSTOMER.STORE_ID; - } - - @Override - public Field field3() { - return Customer.CUSTOMER.FIRST_NAME; - } - - @Override - public Field field4() { - return Customer.CUSTOMER.LAST_NAME; - } - - @Override - public Field field5() { - return Customer.CUSTOMER.EMAIL; - } - - @Override - public Field field6() { - return Customer.CUSTOMER.ADDRESS_ID; - } - - @Override - public Field field7() { - return Customer.CUSTOMER.ACTIVEBOOL; - } - - @Override - public Field field8() { - return Customer.CUSTOMER.CREATE_DATE; - } - - @Override - public Field field9() { - return Customer.CUSTOMER.LAST_UPDATE; - } - - @Override - public Field field10() { - return Customer.CUSTOMER.ACTIVE; - } - - @Override - public Long component1() { - return getCustomerId(); - } - - @Override - public Long component2() { - return getStoreId(); - } - - @Override - public String component3() { - return getFirstName(); - } - - @Override - public String component4() { - return getLastName(); - } - - @Override - public String component5() { - return getEmail(); - } - - @Override - public Long component6() { - return getAddressId(); - } - - @Override - public Boolean component7() { - return getActivebool(); - } - - @Override - public LocalDate component8() { - return getCreateDate(); - } - - @Override - public LocalDateTime component9() { - return getLastUpdate(); - } - - @Override - public Integer component10() { - return getActive(); - } - - @Override - public Long value1() { - return getCustomerId(); - } - - @Override - public Long value2() { - return getStoreId(); - } - - @Override - public String value3() { - return getFirstName(); - } - - @Override - public String value4() { - return getLastName(); - } - - @Override - public String value5() { - return getEmail(); - } - - @Override - public Long value6() { - return getAddressId(); - } - - @Override - public Boolean value7() { - return getActivebool(); - } - - @Override - public LocalDate value8() { - return getCreateDate(); - } - - @Override - public LocalDateTime value9() { - return getLastUpdate(); - } - - @Override - public Integer value10() { - return getActive(); - } - - @Override - public CustomerRecord value1(Long value) { - setCustomerId(value); - return this; - } - - @Override - public CustomerRecord value2(Long value) { - setStoreId(value); - return this; - } - - @Override - public CustomerRecord value3(String value) { - setFirstName(value); - return this; - } - - @Override - public CustomerRecord value4(String value) { - setLastName(value); - return this; - } - - @Override - public CustomerRecord value5(String value) { - setEmail(value); - return this; - } - - @Override - public CustomerRecord value6(Long value) { - setAddressId(value); - return this; - } - - @Override - public CustomerRecord value7(Boolean value) { - setActivebool(value); - return this; - } - - @Override - public CustomerRecord value8(LocalDate value) { - setCreateDate(value); - return this; - } - - @Override - public CustomerRecord value9(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CustomerRecord value10(Integer value) { - setActive(value); - return this; - } - - @Override - public CustomerRecord values(Long value1, Long value2, String value3, String value4, String value5, Long value6, Boolean value7, LocalDate value8, LocalDateTime value9, Integer value10) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java index 012c94b..98ad01f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record2; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.FilmActor; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class FilmActorRecord extends UpdatableRecordImpl implements Record3 { +public class FilmActorRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record2 key() { return (Record2) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmActor.FILM_ACTOR.ACTOR_ID; - } - - @Override - public Field field2() { - return FilmActor.FILM_ACTOR.FILM_ID; - } - - @Override - public Field field3() { - return FilmActor.FILM_ACTOR.LAST_UPDATE; - } - - @Override - public Long component1() { - return getActorId(); - } - - @Override - public Long component2() { - return getFilmId(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getActorId(); - } - - @Override - public Long value2() { - return getFilmId(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public FilmActorRecord value1(Long value) { - setActorId(value); - return this; - } - - @Override - public FilmActorRecord value2(Long value) { - setFilmId(value); - return this; - } - - @Override - public FilmActorRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public FilmActorRecord values(Long value1, Long value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java index 6c66657..a7174fb 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record2; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.FilmCategory; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class FilmCategoryRecord extends UpdatableRecordImpl implements Record3 { +public class FilmCategoryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record2 key() { return (Record2) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmCategory.FILM_CATEGORY.FILM_ID; - } - - @Override - public Field field2() { - return FilmCategory.FILM_CATEGORY.CATEGORY_ID; - } - - @Override - public Field field3() { - return FilmCategory.FILM_CATEGORY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getFilmId(); - } - - @Override - public Long component2() { - return getCategoryId(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getFilmId(); - } - - @Override - public Long value2() { - return getCategoryId(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public FilmCategoryRecord value1(Long value) { - setFilmId(value); - return this; - } - - @Override - public FilmCategoryRecord value2(Long value) { - setCategoryId(value); - return this; - } - - @Override - public FilmCategoryRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public FilmCategoryRecord values(Long value1, Long value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java index ea57736..be5d185 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Row1; import org.jooq.demo.java.db.tables.FilmInStock; import org.jooq.impl.TableRecordImpl; @@ -15,7 +12,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class FilmInStockRecord extends TableRecordImpl implements Record1 { +public class FilmInStockRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -33,47 +30,6 @@ public Integer getPFilmCount() { return (Integer) get(0); } - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - - @Override - public Row1 valuesRow() { - return (Row1) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmInStock.FILM_IN_STOCK.P_FILM_COUNT; - } - - @Override - public Integer component1() { - return getPFilmCount(); - } - - @Override - public Integer value1() { - return getPFilmCount(); - } - - @Override - public FilmInStockRecord value1(Integer value) { - setPFilmCount(value); - return this; - } - - @Override - public FilmInStockRecord values(Integer value1) { - value1(value1); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java index d2e94cd..337a9bb 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.enums.MpaaRating; import org.jooq.demo.java.db.tables.FilmList; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class FilmListRecord extends TableRecordImpl implements Record8 { +public class FilmListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -134,201 +131,6 @@ public String getActors() { return (String) get(7); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmList.FILM_LIST.FID; - } - - @Override - public Field field2() { - return FilmList.FILM_LIST.TITLE; - } - - @Override - public Field field3() { - return FilmList.FILM_LIST.DESCRIPTION; - } - - @Override - public Field field4() { - return FilmList.FILM_LIST.CATEGORY; - } - - @Override - public Field field5() { - return FilmList.FILM_LIST.PRICE; - } - - @Override - public Field field6() { - return FilmList.FILM_LIST.LENGTH; - } - - @Override - public Field field7() { - return FilmList.FILM_LIST.RATING; - } - - @Override - public Field field8() { - return FilmList.FILM_LIST.ACTORS; - } - - @Override - public Long component1() { - return getFid(); - } - - @Override - public String component2() { - return getTitle(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public String component4() { - return getCategory(); - } - - @Override - public BigDecimal component5() { - return getPrice(); - } - - @Override - public Short component6() { - return getLength(); - } - - @Override - public MpaaRating component7() { - return getRating(); - } - - @Override - public String component8() { - return getActors(); - } - - @Override - public Long value1() { - return getFid(); - } - - @Override - public String value2() { - return getTitle(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public String value4() { - return getCategory(); - } - - @Override - public BigDecimal value5() { - return getPrice(); - } - - @Override - public Short value6() { - return getLength(); - } - - @Override - public MpaaRating value7() { - return getRating(); - } - - @Override - public String value8() { - return getActors(); - } - - @Override - public FilmListRecord value1(Long value) { - setFid(value); - return this; - } - - @Override - public FilmListRecord value2(String value) { - setTitle(value); - return this; - } - - @Override - public FilmListRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public FilmListRecord value4(String value) { - setCategory(value); - return this; - } - - @Override - public FilmListRecord value5(BigDecimal value) { - setPrice(value); - return this; - } - - @Override - public FilmListRecord value6(Short value) { - setLength(value); - return this; - } - - @Override - public FilmListRecord value7(MpaaRating value) { - setRating(value); - return this; - } - - @Override - public FilmListRecord value8(String value) { - setActors(value); - return this; - } - - @Override - public FilmListRecord values(Long value1, String value2, String value3, String value4, BigDecimal value5, Short value6, MpaaRating value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java index c8b448e..a1fe811 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Row1; import org.jooq.demo.java.db.tables.FilmNotInStock; import org.jooq.impl.TableRecordImpl; @@ -15,7 +12,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class FilmNotInStockRecord extends TableRecordImpl implements Record1 { +public class FilmNotInStockRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -33,47 +30,6 @@ public Integer getPFilmCount() { return (Integer) get(0); } - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - - @Override - public Row1 valuesRow() { - return (Row1) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmNotInStock.FILM_NOT_IN_STOCK.P_FILM_COUNT; - } - - @Override - public Integer component1() { - return getPFilmCount(); - } - - @Override - public Integer value1() { - return getPFilmCount(); - } - - @Override - public FilmNotInStockRecord value1(Integer value) { - setPFilmCount(value); - return this; - } - - @Override - public FilmNotInStockRecord values(Integer value1) { - value1(value1); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java index fd934eb..34f1d16 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java @@ -7,10 +7,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record14; -import org.jooq.Row14; import org.jooq.demo.java.db.enums.MpaaRating; import org.jooq.demo.java.db.tables.Film; import org.jooq.impl.UpdatableRecordImpl; @@ -20,7 +17,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class FilmRecord extends UpdatableRecordImpl implements Record14 { +public class FilmRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -241,369 +238,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row14 fieldsRow() { - return (Row14) super.fieldsRow(); - } - - @Override - public Row14 valuesRow() { - return (Row14) super.valuesRow(); - } - - @Override - public Field field1() { - return Film.FILM.FILM_ID; - } - - @Override - public Field field2() { - return Film.FILM.TITLE; - } - - @Override - public Field field3() { - return Film.FILM.DESCRIPTION; - } - - @Override - public Field field4() { - return Film.FILM.RELEASE_YEAR; - } - - @Override - public Field field5() { - return Film.FILM.LANGUAGE_ID; - } - - @Override - public Field field6() { - return Film.FILM.ORIGINAL_LANGUAGE_ID; - } - - @Override - public Field field7() { - return Film.FILM.RENTAL_DURATION; - } - - @Override - public Field field8() { - return Film.FILM.RENTAL_RATE; - } - - @Override - public Field field9() { - return Film.FILM.LENGTH; - } - - @Override - public Field field10() { - return Film.FILM.REPLACEMENT_COST; - } - - @Override - public Field field11() { - return Film.FILM.RATING; - } - - @Override - public Field field12() { - return Film.FILM.LAST_UPDATE; - } - - @Override - public Field field13() { - return Film.FILM.SPECIAL_FEATURES; - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public Field field14() { - return Film.FILM.FULLTEXT; - } - - @Override - public Long component1() { - return getFilmId(); - } - - @Override - public String component2() { - return getTitle(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public Integer component4() { - return getReleaseYear(); - } - - @Override - public Long component5() { - return getLanguageId(); - } - - @Override - public Long component6() { - return getOriginalLanguageId(); - } - - @Override - public Short component7() { - return getRentalDuration(); - } - - @Override - public BigDecimal component8() { - return getRentalRate(); - } - - @Override - public Short component9() { - return getLength(); - } - - @Override - public BigDecimal component10() { - return getReplacementCost(); - } - - @Override - public MpaaRating component11() { - return getRating(); - } - - @Override - public LocalDateTime component12() { - return getLastUpdate(); - } - - @Override - public String[] component13() { - return getSpecialFeatures(); - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public Object component14() { - return getFulltext(); - } - - @Override - public Long value1() { - return getFilmId(); - } - - @Override - public String value2() { - return getTitle(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public Integer value4() { - return getReleaseYear(); - } - - @Override - public Long value5() { - return getLanguageId(); - } - - @Override - public Long value6() { - return getOriginalLanguageId(); - } - - @Override - public Short value7() { - return getRentalDuration(); - } - - @Override - public BigDecimal value8() { - return getRentalRate(); - } - - @Override - public Short value9() { - return getLength(); - } - - @Override - public BigDecimal value10() { - return getReplacementCost(); - } - - @Override - public MpaaRating value11() { - return getRating(); - } - - @Override - public LocalDateTime value12() { - return getLastUpdate(); - } - - @Override - public String[] value13() { - return getSpecialFeatures(); - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public Object value14() { - return getFulltext(); - } - - @Override - public FilmRecord value1(Long value) { - setFilmId(value); - return this; - } - - @Override - public FilmRecord value2(String value) { - setTitle(value); - return this; - } - - @Override - public FilmRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public FilmRecord value4(Integer value) { - setReleaseYear(value); - return this; - } - - @Override - public FilmRecord value5(Long value) { - setLanguageId(value); - return this; - } - - @Override - public FilmRecord value6(Long value) { - setOriginalLanguageId(value); - return this; - } - - @Override - public FilmRecord value7(Short value) { - setRentalDuration(value); - return this; - } - - @Override - public FilmRecord value8(BigDecimal value) { - setRentalRate(value); - return this; - } - - @Override - public FilmRecord value9(Short value) { - setLength(value); - return this; - } - - @Override - public FilmRecord value10(BigDecimal value) { - setReplacementCost(value); - return this; - } - - @Override - public FilmRecord value11(MpaaRating value) { - setRating(value); - return this; - } - - @Override - public FilmRecord value12(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public FilmRecord value13(String[] value) { - setSpecialFeatures(value); - return this; - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public FilmRecord value14(Object value) { - setFulltext(value); - return this; - } - - @Override - public FilmRecord values(Long value1, String value2, String value3, Integer value4, Long value5, Long value6, Short value7, BigDecimal value8, Short value9, BigDecimal value10, MpaaRating value11, LocalDateTime value12, String[] value13, Object value14) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java index 5672e40..3b07d28 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.Inventory; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class InventoryRecord extends UpdatableRecordImpl implements Record4 { +public class InventoryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return Inventory.INVENTORY.INVENTORY_ID; - } - - @Override - public Field field2() { - return Inventory.INVENTORY.FILM_ID; - } - - @Override - public Field field3() { - return Inventory.INVENTORY.STORE_ID; - } - - @Override - public Field field4() { - return Inventory.INVENTORY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getInventoryId(); - } - - @Override - public Long component2() { - return getFilmId(); - } - - @Override - public Long component3() { - return getStoreId(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getInventoryId(); - } - - @Override - public Long value2() { - return getFilmId(); - } - - @Override - public Long value3() { - return getStoreId(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public InventoryRecord value1(Long value) { - setInventoryId(value); - return this; - } - - @Override - public InventoryRecord value2(Long value) { - setFilmId(value); - return this; - } - - @Override - public InventoryRecord value3(Long value) { - setStoreId(value); - return this; - } - - @Override - public InventoryRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public InventoryRecord values(Long value1, Long value2, Long value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java index 7ee557e..5fe04f7 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.Language; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class LanguageRecord extends UpdatableRecordImpl implements Record3 { +public class LanguageRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return Language.LANGUAGE.LANGUAGE_ID; - } - - @Override - public Field field2() { - return Language.LANGUAGE.NAME; - } - - @Override - public Field field3() { - return Language.LANGUAGE.LAST_UPDATE; - } - - @Override - public Long component1() { - return getLanguageId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getLanguageId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public LanguageRecord value1(Long value) { - setLanguageId(value); - return this; - } - - @Override - public LanguageRecord value2(String value) { - setName(value); - return this; - } - - @Override - public LanguageRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public LanguageRecord values(Long value1, String value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java index a0b1d45..0795ed9 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.enums.MpaaRating; import org.jooq.demo.java.db.tables.NicerButSlowerFilmList; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class NicerButSlowerFilmListRecord extends TableRecordImpl implements Record8 { +public class NicerButSlowerFilmListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -134,201 +131,6 @@ public String getActors() { return (String) get(7); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.FID; - } - - @Override - public Field field2() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.TITLE; - } - - @Override - public Field field3() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.DESCRIPTION; - } - - @Override - public Field field4() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.CATEGORY; - } - - @Override - public Field field5() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.PRICE; - } - - @Override - public Field field6() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.LENGTH; - } - - @Override - public Field field7() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.RATING; - } - - @Override - public Field field8() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.ACTORS; - } - - @Override - public Long component1() { - return getFid(); - } - - @Override - public String component2() { - return getTitle(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public String component4() { - return getCategory(); - } - - @Override - public BigDecimal component5() { - return getPrice(); - } - - @Override - public Short component6() { - return getLength(); - } - - @Override - public MpaaRating component7() { - return getRating(); - } - - @Override - public String component8() { - return getActors(); - } - - @Override - public Long value1() { - return getFid(); - } - - @Override - public String value2() { - return getTitle(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public String value4() { - return getCategory(); - } - - @Override - public BigDecimal value5() { - return getPrice(); - } - - @Override - public Short value6() { - return getLength(); - } - - @Override - public MpaaRating value7() { - return getRating(); - } - - @Override - public String value8() { - return getActors(); - } - - @Override - public NicerButSlowerFilmListRecord value1(Long value) { - setFid(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value2(String value) { - setTitle(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value4(String value) { - setCategory(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value5(BigDecimal value) { - setPrice(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value6(Short value) { - setLength(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value7(MpaaRating value) { - setRating(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value8(String value) { - setActors(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord values(Long value1, String value2, String value3, String value4, BigDecimal value5, Short value6, MpaaRating value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java index bfd63c0..7752fd9 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_01; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentP2007_01Record extends TableRecordImpl implements Record6 { +public class PaymentP2007_01Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_01.PAYMENT_P2007_01.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_01.PAYMENT_P2007_01.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_01.PAYMENT_P2007_01.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_01.PAYMENT_P2007_01.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_01Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_01Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_01Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_01Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_01Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_01Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_01Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java index da06cae..6d3e26d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_02; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentP2007_02Record extends TableRecordImpl implements Record6 { +public class PaymentP2007_02Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_02.PAYMENT_P2007_02.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_02.PAYMENT_P2007_02.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_02.PAYMENT_P2007_02.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_02.PAYMENT_P2007_02.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_02Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_02Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_02Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_02Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_02Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_02Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_02Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java index af4d9c1..f15c9af 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_03; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentP2007_03Record extends TableRecordImpl implements Record6 { +public class PaymentP2007_03Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_03.PAYMENT_P2007_03.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_03.PAYMENT_P2007_03.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_03.PAYMENT_P2007_03.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_03.PAYMENT_P2007_03.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_03Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_03Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_03Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_03Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_03Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_03Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_03Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java index a93f283..df3ac07 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_04; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentP2007_04Record extends TableRecordImpl implements Record6 { +public class PaymentP2007_04Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_04.PAYMENT_P2007_04.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_04.PAYMENT_P2007_04.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_04.PAYMENT_P2007_04.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_04.PAYMENT_P2007_04.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_04Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_04Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_04Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_04Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_04Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_04Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_04Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java index 367e835..c5abe79 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_05; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentP2007_05Record extends TableRecordImpl implements Record6 { +public class PaymentP2007_05Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_05.PAYMENT_P2007_05.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_05.PAYMENT_P2007_05.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_05.PAYMENT_P2007_05.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_05.PAYMENT_P2007_05.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_05Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_05Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_05Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_05Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_05Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_05Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_05Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java index 83807bb..7a8acfa 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_06; import org.jooq.impl.TableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentP2007_06Record extends TableRecordImpl implements Record6 { +public class PaymentP2007_06Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_06.PAYMENT_P2007_06.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_06.PAYMENT_P2007_06.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_06.PAYMENT_P2007_06.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_06.PAYMENT_P2007_06.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_06Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_06Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_06Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_06Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_06Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_06Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_06Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java index f0dc161..ffab446 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java @@ -7,10 +7,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.Payment; import org.jooq.impl.UpdatableRecordImpl; @@ -19,7 +16,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class PaymentRecord extends UpdatableRecordImpl implements Record6 { +public class PaymentRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -116,157 +113,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return Payment.PAYMENT.PAYMENT_ID; - } - - @Override - public Field field2() { - return Payment.PAYMENT.CUSTOMER_ID; - } - - @Override - public Field field3() { - return Payment.PAYMENT.STAFF_ID; - } - - @Override - public Field field4() { - return Payment.PAYMENT.RENTAL_ID; - } - - @Override - public Field field5() { - return Payment.PAYMENT.AMOUNT; - } - - @Override - public Field field6() { - return Payment.PAYMENT.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentRecord value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentRecord value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentRecord value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentRecord value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentRecord value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentRecord value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentRecord values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java index 6557591..c34e5ae 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record7; -import org.jooq.Row7; import org.jooq.demo.java.db.tables.Rental; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class RentalRecord extends UpdatableRecordImpl implements Record7 { +public class RentalRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -129,179 +126,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - @Override - public Field field1() { - return Rental.RENTAL.RENTAL_ID; - } - - @Override - public Field field2() { - return Rental.RENTAL.RENTAL_DATE; - } - - @Override - public Field field3() { - return Rental.RENTAL.INVENTORY_ID; - } - - @Override - public Field field4() { - return Rental.RENTAL.CUSTOMER_ID; - } - - @Override - public Field field5() { - return Rental.RENTAL.RETURN_DATE; - } - - @Override - public Field field6() { - return Rental.RENTAL.STAFF_ID; - } - - @Override - public Field field7() { - return Rental.RENTAL.LAST_UPDATE; - } - - @Override - public Long component1() { - return getRentalId(); - } - - @Override - public LocalDateTime component2() { - return getRentalDate(); - } - - @Override - public Long component3() { - return getInventoryId(); - } - - @Override - public Long component4() { - return getCustomerId(); - } - - @Override - public LocalDateTime component5() { - return getReturnDate(); - } - - @Override - public Long component6() { - return getStaffId(); - } - - @Override - public LocalDateTime component7() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getRentalId(); - } - - @Override - public LocalDateTime value2() { - return getRentalDate(); - } - - @Override - public Long value3() { - return getInventoryId(); - } - - @Override - public Long value4() { - return getCustomerId(); - } - - @Override - public LocalDateTime value5() { - return getReturnDate(); - } - - @Override - public Long value6() { - return getStaffId(); - } - - @Override - public LocalDateTime value7() { - return getLastUpdate(); - } - - @Override - public RentalRecord value1(Long value) { - setRentalId(value); - return this; - } - - @Override - public RentalRecord value2(LocalDateTime value) { - setRentalDate(value); - return this; - } - - @Override - public RentalRecord value3(Long value) { - setInventoryId(value); - return this; - } - - @Override - public RentalRecord value4(Long value) { - setCustomerId(value); - return this; - } - - @Override - public RentalRecord value5(LocalDateTime value) { - setReturnDate(value); - return this; - } - - @Override - public RentalRecord value6(Long value) { - setStaffId(value); - return this; - } - - @Override - public RentalRecord value7(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public RentalRecord values(Long value1, LocalDateTime value2, Long value3, Long value4, LocalDateTime value5, Long value6, LocalDateTime value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java index 7553d15..8dea2ed 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record2; -import org.jooq.Row2; import org.jooq.demo.java.db.tables.SalesByFilmCategory; import org.jooq.impl.TableRecordImpl; @@ -17,7 +14,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class SalesByFilmCategoryRecord extends TableRecordImpl implements Record2 { +public class SalesByFilmCategoryRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -49,69 +46,6 @@ public BigDecimal getTotalSales() { return (BigDecimal) get(1); } - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return SalesByFilmCategory.SALES_BY_FILM_CATEGORY.CATEGORY; - } - - @Override - public Field field2() { - return SalesByFilmCategory.SALES_BY_FILM_CATEGORY.TOTAL_SALES; - } - - @Override - public String component1() { - return getCategory(); - } - - @Override - public BigDecimal component2() { - return getTotalSales(); - } - - @Override - public String value1() { - return getCategory(); - } - - @Override - public BigDecimal value2() { - return getTotalSales(); - } - - @Override - public SalesByFilmCategoryRecord value1(String value) { - setCategory(value); - return this; - } - - @Override - public SalesByFilmCategoryRecord value2(BigDecimal value) { - setTotalSales(value); - return this; - } - - @Override - public SalesByFilmCategoryRecord values(String value1, BigDecimal value2) { - value1(value1); - value2(value2); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java index 08ee3ca..1dbf5a2 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.SalesByStore; import org.jooq.impl.TableRecordImpl; @@ -17,7 +14,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class SalesByStoreRecord extends TableRecordImpl implements Record3 { +public class SalesByStoreRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -63,91 +60,6 @@ public BigDecimal getTotalSales() { return (BigDecimal) get(2); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return SalesByStore.SALES_BY_STORE.STORE; - } - - @Override - public Field field2() { - return SalesByStore.SALES_BY_STORE.MANAGER; - } - - @Override - public Field field3() { - return SalesByStore.SALES_BY_STORE.TOTAL_SALES; - } - - @Override - public String component1() { - return getStore(); - } - - @Override - public String component2() { - return getManager(); - } - - @Override - public BigDecimal component3() { - return getTotalSales(); - } - - @Override - public String value1() { - return getStore(); - } - - @Override - public String value2() { - return getManager(); - } - - @Override - public BigDecimal value3() { - return getTotalSales(); - } - - @Override - public SalesByStoreRecord value1(String value) { - setStore(value); - return this; - } - - @Override - public SalesByStoreRecord value2(String value) { - setManager(value); - return this; - } - - @Override - public SalesByStoreRecord value3(BigDecimal value) { - setTotalSales(value); - return this; - } - - @Override - public SalesByStoreRecord values(String value1, String value2, BigDecimal value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java index 2405ffc..8beffcf 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.tables.StaffList; import org.jooq.impl.TableRecordImpl; @@ -15,7 +12,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class StaffListRecord extends TableRecordImpl implements Record8 { +public class StaffListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -131,201 +128,6 @@ public Long getSid() { return (Long) get(7); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return StaffList.STAFF_LIST.ID; - } - - @Override - public Field field2() { - return StaffList.STAFF_LIST.NAME; - } - - @Override - public Field field3() { - return StaffList.STAFF_LIST.ADDRESS; - } - - @Override - public Field field4() { - return StaffList.STAFF_LIST.ZIP_CODE; - } - - @Override - public Field field5() { - return StaffList.STAFF_LIST.PHONE; - } - - @Override - public Field field6() { - return StaffList.STAFF_LIST.CITY; - } - - @Override - public Field field7() { - return StaffList.STAFF_LIST.COUNTRY; - } - - @Override - public Field field8() { - return StaffList.STAFF_LIST.SID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getAddress(); - } - - @Override - public String component4() { - return getZipCode(); - } - - @Override - public String component5() { - return getPhone(); - } - - @Override - public String component6() { - return getCity(); - } - - @Override - public String component7() { - return getCountry(); - } - - @Override - public Long component8() { - return getSid(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getAddress(); - } - - @Override - public String value4() { - return getZipCode(); - } - - @Override - public String value5() { - return getPhone(); - } - - @Override - public String value6() { - return getCity(); - } - - @Override - public String value7() { - return getCountry(); - } - - @Override - public Long value8() { - return getSid(); - } - - @Override - public StaffListRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public StaffListRecord value2(String value) { - setName(value); - return this; - } - - @Override - public StaffListRecord value3(String value) { - setAddress(value); - return this; - } - - @Override - public StaffListRecord value4(String value) { - setZipCode(value); - return this; - } - - @Override - public StaffListRecord value5(String value) { - setPhone(value); - return this; - } - - @Override - public StaffListRecord value6(String value) { - setCity(value); - return this; - } - - @Override - public StaffListRecord value7(String value) { - setCountry(value); - return this; - } - - @Override - public StaffListRecord value8(Long value) { - setSid(value); - return this; - } - - @Override - public StaffListRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, Long value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java index ea46bb0..dd783f3 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record11; -import org.jooq.Row11; import org.jooq.demo.java.db.tables.Staff; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class StaffRecord extends UpdatableRecordImpl implements Record11 { +public class StaffRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -185,267 +182,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row11 fieldsRow() { - return (Row11) super.fieldsRow(); - } - - @Override - public Row11 valuesRow() { - return (Row11) super.valuesRow(); - } - - @Override - public Field field1() { - return Staff.STAFF.STAFF_ID; - } - - @Override - public Field field2() { - return Staff.STAFF.FIRST_NAME; - } - - @Override - public Field field3() { - return Staff.STAFF.LAST_NAME; - } - - @Override - public Field field4() { - return Staff.STAFF.ADDRESS_ID; - } - - @Override - public Field field5() { - return Staff.STAFF.EMAIL; - } - - @Override - public Field field6() { - return Staff.STAFF.STORE_ID; - } - - @Override - public Field field7() { - return Staff.STAFF.ACTIVE; - } - - @Override - public Field field8() { - return Staff.STAFF.USERNAME; - } - - @Override - public Field field9() { - return Staff.STAFF.PASSWORD; - } - - @Override - public Field field10() { - return Staff.STAFF.LAST_UPDATE; - } - - @Override - public Field field11() { - return Staff.STAFF.PICTURE; - } - - @Override - public Long component1() { - return getStaffId(); - } - - @Override - public String component2() { - return getFirstName(); - } - - @Override - public String component3() { - return getLastName(); - } - - @Override - public Long component4() { - return getAddressId(); - } - - @Override - public String component5() { - return getEmail(); - } - - @Override - public Long component6() { - return getStoreId(); - } - - @Override - public Boolean component7() { - return getActive(); - } - - @Override - public String component8() { - return getUsername(); - } - - @Override - public String component9() { - return getPassword(); - } - - @Override - public LocalDateTime component10() { - return getLastUpdate(); - } - - @Override - public byte[] component11() { - return getPicture(); - } - - @Override - public Long value1() { - return getStaffId(); - } - - @Override - public String value2() { - return getFirstName(); - } - - @Override - public String value3() { - return getLastName(); - } - - @Override - public Long value4() { - return getAddressId(); - } - - @Override - public String value5() { - return getEmail(); - } - - @Override - public Long value6() { - return getStoreId(); - } - - @Override - public Boolean value7() { - return getActive(); - } - - @Override - public String value8() { - return getUsername(); - } - - @Override - public String value9() { - return getPassword(); - } - - @Override - public LocalDateTime value10() { - return getLastUpdate(); - } - - @Override - public byte[] value11() { - return getPicture(); - } - - @Override - public StaffRecord value1(Long value) { - setStaffId(value); - return this; - } - - @Override - public StaffRecord value2(String value) { - setFirstName(value); - return this; - } - - @Override - public StaffRecord value3(String value) { - setLastName(value); - return this; - } - - @Override - public StaffRecord value4(Long value) { - setAddressId(value); - return this; - } - - @Override - public StaffRecord value5(String value) { - setEmail(value); - return this; - } - - @Override - public StaffRecord value6(Long value) { - setStoreId(value); - return this; - } - - @Override - public StaffRecord value7(Boolean value) { - setActive(value); - return this; - } - - @Override - public StaffRecord value8(String value) { - setUsername(value); - return this; - } - - @Override - public StaffRecord value9(String value) { - setPassword(value); - return this; - } - - @Override - public StaffRecord value10(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public StaffRecord value11(byte[] value) { - setPicture(value); - return this; - } - - @Override - public StaffRecord values(Long value1, String value2, String value3, Long value4, String value5, Long value6, Boolean value7, String value8, String value9, LocalDateTime value10, byte[] value11) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java index 3e3d617..0eac487 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.Store; import org.jooq.impl.UpdatableRecordImpl; @@ -18,7 +15,7 @@ * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) -public class StoreRecord extends UpdatableRecordImpl implements Record4 { +public class StoreRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return Store.STORE.STORE_ID; - } - - @Override - public Field field2() { - return Store.STORE.MANAGER_STAFF_ID; - } - - @Override - public Field field3() { - return Store.STORE.ADDRESS_ID; - } - - @Override - public Field field4() { - return Store.STORE.LAST_UPDATE; - } - - @Override - public Long component1() { - return getStoreId(); - } - - @Override - public Long component2() { - return getManagerStaffId(); - } - - @Override - public Long component3() { - return getAddressId(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getStoreId(); - } - - @Override - public Long value2() { - return getManagerStaffId(); - } - - @Override - public Long value3() { - return getAddressId(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public StoreRecord value1(Long value) { - setStoreId(value); - return this; - } - - @Override - public StoreRecord value2(Long value) { - setManagerStaffId(value); - return this; - } - - @Override - public StoreRecord value3(Long value) { - setAddressId(value); - return this; - } - - @Override - public StoreRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public StoreRecord values(Long value1, Long value2, Long value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java b/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java index 071ee2c..f914814 100644 --- a/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java +++ b/jOOQ-demo-oss/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java @@ -34,7 +34,10 @@ public void mockingJDBCProgrammatically() throws SQLException { // A MockDataProvider is a database simulation that can intercept all database calls at the JDBC level MockDataProvider p = c -> new MockResult[] { c.sql().contains("select") - ? new MockResult(ctx.newRecord(ACTOR).values(1L, "A", "A", null)) + ? new MockResult(ctx.newRecord(ACTOR) + .with(ACTOR.ACTOR_ID, 1L) + .with(ACTOR.FIRST_NAME, "A") + .with(ACTOR.LAST_NAME, "A")) : new MockResult(0) }; diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/pom.xml b/jOOQ-demo-oss/jOOQ-demo-kotlin/pom.xml index 1abaf0a..c01f5cd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/pom.xml +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/pom.xml @@ -6,7 +6,7 @@ org.jooq jooq-demo - 3.18.7 + 3.19.1 jooq-demo-kotlin diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt index 99d51de..e45347a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt @@ -34,10 +34,10 @@ open class DefaultCatalog : CatalogImpl("") { ) /** - * A reference to the 3.18 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.18. You can turn off the generation of this reference + * release, namely: 3.19. You can turn off the generation of this reference * by specifying /configuration/generator/generate/jooqVersionReference */ - private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18 + private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19 } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt index 11f880a..5de9240 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Actor.kt @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -26,6 +31,9 @@ import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_ACTOR_LAST_NAME import org.jooq.demo.kotlin.db.keys.ACTOR_PKEY +import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath +import org.jooq.demo.kotlin.db.tables.FilmActor.FilmActorPath import org.jooq.demo.kotlin.db.tables.records.ActorRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -39,19 +47,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Actor( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -86,8 +98,9 @@ open class Actor( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.actor table reference @@ -104,14 +117,48 @@ open class Actor( */ constructor(): this(DSL.name("actor"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, ACTOR, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, ACTOR, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class ActorPath : Actor, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): ActorPath = ActorPath(DSL.name(alias), this) + override fun `as`(alias: Name): ActorPath = ActorPath(alias, this) + override fun `as`(alias: Table<*>): ActorPath = ActorPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_ACTOR_LAST_NAME) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = ACTOR_PKEY + + private lateinit var _filmActor: FilmActorPath + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + fun filmActor(): FilmActorPath { + if (!this::_filmActor.isInitialized) + _filmActor = FilmActorPath(this, null, FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY.inverseKey) + + return _filmActor; + } + + val filmActor: FilmActorPath + get(): FilmActorPath = filmActor() + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + val film: FilmPath + get(): FilmPath = filmActor().film() override fun `as`(alias: String): Actor = Actor(DSL.name(alias), this) override fun `as`(alias: Name): Actor = Actor(alias, this) - override fun `as`(alias: Table<*>): Actor = Actor(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Actor = Actor(alias.qualifiedName, this) /** * Rename this table @@ -126,21 +173,55 @@ open class Actor( /** * Rename this table */ - override fun rename(name: Table<*>): Actor = Actor(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Actor = Actor(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Actor = Actor(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Actor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Actor = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Actor = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Actor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Actor = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt index 38b1182..947eaee 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/ActorInfo.kt @@ -4,23 +4,26 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function +import kotlin.collections.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.ActorInfoRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -31,15 +34,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class ActorInfo( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -58,7 +64,8 @@ open class ActorInfo( LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name; - """) + """), + where, ) { companion object { @@ -93,8 +100,9 @@ open class ActorInfo( */ val FILM_INFO: TableField = createField(DSL.name("film_info"), SQLDataType.CLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.actor_info table reference @@ -110,12 +118,10 @@ open class ActorInfo( * Create a public.actor_info table reference */ constructor(): this(DSL.name("actor_info"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, ACTOR_INFO, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): ActorInfo = ActorInfo(DSL.name(alias), this) override fun `as`(alias: Name): ActorInfo = ActorInfo(alias, this) - override fun `as`(alias: Table<*>): ActorInfo = ActorInfo(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): ActorInfo = ActorInfo(alias.qualifiedName, this) /** * Rename this table @@ -130,21 +136,55 @@ open class ActorInfo( /** * Rename this table */ - override fun rename(name: Table<*>): ActorInfo = ActorInfo(name.getQualifiedName(), null) + override fun rename(name: Table<*>): ActorInfo = ActorInfo(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): ActorInfo = ActorInfo(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): ActorInfo = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): ActorInfo = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): ActorInfo = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): ActorInfo = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): ActorInfo = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt index b6aa213..bd48c56 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Address.kt @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -27,6 +32,13 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_FK_CITY_ID import org.jooq.demo.kotlin.db.keys.ADDRESS_PKEY import org.jooq.demo.kotlin.db.keys.ADDRESS__ADDRESS_CITY_ID_FKEY +import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY +import org.jooq.demo.kotlin.db.keys.STAFF__STAFF_ADDRESS_ID_FKEY +import org.jooq.demo.kotlin.db.keys.STORE__STORE_ADDRESS_ID_FKEY +import org.jooq.demo.kotlin.db.tables.City.CityPath +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.AddressRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -40,19 +52,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Address( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -107,8 +123,9 @@ open class Address( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.address table reference @@ -125,30 +142,87 @@ open class Address( */ constructor(): this(DSL.name("address"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, ADDRESS, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, ADDRESS, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class AddressPath : Address, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): AddressPath = AddressPath(DSL.name(alias), this) + override fun `as`(alias: Name): AddressPath = AddressPath(alias, this) + override fun `as`(alias: Table<*>): AddressPath = AddressPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_CITY_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = ADDRESS_PKEY override fun getReferences(): List> = listOf(ADDRESS__ADDRESS_CITY_ID_FKEY) - private lateinit var _city: City + private lateinit var _city: CityPath /** * Get the implicit join path to the public.city table. */ - fun city(): City { + fun city(): CityPath { if (!this::_city.isInitialized) - _city = City(this, ADDRESS__ADDRESS_CITY_ID_FKEY) + _city = CityPath(this, ADDRESS__ADDRESS_CITY_ID_FKEY, null) return _city; } - val city: City - get(): City = city() + val city: CityPath + get(): CityPath = city() + + private lateinit var _customer: CustomerPath + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + fun customer(): CustomerPath { + if (!this::_customer.isInitialized) + _customer = CustomerPath(this, null, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY.inverseKey) + + return _customer; + } + + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath + + /** + * Get the implicit to-many join path to the public.staff table + */ + fun staff(): StaffPath { + if (!this::_staff.isInitialized) + _staff = StaffPath(this, null, STAFF__STAFF_ADDRESS_ID_FKEY.inverseKey) + + return _staff; + } + + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _store: StorePath + + /** + * Get the implicit to-many join path to the public.store table + */ + fun store(): StorePath { + if (!this::_store.isInitialized) + _store = StorePath(this, null, STORE__STORE_ADDRESS_ID_FKEY.inverseKey) + + return _store; + } + + val store: StorePath + get(): StorePath = store() override fun `as`(alias: String): Address = Address(DSL.name(alias), this) override fun `as`(alias: Name): Address = Address(alias, this) - override fun `as`(alias: Table<*>): Address = Address(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Address = Address(alias.qualifiedName, this) /** * Rename this table @@ -163,21 +237,55 @@ open class Address( /** * Rename this table */ - override fun rename(name: Table<*>): Address = Address(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Address = Address(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Address = Address(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Address = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Address = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Address = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Address = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Address = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt index e0a1fa7..5cf3af6 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Category.kt @@ -5,23 +5,32 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.keys.CATEGORY_PKEY +import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath +import org.jooq.demo.kotlin.db.tables.FilmCategory.FilmCategoryPath import org.jooq.demo.kotlin.db.tables.records.CategoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -35,19 +44,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Category( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -77,8 +90,9 @@ open class Category( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.category table reference @@ -95,13 +109,47 @@ open class Category( */ constructor(): this(DSL.name("category"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CATEGORY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, CATEGORY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CategoryPath : Category, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CategoryPath = CategoryPath(DSL.name(alias), this) + override fun `as`(alias: Name): CategoryPath = CategoryPath(alias, this) + override fun `as`(alias: Table<*>): CategoryPath = CategoryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = CATEGORY_PKEY + + private lateinit var _filmCategory: FilmCategoryPath + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + fun filmCategory(): FilmCategoryPath { + if (!this::_filmCategory.isInitialized) + _filmCategory = FilmCategoryPath(this, null, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY.inverseKey) + + return _filmCategory; + } + + val filmCategory: FilmCategoryPath + get(): FilmCategoryPath = filmCategory() + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + val film: FilmPath + get(): FilmPath = filmCategory().film() override fun `as`(alias: String): Category = Category(DSL.name(alias), this) override fun `as`(alias: Name): Category = Category(alias, this) - override fun `as`(alias: Table<*>): Category = Category(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Category = Category(alias.qualifiedName, this) /** * Rename this table @@ -116,21 +164,55 @@ open class Category( /** * Rename this table */ - override fun rename(name: Table<*>): Category = Category(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Category = Category(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Category = Category(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Category = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): Category = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Category = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Category = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Category = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Category = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt index 7013b0d..f955ff7 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/City.kt @@ -5,28 +5,36 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_FK_COUNTRY_ID +import org.jooq.demo.kotlin.db.keys.ADDRESS__ADDRESS_CITY_ID_FKEY import org.jooq.demo.kotlin.db.keys.CITY_PKEY import org.jooq.demo.kotlin.db.keys.CITY__CITY_COUNTRY_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Country.CountryPath import org.jooq.demo.kotlin.db.tables.records.CityRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -40,19 +48,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class City( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -87,8 +99,9 @@ open class City( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.city table reference @@ -105,30 +118,57 @@ open class City( */ constructor(): this(DSL.name("city"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CITY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, CITY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CityPath : City, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CityPath = CityPath(DSL.name(alias), this) + override fun `as`(alias: Name): CityPath = CityPath(alias, this) + override fun `as`(alias: Table<*>): CityPath = CityPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_COUNTRY_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = CITY_PKEY override fun getReferences(): List> = listOf(CITY__CITY_COUNTRY_ID_FKEY) - private lateinit var _country: Country + private lateinit var _country: CountryPath /** * Get the implicit join path to the public.country table. */ - fun country(): Country { + fun country(): CountryPath { if (!this::_country.isInitialized) - _country = Country(this, CITY__CITY_COUNTRY_ID_FKEY) + _country = CountryPath(this, CITY__CITY_COUNTRY_ID_FKEY, null) return _country; } - val country: Country - get(): Country = country() + val country: CountryPath + get(): CountryPath = country() + + private lateinit var _address: AddressPath + + /** + * Get the implicit to-many join path to the public.address + * table + */ + fun address(): AddressPath { + if (!this::_address.isInitialized) + _address = AddressPath(this, null, ADDRESS__ADDRESS_CITY_ID_FKEY.inverseKey) + + return _address; + } + + val address: AddressPath + get(): AddressPath = address() override fun `as`(alias: String): City = City(DSL.name(alias), this) override fun `as`(alias: Name): City = City(alias, this) - override fun `as`(alias: Table<*>): City = City(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): City = City(alias.qualifiedName, this) /** * Rename this table @@ -143,21 +183,55 @@ open class City( /** * Rename this table */ - override fun rename(name: Table<*>): City = City(name.getQualifiedName(), null) + override fun rename(name: Table<*>): City = City(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): City = City(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): City = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): City = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): City = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): City = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): City = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt index c12207e..a6ab39c 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Country.kt @@ -5,23 +5,31 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.keys.CITY__CITY_COUNTRY_ID_FKEY import org.jooq.demo.kotlin.db.keys.COUNTRY_PKEY +import org.jooq.demo.kotlin.db.tables.City.CityPath import org.jooq.demo.kotlin.db.tables.records.CountryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -35,19 +43,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Country( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -77,8 +89,9 @@ open class Country( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.country table reference @@ -95,13 +108,39 @@ open class Country( */ constructor(): this(DSL.name("country"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, COUNTRY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, COUNTRY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CountryPath : Country, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CountryPath = CountryPath(DSL.name(alias), this) + override fun `as`(alias: Name): CountryPath = CountryPath(alias, this) + override fun `as`(alias: Table<*>): CountryPath = CountryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = COUNTRY_PKEY + + private lateinit var _city: CityPath + + /** + * Get the implicit to-many join path to the public.city table + */ + fun city(): CityPath { + if (!this::_city.isInitialized) + _city = CityPath(this, null, CITY__CITY_COUNTRY_ID_FKEY.inverseKey) + + return _city; + } + + val city: CityPath + get(): CityPath = city() override fun `as`(alias: String): Country = Country(DSL.name(alias), this) override fun `as`(alias: Name): Country = Country(alias, this) - override fun `as`(alias: Table<*>): Country = Country(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Country = Country(alias.qualifiedName, this) /** * Rename this table @@ -116,21 +155,55 @@ open class Country( /** * Rename this table */ - override fun rename(name: Table<*>): Country = Country(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Country = Country(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Country = Country(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Country = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Country = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Country = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Country = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Country = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt index ab30709..0388d21 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Customer.kt @@ -6,20 +6,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDate import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row10 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -31,6 +36,24 @@ import org.jooq.demo.kotlin.db.indexes.IDX_LAST_NAME import org.jooq.demo.kotlin.db.keys.CUSTOMER_PKEY import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Payment.PaymentPath +import org.jooq.demo.kotlin.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.CustomerRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -44,19 +67,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Customer( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -121,8 +148,9 @@ open class Customer( */ val ACTIVE: TableField = createField(DSL.name("active"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.customer table reference @@ -139,44 +167,184 @@ open class Customer( */ constructor(): this(DSL.name("customer"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CUSTOMER, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, CUSTOMER, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CustomerPath : Customer, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CustomerPath = CustomerPath(DSL.name(alias), this) + override fun `as`(alias: Name): CustomerPath = CustomerPath(alias, this) + override fun `as`(alias: Table<*>): CustomerPath = CustomerPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_ADDRESS_ID, IDX_FK_STORE_ID, IDX_LAST_NAME) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = CUSTOMER_PKEY override fun getReferences(): List> = listOf(CUSTOMER__CUSTOMER_STORE_ID_FKEY, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY) - private lateinit var _store: Store - private lateinit var _address: Address + private lateinit var _store: StorePath /** * Get the implicit join path to the public.store table. */ - fun store(): Store { + fun store(): StorePath { if (!this::_store.isInitialized) - _store = Store(this, CUSTOMER__CUSTOMER_STORE_ID_FKEY) + _store = StorePath(this, CUSTOMER__CUSTOMER_STORE_ID_FKEY, null) return _store; } - val store: Store - get(): Store = store() + val store: StorePath + get(): StorePath = store() + + private lateinit var _address: AddressPath /** * Get the implicit join path to the public.address table. */ - fun address(): Address { + fun address(): AddressPath { if (!this::_address.isInitialized) - _address = Address(this, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY) + _address = AddressPath(this, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null) return _address; } - val address: Address - get(): Address = address() + val address: AddressPath + get(): AddressPath = address() + + private lateinit var _payment: PaymentPath + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + fun payment(): PaymentPath { + if (!this::_payment.isInitialized) + _payment = PaymentPath(this, null, PAYMENT__PAYMENT_CUSTOMER_ID_FKEY.inverseKey) + + return _payment; + } + + val payment: PaymentPath + get(): PaymentPath = payment() + + private lateinit var _paymentP2007_01: PaymentP2007_01Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + fun paymentP2007_01(): PaymentP2007_01Path { + if (!this::_paymentP2007_01.isInitialized) + _paymentP2007_01 = PaymentP2007_01Path(this, null, PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_01; + } + + val paymentP2007_01: PaymentP2007_01Path + get(): PaymentP2007_01Path = paymentP2007_01() + + private lateinit var _paymentP2007_02: PaymentP2007_02Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + fun paymentP2007_02(): PaymentP2007_02Path { + if (!this::_paymentP2007_02.isInitialized) + _paymentP2007_02 = PaymentP2007_02Path(this, null, PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_02; + } + + val paymentP2007_02: PaymentP2007_02Path + get(): PaymentP2007_02Path = paymentP2007_02() + + private lateinit var _paymentP2007_03: PaymentP2007_03Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + fun paymentP2007_03(): PaymentP2007_03Path { + if (!this::_paymentP2007_03.isInitialized) + _paymentP2007_03 = PaymentP2007_03Path(this, null, PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_03; + } + + val paymentP2007_03: PaymentP2007_03Path + get(): PaymentP2007_03Path = paymentP2007_03() + + private lateinit var _paymentP2007_04: PaymentP2007_04Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + fun paymentP2007_04(): PaymentP2007_04Path { + if (!this::_paymentP2007_04.isInitialized) + _paymentP2007_04 = PaymentP2007_04Path(this, null, PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_04; + } + + val paymentP2007_04: PaymentP2007_04Path + get(): PaymentP2007_04Path = paymentP2007_04() + + private lateinit var _paymentP2007_05: PaymentP2007_05Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + fun paymentP2007_05(): PaymentP2007_05Path { + if (!this::_paymentP2007_05.isInitialized) + _paymentP2007_05 = PaymentP2007_05Path(this, null, PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_05; + } + + val paymentP2007_05: PaymentP2007_05Path + get(): PaymentP2007_05Path = paymentP2007_05() + + private lateinit var _paymentP2007_06: PaymentP2007_06Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + fun paymentP2007_06(): PaymentP2007_06Path { + if (!this::_paymentP2007_06.isInitialized) + _paymentP2007_06 = PaymentP2007_06Path(this, null, PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_06; + } + + val paymentP2007_06: PaymentP2007_06Path + get(): PaymentP2007_06Path = paymentP2007_06() + + private lateinit var _rental: RentalPath + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + fun rental(): RentalPath { + if (!this::_rental.isInitialized) + _rental = RentalPath(this, null, RENTAL__RENTAL_CUSTOMER_ID_FKEY.inverseKey) + + return _rental; + } + + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Customer = Customer(DSL.name(alias), this) override fun `as`(alias: Name): Customer = Customer(alias, this) - override fun `as`(alias: Table<*>): Customer = Customer(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Customer = Customer(alias.qualifiedName, this) /** * Rename this table @@ -191,21 +359,55 @@ open class Customer( /** * Rename this table */ - override fun rename(name: Table<*>): Customer = Customer(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Customer = Customer(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Customer = Customer(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Customer = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row10 = super.fieldsRow() as Row10 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Customer = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Customer = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Customer = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Customer = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt index bc22754..a818b7f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/CustomerList.kt @@ -4,23 +4,26 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function +import kotlin.collections.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row9 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.CustomerListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -31,15 +34,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class CustomerList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -60,7 +66,8 @@ open class CustomerList( JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where, ) { companion object { @@ -120,8 +127,9 @@ open class CustomerList( */ val SID: TableField = createField(DSL.name("sid"), SQLDataType.BIGINT, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.customer_list table reference @@ -137,12 +145,10 @@ open class CustomerList( * Create a public.customer_list table reference */ constructor(): this(DSL.name("customer_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CUSTOMER_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): CustomerList = CustomerList(DSL.name(alias), this) override fun `as`(alias: Name): CustomerList = CustomerList(alias, this) - override fun `as`(alias: Table<*>): CustomerList = CustomerList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): CustomerList = CustomerList(alias.qualifiedName, this) /** * Rename this table @@ -157,21 +163,55 @@ open class CustomerList( /** * Rename this table */ - override fun rename(name: Table<*>): CustomerList = CustomerList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): CustomerList = CustomerList(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): CustomerList = CustomerList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): CustomerList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): CustomerList = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row9 = super.fieldsRow() as Row9 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): CustomerList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): CustomerList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): CustomerList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt index bd8eb87..061b838 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Film.kt @@ -6,35 +6,51 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row14 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.domains.YEAR import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.indexes.FILM_FULLTEXT_IDX import org.jooq.demo.kotlin.db.indexes.IDX_FK_LANGUAGE_ID import org.jooq.demo.kotlin.db.indexes.IDX_FK_ORIGINAL_LANGUAGE_ID import org.jooq.demo.kotlin.db.indexes.IDX_TITLE +import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM_PKEY import org.jooq.demo.kotlin.db.keys.FILM__FILM_LANGUAGE_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Actor.ActorPath +import org.jooq.demo.kotlin.db.tables.Category.CategoryPath +import org.jooq.demo.kotlin.db.tables.FilmActor.FilmActorPath +import org.jooq.demo.kotlin.db.tables.FilmCategory.FilmCategoryPath +import org.jooq.demo.kotlin.db.tables.Inventory.InventoryPath +import org.jooq.demo.kotlin.db.tables.Language.LanguagePath import org.jooq.demo.kotlin.db.tables.records.FilmRecord import org.jooq.impl.DSL +import org.jooq.impl.DefaultDataType import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -46,19 +62,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Film( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -91,7 +111,7 @@ open class Film( /** * The column public.film.release_year. */ - val RELEASE_YEAR: TableField = createField(DSL.name("release_year"), org.jooq.demo.kotlin.db.domains.YEAR.getDataType(), this, "") + val RELEASE_YEAR: TableField = createField(DSL.name("release_year"), YEAR.getDataType(), this, "") /** * The column public.film.language_id. @@ -126,7 +146,7 @@ open class Film( /** * The column public.film.rating. */ - val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(org.jooq.demo.kotlin.db.enums.MpaaRating::class.java), this, "") + val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(MpaaRating::class.java), this, "") /** * The column public.film.last_update. @@ -138,10 +158,11 @@ open class Film( */ val SPECIAL_FEATURES: TableField?> = createField(DSL.name("special_features"), SQLDataType.CLOB.array(), this, "") @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - val FULLTEXT: TableField = createField(DSL.name("fulltext"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, "") + val FULLTEXT: TableField = createField(DSL.name("fulltext"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film table reference @@ -158,46 +179,120 @@ open class Film( */ constructor(): this(DSL.name("film"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, FILM, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class FilmPath : Film, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): FilmPath = FilmPath(DSL.name(alias), this) + override fun `as`(alias: Name): FilmPath = FilmPath(alias, this) + override fun `as`(alias: Table<*>): FilmPath = FilmPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(FILM_FULLTEXT_IDX, IDX_FK_LANGUAGE_ID, IDX_FK_ORIGINAL_LANGUAGE_ID, IDX_TITLE) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = FILM_PKEY override fun getReferences(): List> = listOf(FILM__FILM_LANGUAGE_ID_FKEY, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY) - private lateinit var _filmLanguageIdFkey: Language - private lateinit var _filmOriginalLanguageIdFkey: Language + private lateinit var _filmLanguageIdFkey: LanguagePath /** * Get the implicit join path to the public.language table, via * the film_language_id_fkey key. */ - fun filmLanguageIdFkey(): Language { + fun filmLanguageIdFkey(): LanguagePath { if (!this::_filmLanguageIdFkey.isInitialized) - _filmLanguageIdFkey = Language(this, FILM__FILM_LANGUAGE_ID_FKEY) + _filmLanguageIdFkey = LanguagePath(this, FILM__FILM_LANGUAGE_ID_FKEY, null) return _filmLanguageIdFkey; } - val filmLanguageIdFkey: Language - get(): Language = filmLanguageIdFkey() + val filmLanguageIdFkey: LanguagePath + get(): LanguagePath = filmLanguageIdFkey() + + private lateinit var _filmOriginalLanguageIdFkey: LanguagePath /** * Get the implicit join path to the public.language table, via * the film_original_language_id_fkey key. */ - fun filmOriginalLanguageIdFkey(): Language { + fun filmOriginalLanguageIdFkey(): LanguagePath { if (!this::_filmOriginalLanguageIdFkey.isInitialized) - _filmOriginalLanguageIdFkey = Language(this, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY) + _filmOriginalLanguageIdFkey = LanguagePath(this, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null) return _filmOriginalLanguageIdFkey; } - val filmOriginalLanguageIdFkey: Language - get(): Language = filmOriginalLanguageIdFkey() + val filmOriginalLanguageIdFkey: LanguagePath + get(): LanguagePath = filmOriginalLanguageIdFkey() + + private lateinit var _filmActor: FilmActorPath + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + fun filmActor(): FilmActorPath { + if (!this::_filmActor.isInitialized) + _filmActor = FilmActorPath(this, null, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY.inverseKey) + + return _filmActor; + } + + val filmActor: FilmActorPath + get(): FilmActorPath = filmActor() + + private lateinit var _filmCategory: FilmCategoryPath + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + fun filmCategory(): FilmCategoryPath { + if (!this::_filmCategory.isInitialized) + _filmCategory = FilmCategoryPath(this, null, FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY.inverseKey) + + return _filmCategory; + } + + val filmCategory: FilmCategoryPath + get(): FilmCategoryPath = filmCategory() + + private lateinit var _inventory: InventoryPath + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + fun inventory(): InventoryPath { + if (!this::_inventory.isInitialized) + _inventory = InventoryPath(this, null, INVENTORY__INVENTORY_FILM_ID_FKEY.inverseKey) + + return _inventory; + } + + val inventory: InventoryPath + get(): InventoryPath = inventory() + + /** + * Get the implicit many-to-many join path to the public.actor + * table + */ + val actor: ActorPath + get(): ActorPath = filmActor().actor() + + /** + * Get the implicit many-to-many join path to the + * public.category table + */ + val category: CategoryPath + get(): CategoryPath = filmCategory().category() override fun `as`(alias: String): Film = Film(DSL.name(alias), this) override fun `as`(alias: Name): Film = Film(alias, this) - override fun `as`(alias: Table<*>): Film = Film(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Film = Film(alias.qualifiedName, this) /** * Rename this table @@ -212,21 +307,55 @@ open class Film( /** * Rename this table */ - override fun rename(name: Table<*>): Film = Film(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Film = Film(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Film = Film(qualifiedName, if (aliased()) this else null, condition) - // ------------------------------------------------------------------------- - // Row14 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row14?, Any?> = super.fieldsRow() as Row14?, Any?> + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Film = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Film = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Film = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, Int?, Long?, Long?, Short?, BigDecimal?, Short?, BigDecimal?, MpaaRating?, LocalDateTime?, Array?, Any?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Film = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, Int?, Long?, Long?, Short?, BigDecimal?, Short?, BigDecimal?, MpaaRating?, LocalDateTime?, Array?, Any?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Film = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt index abb4d7e..f8db901 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmActor.kt @@ -5,19 +5,24 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -27,6 +32,8 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_FILM_ID import org.jooq.demo.kotlin.db.keys.FILM_ACTOR_PKEY import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Actor.ActorPath +import org.jooq.demo.kotlin.db.tables.Film.FilmPath import org.jooq.demo.kotlin.db.tables.records.FilmActorRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -40,19 +47,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmActor( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -82,8 +93,9 @@ open class FilmActor( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film_actor table reference @@ -100,43 +112,55 @@ open class FilmActor( */ constructor(): this(DSL.name("film_actor"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM_ACTOR, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, FILM_ACTOR, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class FilmActorPath : FilmActor, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): FilmActorPath = FilmActorPath(DSL.name(alias), this) + override fun `as`(alias: Name): FilmActorPath = FilmActorPath(alias, this) + override fun `as`(alias: Table<*>): FilmActorPath = FilmActorPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_FILM_ID) override fun getPrimaryKey(): UniqueKey = FILM_ACTOR_PKEY override fun getReferences(): List> = listOf(FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY) - private lateinit var _actor: Actor - private lateinit var _film: Film + private lateinit var _actor: ActorPath /** * Get the implicit join path to the public.actor table. */ - fun actor(): Actor { + fun actor(): ActorPath { if (!this::_actor.isInitialized) - _actor = Actor(this, FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY) + _actor = ActorPath(this, FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, null) return _actor; } - val actor: Actor - get(): Actor = actor() + val actor: ActorPath + get(): ActorPath = actor() + + private lateinit var _film: FilmPath /** * Get the implicit join path to the public.film table. */ - fun film(): Film { + fun film(): FilmPath { if (!this::_film.isInitialized) - _film = Film(this, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY) + _film = FilmPath(this, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY, null) return _film; } - val film: Film - get(): Film = film() + val film: FilmPath + get(): FilmPath = film() override fun `as`(alias: String): FilmActor = FilmActor(DSL.name(alias), this) override fun `as`(alias: Name): FilmActor = FilmActor(alias, this) - override fun `as`(alias: Table<*>): FilmActor = FilmActor(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): FilmActor = FilmActor(alias.qualifiedName, this) /** * Rename this table @@ -151,21 +175,55 @@ open class FilmActor( /** * Rename this table */ - override fun rename(name: Table<*>): FilmActor = FilmActor(name.getQualifiedName(), null) + override fun rename(name: Table<*>): FilmActor = FilmActor(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): FilmActor = FilmActor(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): FilmActor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): FilmActor = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): FilmActor = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): FilmActor = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): FilmActor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): FilmActor = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt index c4c6c49..73c79a5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmCategory.kt @@ -5,18 +5,23 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -25,6 +30,8 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY_PKEY import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Category.CategoryPath +import org.jooq.demo.kotlin.db.tables.Film.FilmPath import org.jooq.demo.kotlin.db.tables.records.FilmCategoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -38,19 +45,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmCategory( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -80,8 +91,9 @@ open class FilmCategory( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film_category table reference @@ -98,42 +110,54 @@ open class FilmCategory( */ constructor(): this(DSL.name("film_category"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM_CATEGORY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, FILM_CATEGORY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class FilmCategoryPath : FilmCategory, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): FilmCategoryPath = FilmCategoryPath(DSL.name(alias), this) + override fun `as`(alias: Name): FilmCategoryPath = FilmCategoryPath(alias, this) + override fun `as`(alias: Table<*>): FilmCategoryPath = FilmCategoryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getPrimaryKey(): UniqueKey = FILM_CATEGORY_PKEY override fun getReferences(): List> = listOf(FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY) - private lateinit var _film: Film - private lateinit var _category: Category + private lateinit var _film: FilmPath /** * Get the implicit join path to the public.film table. */ - fun film(): Film { + fun film(): FilmPath { if (!this::_film.isInitialized) - _film = Film(this, FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY) + _film = FilmPath(this, FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, null) return _film; } - val film: Film - get(): Film = film() + val film: FilmPath + get(): FilmPath = film() + + private lateinit var _category: CategoryPath /** * Get the implicit join path to the public.category table. */ - fun category(): Category { + fun category(): CategoryPath { if (!this::_category.isInitialized) - _category = Category(this, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY) + _category = CategoryPath(this, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY, null) return _category; } - val category: Category - get(): Category = category() + val category: CategoryPath + get(): CategoryPath = category() override fun `as`(alias: String): FilmCategory = FilmCategory(DSL.name(alias), this) override fun `as`(alias: Name): FilmCategory = FilmCategory(alias, this) - override fun `as`(alias: Table<*>): FilmCategory = FilmCategory(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): FilmCategory = FilmCategory(alias.qualifiedName, this) /** * Rename this table @@ -148,21 +172,55 @@ open class FilmCategory( /** * Rename this table */ - override fun rename(name: Table<*>): FilmCategory = FilmCategory(name.getQualifiedName(), null) + override fun rename(name: Table<*>): FilmCategory = FilmCategory(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): FilmCategory = FilmCategory(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): FilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): FilmCategory = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): FilmCategory = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): FilmCategory = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): FilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): FilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt index 6a8a3e9..2aba2fa 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt @@ -4,16 +4,13 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function - +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Records -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,19 +27,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmInStock( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function() + TableOptions.function(), + where, ) { companion object { @@ -62,11 +63,11 @@ open class FilmInStock( */ val P_FILM_COUNT: TableField = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, arrayOf( + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, arrayOf( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + ), null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) /** * Create an aliased public.film_in_stock table reference @@ -85,7 +86,7 @@ open class FilmInStock( override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): FilmInStock = FilmInStock(DSL.name(alias), this, parameters) override fun `as`(alias: Name): FilmInStock = FilmInStock(alias, this, parameters) - override fun `as`(alias: Table<*>): FilmInStock = FilmInStock(alias.getQualifiedName(), this, parameters) + override fun `as`(alias: Table<*>): FilmInStock = FilmInStock(alias.qualifiedName, this, parameters) /** * Rename this table @@ -100,12 +101,7 @@ open class FilmInStock( /** * Rename this table */ - override fun rename(name: Table<*>): FilmInStock = FilmInStock(name.getQualifiedName(), null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 + override fun rename(name: Table<*>): FilmInStock = FilmInStock(name.qualifiedName, null, parameters) /** * Call this table-valued function @@ -128,15 +124,4 @@ open class FilmInStock( pFilmId, pStoreId )).let { if (aliased()) it.`as`(unqualifiedName) else it } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - fun mapping(from: (Int?) -> U): SelectField = convertFrom(Records.mapping(from)) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - fun mapping(toType: Class, from: (Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt index 938db80..29ab2a2 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmList.kt @@ -5,16 +5,21 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -22,7 +27,6 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.records.FilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -33,15 +37,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -60,7 +67,8 @@ open class FilmList( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where, ) { companion object { @@ -108,15 +116,16 @@ open class FilmList( /** * The column public.film_list.rating. */ - val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.kotlin.db.enums.MpaaRating::class.java), this, "") + val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating::class.java), this, "") /** * The column public.film_list.actors. */ val ACTORS: TableField = createField(DSL.name("actors"), SQLDataType.CLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film_list table reference @@ -132,12 +141,10 @@ open class FilmList( * Create a public.film_list table reference */ constructor(): this(DSL.name("film_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): FilmList = FilmList(DSL.name(alias), this) override fun `as`(alias: Name): FilmList = FilmList(alias, this) - override fun `as`(alias: Table<*>): FilmList = FilmList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): FilmList = FilmList(alias.qualifiedName, this) /** * Rename this table @@ -152,21 +159,55 @@ open class FilmList( /** * Rename this table */ - override fun rename(name: Table<*>): FilmList = FilmList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): FilmList = FilmList(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): FilmList = FilmList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): FilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): FilmList = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): FilmList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): FilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): FilmList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt index df3eb43..cb36e1d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt @@ -4,16 +4,13 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function - +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Records -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,19 +27,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmNotInStock( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function() + TableOptions.function(), + where, ) { companion object { @@ -62,11 +63,11 @@ open class FilmNotInStock( */ val P_FILM_COUNT: TableField = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, arrayOf( + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, arrayOf( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + ), null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) /** * Create an aliased public.film_not_in_stock table reference @@ -85,7 +86,7 @@ open class FilmNotInStock( override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): FilmNotInStock = FilmNotInStock(DSL.name(alias), this, parameters) override fun `as`(alias: Name): FilmNotInStock = FilmNotInStock(alias, this, parameters) - override fun `as`(alias: Table<*>): FilmNotInStock = FilmNotInStock(alias.getQualifiedName(), this, parameters) + override fun `as`(alias: Table<*>): FilmNotInStock = FilmNotInStock(alias.qualifiedName, this, parameters) /** * Rename this table @@ -100,12 +101,7 @@ open class FilmNotInStock( /** * Rename this table */ - override fun rename(name: Table<*>): FilmNotInStock = FilmNotInStock(name.getQualifiedName(), null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 + override fun rename(name: Table<*>): FilmNotInStock = FilmNotInStock(name.qualifiedName, null, parameters) /** * Call this table-valued function @@ -128,15 +124,4 @@ open class FilmNotInStock( pFilmId, pStoreId )).let { if (aliased()) it.`as`(unqualifiedName) else it } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - fun mapping(from: (Int?) -> U): SelectField = convertFrom(Records.mapping(from)) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - fun mapping(toType: Class, from: (Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt index 4b15060..b313a10 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Inventory.kt @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,6 +33,10 @@ import org.jooq.demo.kotlin.db.indexes.IDX_STORE_ID_FILM_ID import org.jooq.demo.kotlin.db.keys.INVENTORY_PKEY import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_FILM_ID_FKEY import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_INVENTORY_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.InventoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -41,19 +50,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Inventory( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -88,8 +101,9 @@ open class Inventory( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.inventory table reference @@ -106,44 +120,72 @@ open class Inventory( */ constructor(): this(DSL.name("inventory"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, INVENTORY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, INVENTORY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class InventoryPath : Inventory, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): InventoryPath = InventoryPath(DSL.name(alias), this) + override fun `as`(alias: Name): InventoryPath = InventoryPath(alias, this) + override fun `as`(alias: Table<*>): InventoryPath = InventoryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_STORE_ID_FILM_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = INVENTORY_PKEY override fun getReferences(): List> = listOf(INVENTORY__INVENTORY_FILM_ID_FKEY, INVENTORY__INVENTORY_STORE_ID_FKEY) - private lateinit var _film: Film - private lateinit var _store: Store + private lateinit var _film: FilmPath /** * Get the implicit join path to the public.film table. */ - fun film(): Film { + fun film(): FilmPath { if (!this::_film.isInitialized) - _film = Film(this, INVENTORY__INVENTORY_FILM_ID_FKEY) + _film = FilmPath(this, INVENTORY__INVENTORY_FILM_ID_FKEY, null) return _film; } - val film: Film - get(): Film = film() + val film: FilmPath + get(): FilmPath = film() + + private lateinit var _store: StorePath /** * Get the implicit join path to the public.store table. */ - fun store(): Store { + fun store(): StorePath { if (!this::_store.isInitialized) - _store = Store(this, INVENTORY__INVENTORY_STORE_ID_FKEY) + _store = StorePath(this, INVENTORY__INVENTORY_STORE_ID_FKEY, null) return _store; } - val store: Store - get(): Store = store() + val store: StorePath + get(): StorePath = store() + + private lateinit var _rental: RentalPath + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + fun rental(): RentalPath { + if (!this::_rental.isInitialized) + _rental = RentalPath(this, null, RENTAL__RENTAL_INVENTORY_ID_FKEY.inverseKey) + + return _rental; + } + + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Inventory = Inventory(DSL.name(alias), this) override fun `as`(alias: Name): Inventory = Inventory(alias, this) - override fun `as`(alias: Table<*>): Inventory = Inventory(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Inventory = Inventory(alias.qualifiedName, this) /** * Rename this table @@ -158,21 +200,55 @@ open class Inventory( /** * Rename this table */ - override fun rename(name: Table<*>): Inventory = Inventory(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Inventory = Inventory(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Inventory = Inventory(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Inventory = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Inventory = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Inventory = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Inventory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Inventory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt index ef4eafb..ef2e593 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Language.kt @@ -5,23 +5,32 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.keys.FILM__FILM_LANGUAGE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY import org.jooq.demo.kotlin.db.keys.LANGUAGE_PKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath import org.jooq.demo.kotlin.db.tables.records.LanguageRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -35,19 +44,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Language( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -77,8 +90,9 @@ open class Language( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.language table reference @@ -95,13 +109,56 @@ open class Language( */ constructor(): this(DSL.name("language"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, LANGUAGE, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, LANGUAGE, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class LanguagePath : Language, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): LanguagePath = LanguagePath(DSL.name(alias), this) + override fun `as`(alias: Name): LanguagePath = LanguagePath(alias, this) + override fun `as`(alias: Table<*>): LanguagePath = LanguagePath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = LANGUAGE_PKEY + + private lateinit var _filmLanguageIdFkey: FilmPath + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_language_id_fkey key + */ + fun filmLanguageIdFkey(): FilmPath { + if (!this::_filmLanguageIdFkey.isInitialized) + _filmLanguageIdFkey = FilmPath(this, null, FILM__FILM_LANGUAGE_ID_FKEY.inverseKey) + + return _filmLanguageIdFkey; + } + + val filmLanguageIdFkey: FilmPath + get(): FilmPath = filmLanguageIdFkey() + + private lateinit var _filmOriginalLanguageIdFkey: FilmPath + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_original_language_id_fkey key + */ + fun filmOriginalLanguageIdFkey(): FilmPath { + if (!this::_filmOriginalLanguageIdFkey.isInitialized) + _filmOriginalLanguageIdFkey = FilmPath(this, null, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY.inverseKey) + + return _filmOriginalLanguageIdFkey; + } + + val filmOriginalLanguageIdFkey: FilmPath + get(): FilmPath = filmOriginalLanguageIdFkey() override fun `as`(alias: String): Language = Language(DSL.name(alias), this) override fun `as`(alias: Name): Language = Language(alias, this) - override fun `as`(alias: Table<*>): Language = Language(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Language = Language(alias.qualifiedName, this) /** * Rename this table @@ -116,21 +173,55 @@ open class Language( /** * Rename this table */ - override fun rename(name: Table<*>): Language = Language(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Language = Language(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Language = Language(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Language = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Language = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Language = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Language = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Language = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt index 5a4757c..da560a7 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/NicerButSlowerFilmList.kt @@ -5,16 +5,21 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -22,7 +27,6 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.records.NicerButSlowerFilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -33,15 +37,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class NicerButSlowerFilmList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -60,7 +67,8 @@ open class NicerButSlowerFilmList( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where, ) { companion object { @@ -109,15 +117,16 @@ open class NicerButSlowerFilmList( /** * The column public.nicer_but_slower_film_list.rating. */ - val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.kotlin.db.enums.MpaaRating::class.java), this, "") + val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating::class.java), this, "") /** * The column public.nicer_but_slower_film_list.actors. */ val ACTORS: TableField = createField(DSL.name("actors"), SQLDataType.CLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.nicer_but_slower_film_list table @@ -135,12 +144,10 @@ open class NicerButSlowerFilmList( * Create a public.nicer_but_slower_film_list table reference */ constructor(): this(DSL.name("nicer_but_slower_film_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, NICER_BUT_SLOWER_FILM_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): NicerButSlowerFilmList = NicerButSlowerFilmList(DSL.name(alias), this) override fun `as`(alias: Name): NicerButSlowerFilmList = NicerButSlowerFilmList(alias, this) - override fun `as`(alias: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(alias.qualifiedName, this) /** * Rename this table @@ -155,21 +162,55 @@ open class NicerButSlowerFilmList( /** * Rename this table */ - override fun rename(name: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): NicerButSlowerFilmList = NicerButSlowerFilmList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): NicerButSlowerFilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): NicerButSlowerFilmList = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): NicerButSlowerFilmList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): NicerButSlowerFilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): NicerButSlowerFilmList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt index 2101bbe..2188606 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Payment.kt @@ -6,20 +6,25 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -31,6 +36,9 @@ import org.jooq.demo.kotlin.db.keys.PAYMENT_PKEY import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -44,19 +52,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Payment( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -101,8 +113,9 @@ open class Payment( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment table reference @@ -119,58 +132,71 @@ open class Payment( */ constructor(): this(DSL.name("payment"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentPath : Payment, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentPath = PaymentPath(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentPath = PaymentPath(alias, this) + override fun `as`(alias: Table<*>): PaymentPath = PaymentPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_CUSTOMER_ID, IDX_FK_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = PAYMENT_PKEY override fun getReferences(): List> = listOf(PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, PAYMENT__PAYMENT_STAFF_ID_FKEY, PAYMENT__PAYMENT_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT__PAYMENT_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT__PAYMENT_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT__PAYMENT_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT__PAYMENT_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT__PAYMENT_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Payment = Payment(DSL.name(alias), this) override fun `as`(alias: Name): Payment = Payment(alias, this) - override fun `as`(alias: Table<*>): Payment = Payment(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Payment = Payment(alias.qualifiedName, this) /** * Rename this table @@ -185,21 +211,55 @@ open class Payment( /** * Rename this table */ - override fun rename(name: Table<*>): Payment = Payment(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Payment = Payment(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Payment = Payment(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Payment = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): Payment = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Payment = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Payment = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Payment = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Payment = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt index c7224c8..7e9f17f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_01.kt @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_01_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_01Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_01( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_01( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_01 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_01( */ constructor(): this(DSL.name("payment_p2007_01"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_01, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_01, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_01Path : PaymentP2007_01, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_01Path = PaymentP2007_01Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_01Path = PaymentP2007_01Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_01Path = PaymentP2007_01Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_01_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_01_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_01_payment_date_check"), "(((payment_date >= '2007-01-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-02-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_01 = PaymentP2007_01(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_01 = PaymentP2007_01(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_01 = PaymentP2007_01(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_01 = PaymentP2007_01(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_01( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_01 = PaymentP2007_01(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_01 = PaymentP2007_01(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_01 = PaymentP2007_01(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_01 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_01 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_01 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_01 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_01 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_01 = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt index 2ae28a8..93fac7f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_02.kt @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_02_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_02Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_02( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_02( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_02 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_02( */ constructor(): this(DSL.name("payment_p2007_02"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_02, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_02, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_02Path : PaymentP2007_02, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_02Path = PaymentP2007_02Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_02Path = PaymentP2007_02Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_02Path = PaymentP2007_02Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_02_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_02_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_02_payment_date_check"), "(((payment_date >= '2007-02-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-03-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_02 = PaymentP2007_02(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_02 = PaymentP2007_02(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_02 = PaymentP2007_02(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_02 = PaymentP2007_02(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_02( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_02 = PaymentP2007_02(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_02 = PaymentP2007_02(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_02 = PaymentP2007_02(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_02 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_02 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_02 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_02 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_02 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_02 = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt index f30562c..a527e24 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_03.kt @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_03_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_03Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_03( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_03( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_03 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_03( */ constructor(): this(DSL.name("payment_p2007_03"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_03, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_03, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_03Path : PaymentP2007_03, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_03Path = PaymentP2007_03Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_03Path = PaymentP2007_03Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_03Path = PaymentP2007_03Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_03_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_03_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_03_payment_date_check"), "(((payment_date >= '2007-03-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-04-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_03 = PaymentP2007_03(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_03 = PaymentP2007_03(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_03 = PaymentP2007_03(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_03 = PaymentP2007_03(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_03( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_03 = PaymentP2007_03(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_03 = PaymentP2007_03(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_03 = PaymentP2007_03(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_03 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_03 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_03 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_03 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_03 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_03 = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt index 0384064..a9a7ade 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_04.kt @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_04_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_04Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_04( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_04( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_04 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_04( */ constructor(): this(DSL.name("payment_p2007_04"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_04, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_04, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_04Path : PaymentP2007_04, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_04Path = PaymentP2007_04Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_04Path = PaymentP2007_04Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_04Path = PaymentP2007_04Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_04_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_04_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_04_payment_date_check"), "(((payment_date >= '2007-04-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-05-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_04 = PaymentP2007_04(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_04 = PaymentP2007_04(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_04 = PaymentP2007_04(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_04 = PaymentP2007_04(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_04( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_04 = PaymentP2007_04(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_04 = PaymentP2007_04(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_04 = PaymentP2007_04(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_04 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_04 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_04 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_04 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_04 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_04 = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt index 9a8791f..c6fa36f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_05.kt @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_05_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_05Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_05( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_05( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_05 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_05( */ constructor(): this(DSL.name("payment_p2007_05"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_05, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_05, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_05Path : PaymentP2007_05, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_05Path = PaymentP2007_05Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_05Path = PaymentP2007_05Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_05Path = PaymentP2007_05Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_05_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_05_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_05_payment_date_check"), "(((payment_date >= '2007-05-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-06-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_05 = PaymentP2007_05(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_05 = PaymentP2007_05(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_05 = PaymentP2007_05(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_05 = PaymentP2007_05(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_05( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_05 = PaymentP2007_05(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_05 = PaymentP2007_05(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_05 = PaymentP2007_05(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_05 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_05 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_05 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_05 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_05 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_05 = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt index bfbc012..ae02856 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/PaymentP2007_06.kt @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_06_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_06Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_06( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_06( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_06 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_06( */ constructor(): this(DSL.name("payment_p2007_06"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_06, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_06, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_06Path : PaymentP2007_06, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_06Path = PaymentP2007_06Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_06Path = PaymentP2007_06Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_06Path = PaymentP2007_06Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_06_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_06_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_06_payment_date_check"), "(((payment_date >= '2007-06-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-07-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_06 = PaymentP2007_06(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_06 = PaymentP2007_06(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_06 = PaymentP2007_06(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_06 = PaymentP2007_06(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_06( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_06 = PaymentP2007_06(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_06 = PaymentP2007_06(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_06 = PaymentP2007_06(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_06 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_06 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_06 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_06 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_06 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_06 = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt index ba0da25..55387d8 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Rental.kt @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row7 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -26,10 +31,27 @@ import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_FK_INVENTORY_ID import org.jooq.demo.kotlin.db.indexes.IDX_UNQ_RENTAL_RENTAL_DATE_INVENTORY_ID_CUSTOMER_ID +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.RENTAL_PKEY import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_INVENTORY_ID_FKEY import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Inventory.InventoryPath +import org.jooq.demo.kotlin.db.tables.Payment.PaymentPath +import org.jooq.demo.kotlin.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.RentalRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +65,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Rental( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -105,8 +131,9 @@ open class Rental( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.rental table reference @@ -123,58 +150,183 @@ open class Rental( */ constructor(): this(DSL.name("rental"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, RENTAL, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, RENTAL, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class RentalPath : Rental, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): RentalPath = RentalPath(DSL.name(alias), this) + override fun `as`(alias: Name): RentalPath = RentalPath(alias, this) + override fun `as`(alias: Table<*>): RentalPath = RentalPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_INVENTORY_ID, IDX_UNQ_RENTAL_RENTAL_DATE_INVENTORY_ID_CUSTOMER_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = RENTAL_PKEY override fun getReferences(): List> = listOf(RENTAL__RENTAL_INVENTORY_ID_FKEY, RENTAL__RENTAL_CUSTOMER_ID_FKEY, RENTAL__RENTAL_STAFF_ID_FKEY) - private lateinit var _inventory: Inventory - private lateinit var _customer: Customer - private lateinit var _staff: Staff + private lateinit var _inventory: InventoryPath /** * Get the implicit join path to the public.inventory table. */ - fun inventory(): Inventory { + fun inventory(): InventoryPath { if (!this::_inventory.isInitialized) - _inventory = Inventory(this, RENTAL__RENTAL_INVENTORY_ID_FKEY) + _inventory = InventoryPath(this, RENTAL__RENTAL_INVENTORY_ID_FKEY, null) return _inventory; } - val inventory: Inventory - get(): Inventory = inventory() + val inventory: InventoryPath + get(): InventoryPath = inventory() + + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, RENTAL__RENTAL_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, RENTAL__RENTAL_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, RENTAL__RENTAL_STAFF_ID_FKEY) + _staff = StaffPath(this, RENTAL__RENTAL_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _payment: PaymentPath + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + fun payment(): PaymentPath { + if (!this::_payment.isInitialized) + _payment = PaymentPath(this, null, PAYMENT__PAYMENT_RENTAL_ID_FKEY.inverseKey) + + return _payment; + } + + val payment: PaymentPath + get(): PaymentPath = payment() + + private lateinit var _paymentP2007_01: PaymentP2007_01Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + fun paymentP2007_01(): PaymentP2007_01Path { + if (!this::_paymentP2007_01.isInitialized) + _paymentP2007_01 = PaymentP2007_01Path(this, null, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_01; + } + + val paymentP2007_01: PaymentP2007_01Path + get(): PaymentP2007_01Path = paymentP2007_01() + + private lateinit var _paymentP2007_02: PaymentP2007_02Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + fun paymentP2007_02(): PaymentP2007_02Path { + if (!this::_paymentP2007_02.isInitialized) + _paymentP2007_02 = PaymentP2007_02Path(this, null, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_02; + } + + val paymentP2007_02: PaymentP2007_02Path + get(): PaymentP2007_02Path = paymentP2007_02() + + private lateinit var _paymentP2007_03: PaymentP2007_03Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + fun paymentP2007_03(): PaymentP2007_03Path { + if (!this::_paymentP2007_03.isInitialized) + _paymentP2007_03 = PaymentP2007_03Path(this, null, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_03; + } + + val paymentP2007_03: PaymentP2007_03Path + get(): PaymentP2007_03Path = paymentP2007_03() + + private lateinit var _paymentP2007_04: PaymentP2007_04Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + fun paymentP2007_04(): PaymentP2007_04Path { + if (!this::_paymentP2007_04.isInitialized) + _paymentP2007_04 = PaymentP2007_04Path(this, null, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_04; + } + + val paymentP2007_04: PaymentP2007_04Path + get(): PaymentP2007_04Path = paymentP2007_04() + + private lateinit var _paymentP2007_05: PaymentP2007_05Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + fun paymentP2007_05(): PaymentP2007_05Path { + if (!this::_paymentP2007_05.isInitialized) + _paymentP2007_05 = PaymentP2007_05Path(this, null, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_05; + } + + val paymentP2007_05: PaymentP2007_05Path + get(): PaymentP2007_05Path = paymentP2007_05() + + private lateinit var _paymentP2007_06: PaymentP2007_06Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + fun paymentP2007_06(): PaymentP2007_06Path { + if (!this::_paymentP2007_06.isInitialized) + _paymentP2007_06 = PaymentP2007_06Path(this, null, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_06; + } + + val paymentP2007_06: PaymentP2007_06Path + get(): PaymentP2007_06Path = paymentP2007_06() override fun `as`(alias: String): Rental = Rental(DSL.name(alias), this) override fun `as`(alias: Name): Rental = Rental(alias, this) - override fun `as`(alias: Table<*>): Rental = Rental(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Rental = Rental(alias.qualifiedName, this) /** * Rename this table @@ -189,21 +341,55 @@ open class Rental( /** * Rename this table */ - override fun rename(name: Table<*>): Rental = Rental(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Rental = Rental(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row7 = super.fieldsRow() as Row7 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Rental = Rental(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Rental = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Rental = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Rental = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, LocalDateTime?, Long?, Long?, LocalDateTime?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Rental = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, LocalDateTime?, Long?, Long?, LocalDateTime?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Rental = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt index 0c743b3..adec3a4 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt @@ -7,17 +7,15 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDate import java.time.LocalDateTime -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Records -import org.jooq.Row10 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -34,19 +32,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class RewardsReport( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function() + TableOptions.function(), + where, ) { companion object { @@ -111,11 +113,11 @@ open class RewardsReport( */ val ACTIVE: TableField = createField(DSL.name("active"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, arrayOf( + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, arrayOf( DSL.value(null, SQLDataType.INTEGER), DSL.value(null, SQLDataType.NUMERIC) - )) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + ), null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) /** * Create an aliased public.rewards_report table reference @@ -135,7 +137,7 @@ open class RewardsReport( override fun getIdentity(): Identity = super.getIdentity() as Identity override fun `as`(alias: String): RewardsReport = RewardsReport(DSL.name(alias), this, parameters) override fun `as`(alias: Name): RewardsReport = RewardsReport(alias, this, parameters) - override fun `as`(alias: Table<*>): RewardsReport = RewardsReport(alias.getQualifiedName(), this, parameters) + override fun `as`(alias: Table<*>): RewardsReport = RewardsReport(alias.qualifiedName, this, parameters) /** * Rename this table @@ -150,12 +152,7 @@ open class RewardsReport( /** * Rename this table */ - override fun rename(name: Table<*>): RewardsReport = RewardsReport(name.getQualifiedName(), null, parameters) - - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row10 = super.fieldsRow() as Row10 + override fun rename(name: Table<*>): RewardsReport = RewardsReport(name.qualifiedName, null, parameters) /** * Call this table-valued function @@ -178,15 +175,4 @@ open class RewardsReport( minMonthlyPurchases, minDollarAmountPurchased )).let { if (aliased()) it.`as`(unqualifiedName) else it } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - fun mapping(from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(Records.mapping(from)) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - fun mapping(toType: Class, from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt index 1b7b993..5574e0e 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByFilmCategory.kt @@ -5,23 +5,27 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row2 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.SalesByFilmCategoryRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -32,15 +36,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class SalesByFilmCategory( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -55,7 +62,8 @@ open class SalesByFilmCategory( JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY (sum(p.amount)) DESC; - """) + """), + where, ) { companion object { @@ -80,8 +88,9 @@ open class SalesByFilmCategory( */ val TOTAL_SALES: TableField = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.sales_by_film_category table @@ -99,12 +108,10 @@ open class SalesByFilmCategory( * Create a public.sales_by_film_category table reference */ constructor(): this(DSL.name("sales_by_film_category"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, SALES_BY_FILM_CATEGORY, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): SalesByFilmCategory = SalesByFilmCategory(DSL.name(alias), this) override fun `as`(alias: Name): SalesByFilmCategory = SalesByFilmCategory(alias, this) - override fun `as`(alias: Table<*>): SalesByFilmCategory = SalesByFilmCategory(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): SalesByFilmCategory = SalesByFilmCategory(alias.qualifiedName, this) /** * Rename this table @@ -119,21 +126,55 @@ open class SalesByFilmCategory( /** * Rename this table */ - override fun rename(name: Table<*>): SalesByFilmCategory = SalesByFilmCategory(name.getQualifiedName(), null) + override fun rename(name: Table<*>): SalesByFilmCategory = SalesByFilmCategory(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row2 = super.fieldsRow() as Row2 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): SalesByFilmCategory = SalesByFilmCategory(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): SalesByFilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): SalesByFilmCategory = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): SalesByFilmCategory = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (String?, BigDecimal?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): SalesByFilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (String?, BigDecimal?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): SalesByFilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt index 49ff34b..c9dc23d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/SalesByStore.kt @@ -5,23 +5,27 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.SalesByStoreRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -32,15 +36,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class SalesByStore( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -58,7 +65,8 @@ open class SalesByStore( JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city; - """) + """), + where, ) { companion object { @@ -88,8 +96,9 @@ open class SalesByStore( */ val TOTAL_SALES: TableField = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.sales_by_store table reference @@ -105,12 +114,10 @@ open class SalesByStore( * Create a public.sales_by_store table reference */ constructor(): this(DSL.name("sales_by_store"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, SALES_BY_STORE, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): SalesByStore = SalesByStore(DSL.name(alias), this) override fun `as`(alias: Name): SalesByStore = SalesByStore(alias, this) - override fun `as`(alias: Table<*>): SalesByStore = SalesByStore(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): SalesByStore = SalesByStore(alias.qualifiedName, this) /** * Rename this table @@ -125,21 +132,55 @@ open class SalesByStore( /** * Rename this table */ - override fun rename(name: Table<*>): SalesByStore = SalesByStore(name.getQualifiedName(), null) + override fun rename(name: Table<*>): SalesByStore = SalesByStore(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): SalesByStore = SalesByStore(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): SalesByStore = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): SalesByStore = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): SalesByStore = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (String?, String?, BigDecimal?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): SalesByStore = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (String?, String?, BigDecimal?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): SalesByStore = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt index b26fa0f..78ca18d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Staff.kt @@ -5,27 +5,50 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row11 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_STAFF_ID_FKEY import org.jooq.demo.kotlin.db.keys.STAFF_PKEY import org.jooq.demo.kotlin.db.keys.STAFF__STAFF_ADDRESS_ID_FKEY import org.jooq.demo.kotlin.db.keys.STAFF__STAFF_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Payment.PaymentPath +import org.jooq.demo.kotlin.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.StaffRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -39,19 +62,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Staff( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -121,8 +148,9 @@ open class Staff( */ val PICTURE: TableField = createField(DSL.name("picture"), SQLDataType.BLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.staff table reference @@ -139,43 +167,183 @@ open class Staff( */ constructor(): this(DSL.name("staff"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, STAFF, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, STAFF, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class StaffPath : Staff, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): StaffPath = StaffPath(DSL.name(alias), this) + override fun `as`(alias: Name): StaffPath = StaffPath(alias, this) + override fun `as`(alias: Table<*>): StaffPath = StaffPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = STAFF_PKEY override fun getReferences(): List> = listOf(STAFF__STAFF_ADDRESS_ID_FKEY, STAFF__STAFF_STORE_ID_FKEY) - private lateinit var _address: Address - private lateinit var _store: Store + private lateinit var _address: AddressPath /** * Get the implicit join path to the public.address table. */ - fun address(): Address { + fun address(): AddressPath { if (!this::_address.isInitialized) - _address = Address(this, STAFF__STAFF_ADDRESS_ID_FKEY) + _address = AddressPath(this, STAFF__STAFF_ADDRESS_ID_FKEY, null) return _address; } - val address: Address - get(): Address = address() + val address: AddressPath + get(): AddressPath = address() + + private lateinit var _store: StorePath /** * Get the implicit join path to the public.store table. */ - fun store(): Store { + fun store(): StorePath { if (!this::_store.isInitialized) - _store = Store(this, STAFF__STAFF_STORE_ID_FKEY) + _store = StorePath(this, STAFF__STAFF_STORE_ID_FKEY, null) return _store; } - val store: Store - get(): Store = store() + val store: StorePath + get(): StorePath = store() + + private lateinit var _payment: PaymentPath + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + fun payment(): PaymentPath { + if (!this::_payment.isInitialized) + _payment = PaymentPath(this, null, PAYMENT__PAYMENT_STAFF_ID_FKEY.inverseKey) + + return _payment; + } + + val payment: PaymentPath + get(): PaymentPath = payment() + + private lateinit var _paymentP2007_01: PaymentP2007_01Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + fun paymentP2007_01(): PaymentP2007_01Path { + if (!this::_paymentP2007_01.isInitialized) + _paymentP2007_01 = PaymentP2007_01Path(this, null, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_01; + } + + val paymentP2007_01: PaymentP2007_01Path + get(): PaymentP2007_01Path = paymentP2007_01() + + private lateinit var _paymentP2007_02: PaymentP2007_02Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + fun paymentP2007_02(): PaymentP2007_02Path { + if (!this::_paymentP2007_02.isInitialized) + _paymentP2007_02 = PaymentP2007_02Path(this, null, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_02; + } + + val paymentP2007_02: PaymentP2007_02Path + get(): PaymentP2007_02Path = paymentP2007_02() + + private lateinit var _paymentP2007_03: PaymentP2007_03Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + fun paymentP2007_03(): PaymentP2007_03Path { + if (!this::_paymentP2007_03.isInitialized) + _paymentP2007_03 = PaymentP2007_03Path(this, null, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_03; + } + + val paymentP2007_03: PaymentP2007_03Path + get(): PaymentP2007_03Path = paymentP2007_03() + + private lateinit var _paymentP2007_04: PaymentP2007_04Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + fun paymentP2007_04(): PaymentP2007_04Path { + if (!this::_paymentP2007_04.isInitialized) + _paymentP2007_04 = PaymentP2007_04Path(this, null, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_04; + } + + val paymentP2007_04: PaymentP2007_04Path + get(): PaymentP2007_04Path = paymentP2007_04() + + private lateinit var _paymentP2007_05: PaymentP2007_05Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + fun paymentP2007_05(): PaymentP2007_05Path { + if (!this::_paymentP2007_05.isInitialized) + _paymentP2007_05 = PaymentP2007_05Path(this, null, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_05; + } + + val paymentP2007_05: PaymentP2007_05Path + get(): PaymentP2007_05Path = paymentP2007_05() + + private lateinit var _paymentP2007_06: PaymentP2007_06Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + fun paymentP2007_06(): PaymentP2007_06Path { + if (!this::_paymentP2007_06.isInitialized) + _paymentP2007_06 = PaymentP2007_06Path(this, null, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_06; + } + + val paymentP2007_06: PaymentP2007_06Path + get(): PaymentP2007_06Path = paymentP2007_06() + + private lateinit var _rental: RentalPath + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + fun rental(): RentalPath { + if (!this::_rental.isInitialized) + _rental = RentalPath(this, null, RENTAL__RENTAL_STAFF_ID_FKEY.inverseKey) + + return _rental; + } + + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Staff = Staff(DSL.name(alias), this) override fun `as`(alias: Name): Staff = Staff(alias, this) - override fun `as`(alias: Table<*>): Staff = Staff(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Staff = Staff(alias.qualifiedName, this) /** * Rename this table @@ -190,21 +358,55 @@ open class Staff( /** * Rename this table */ - override fun rename(name: Table<*>): Staff = Staff(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Staff = Staff(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Staff = Staff(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Staff = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row11 = super.fieldsRow() as Row11 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Staff = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Staff = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, Long?, String?, Long?, Boolean?, String?, String?, LocalDateTime?, ByteArray?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Staff = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, Long?, String?, Long?, Boolean?, String?, String?, LocalDateTime?, ByteArray?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Staff = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt index 7ded33f..e48571f 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/StaffList.kt @@ -4,23 +4,26 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function +import kotlin.collections.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.StaffListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -31,15 +34,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class StaffList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -56,7 +62,8 @@ open class StaffList( JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where, ) { companion object { @@ -111,8 +118,9 @@ open class StaffList( */ val SID: TableField = createField(DSL.name("sid"), SQLDataType.BIGINT, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.staff_list table reference @@ -128,12 +136,10 @@ open class StaffList( * Create a public.staff_list table reference */ constructor(): this(DSL.name("staff_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, STAFF_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): StaffList = StaffList(DSL.name(alias), this) override fun `as`(alias: Name): StaffList = StaffList(alias, this) - override fun `as`(alias: Table<*>): StaffList = StaffList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): StaffList = StaffList(alias.qualifiedName, this) /** * Rename this table @@ -148,21 +154,55 @@ open class StaffList( /** * Rename this table */ - override fun rename(name: Table<*>): StaffList = StaffList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): StaffList = StaffList(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): StaffList = StaffList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): StaffList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): StaffList = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): StaffList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): StaffList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): StaffList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt index e507064..dd6bfe1 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/Store.kt @@ -5,29 +5,40 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_UNQ_MANAGER_STAFF_ID +import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_STORE_ID_FKEY import org.jooq.demo.kotlin.db.keys.STORE_PKEY import org.jooq.demo.kotlin.db.keys.STORE__STORE_ADDRESS_ID_FKEY import org.jooq.demo.kotlin.db.keys.STORE__STORE_MANAGER_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Inventory.InventoryPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.StoreRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -41,19 +52,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Store( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -88,8 +103,9 @@ open class Store( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.store table reference @@ -106,44 +122,88 @@ open class Store( */ constructor(): this(DSL.name("store"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, STORE, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, STORE, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class StorePath : Store, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): StorePath = StorePath(DSL.name(alias), this) + override fun `as`(alias: Name): StorePath = StorePath(alias, this) + override fun `as`(alias: Table<*>): StorePath = StorePath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_UNQ_MANAGER_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = STORE_PKEY override fun getReferences(): List> = listOf(STORE__STORE_MANAGER_STAFF_ID_FKEY, STORE__STORE_ADDRESS_ID_FKEY) - private lateinit var _staff: Staff - private lateinit var _address: Address + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, STORE__STORE_MANAGER_STAFF_ID_FKEY) + _staff = StaffPath(this, STORE__STORE_MANAGER_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _address: AddressPath /** * Get the implicit join path to the public.address table. */ - fun address(): Address { + fun address(): AddressPath { if (!this::_address.isInitialized) - _address = Address(this, STORE__STORE_ADDRESS_ID_FKEY) + _address = AddressPath(this, STORE__STORE_ADDRESS_ID_FKEY, null) return _address; } - val address: Address - get(): Address = address() + val address: AddressPath + get(): AddressPath = address() + + private lateinit var _customer: CustomerPath + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + fun customer(): CustomerPath { + if (!this::_customer.isInitialized) + _customer = CustomerPath(this, null, CUSTOMER__CUSTOMER_STORE_ID_FKEY.inverseKey) + + return _customer; + } + + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _inventory: InventoryPath + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + fun inventory(): InventoryPath { + if (!this::_inventory.isInitialized) + _inventory = InventoryPath(this, null, INVENTORY__INVENTORY_STORE_ID_FKEY.inverseKey) + + return _inventory; + } + + val inventory: InventoryPath + get(): InventoryPath = inventory() override fun `as`(alias: String): Store = Store(DSL.name(alias), this) override fun `as`(alias: Name): Store = Store(alias, this) - override fun `as`(alias: Table<*>): Store = Store(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Store = Store(alias.qualifiedName, this) /** * Rename this table @@ -158,21 +218,55 @@ open class Store( /** * Rename this table */ - override fun rename(name: Table<*>): Store = Store(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Store = Store(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Store = Store(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Store = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Store = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Store = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Store = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Store = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt index 2299cd1..8c422d7 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.ActorInfo import org.jooq.impl.TableRecordImpl @@ -15,7 +12,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class ActorInfoRecord() : TableRecordImpl(ActorInfo.ACTOR_INFO), Record4 { +open class ActorInfoRecord() : TableRecordImpl(ActorInfo.ACTOR_INFO) { open var actorId: Long? set(value): Unit = set(0, value) @@ -33,53 +30,6 @@ open class ActorInfoRecord() : TableRecordImpl(ActorInfo.ACTOR_ set(value): Unit = set(3, value) get(): String? = get(3) as String? - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = ActorInfo.ACTOR_INFO.ACTOR_ID - override fun field2(): Field = ActorInfo.ACTOR_INFO.FIRST_NAME - override fun field3(): Field = ActorInfo.ACTOR_INFO.LAST_NAME - override fun field4(): Field = ActorInfo.ACTOR_INFO.FILM_INFO - override fun component1(): Long? = actorId - override fun component2(): String? = firstName - override fun component3(): String? = lastName - override fun component4(): String? = filmInfo - override fun value1(): Long? = actorId - override fun value2(): String? = firstName - override fun value3(): String? = lastName - override fun value4(): String? = filmInfo - - override fun value1(value: Long?): ActorInfoRecord { - set(0, value) - return this - } - - override fun value2(value: String?): ActorInfoRecord { - set(1, value) - return this - } - - override fun value3(value: String?): ActorInfoRecord { - set(2, value) - return this - } - - override fun value4(value: String?): ActorInfoRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?): ActorInfoRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised ActorInfoRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt index eaa91a6..db326d5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.Actor import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class ActorRecord() : UpdatableRecordImpl(Actor.ACTOR), Record4 { +open class ActorRecord() : UpdatableRecordImpl(Actor.ACTOR) { open var actorId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class ActorRecord() : UpdatableRecordImpl(Actor.ACTOR), Record override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = Actor.ACTOR.ACTOR_ID - override fun field2(): Field = Actor.ACTOR.FIRST_NAME - override fun field3(): Field = Actor.ACTOR.LAST_NAME - override fun field4(): Field = Actor.ACTOR.LAST_UPDATE - override fun component1(): Long? = actorId - override fun component2(): String? = firstName - override fun component3(): String? = lastName - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = actorId - override fun value2(): String? = firstName - override fun value3(): String? = lastName - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): ActorRecord { - set(0, value) - return this - } - - override fun value2(value: String?): ActorRecord { - set(1, value) - return this - } - - override fun value3(value: String?): ActorRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): ActorRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: LocalDateTime?): ActorRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised ActorRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt index ba9baf0..d6d01c3 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.tables.Address import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class AddressRecord() : UpdatableRecordImpl(Address.ADDRESS), Record8 { +open class AddressRecord() : UpdatableRecordImpl(Address.ADDRESS) { open var addressId: Long? set(value): Unit = set(0, value) @@ -58,89 +55,6 @@ open class AddressRecord() : UpdatableRecordImpl(Address.ADDRESS) override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = Address.ADDRESS.ADDRESS_ID - override fun field2(): Field = Address.ADDRESS.ADDRESS_ - override fun field3(): Field = Address.ADDRESS.ADDRESS2 - override fun field4(): Field = Address.ADDRESS.DISTRICT - override fun field5(): Field = Address.ADDRESS.CITY_ID - override fun field6(): Field = Address.ADDRESS.POSTAL_CODE - override fun field7(): Field = Address.ADDRESS.PHONE - override fun field8(): Field = Address.ADDRESS.LAST_UPDATE - override fun component1(): Long? = addressId - override fun component2(): String? = address - override fun component3(): String? = address2 - override fun component4(): String? = district - override fun component5(): Long? = cityId - override fun component6(): String? = postalCode - override fun component7(): String? = phone - override fun component8(): LocalDateTime? = lastUpdate - override fun value1(): Long? = addressId - override fun value2(): String? = address - override fun value3(): String? = address2 - override fun value4(): String? = district - override fun value5(): Long? = cityId - override fun value6(): String? = postalCode - override fun value7(): String? = phone - override fun value8(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): AddressRecord { - set(0, value) - return this - } - - override fun value2(value: String?): AddressRecord { - set(1, value) - return this - } - - override fun value3(value: String?): AddressRecord { - set(2, value) - return this - } - - override fun value4(value: String?): AddressRecord { - set(3, value) - return this - } - - override fun value5(value: Long?): AddressRecord { - set(4, value) - return this - } - - override fun value6(value: String?): AddressRecord { - set(5, value) - return this - } - - override fun value7(value: String?): AddressRecord { - set(6, value) - return this - } - - override fun value8(value: LocalDateTime?): AddressRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: Long?, value6: String?, value7: String?, value8: LocalDateTime?): AddressRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised AddressRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt index f33a3f0..4099cee 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.Category import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CategoryRecord() : UpdatableRecordImpl(Category.CATEGORY), Record3 { +open class CategoryRecord() : UpdatableRecordImpl(Category.CATEGORY) { open var categoryId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class CategoryRecord() : UpdatableRecordImpl(Category.CATEG override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = Category.CATEGORY.CATEGORY_ID - override fun field2(): Field = Category.CATEGORY.NAME - override fun field3(): Field = Category.CATEGORY.LAST_UPDATE - override fun component1(): Long? = categoryId - override fun component2(): String? = name - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = categoryId - override fun value2(): String? = name - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): CategoryRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CategoryRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): CategoryRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: LocalDateTime?): CategoryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised CategoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt index aa7c1a7..efb321d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.City import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CityRecord() : UpdatableRecordImpl(City.CITY), Record4 { +open class CityRecord() : UpdatableRecordImpl(City.CITY) { open var cityId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class CityRecord() : UpdatableRecordImpl(City.CITY), Record4 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = City.CITY.CITY_ID - override fun field2(): Field = City.CITY.CITY_ - override fun field3(): Field = City.CITY.COUNTRY_ID - override fun field4(): Field = City.CITY.LAST_UPDATE - override fun component1(): Long? = cityId - override fun component2(): String? = city - override fun component3(): Long? = countryId - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = cityId - override fun value2(): String? = city - override fun value3(): Long? = countryId - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): CityRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CityRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): CityRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): CityRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: Long?, value4: LocalDateTime?): CityRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised CityRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt index 6639def..7e3d16e 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.Country import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CountryRecord() : UpdatableRecordImpl(Country.COUNTRY), Record3 { +open class CountryRecord() : UpdatableRecordImpl(Country.COUNTRY) { open var countryId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class CountryRecord() : UpdatableRecordImpl(Country.COUNTRY) override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = Country.COUNTRY.COUNTRY_ID - override fun field2(): Field = Country.COUNTRY.COUNTRY_ - override fun field3(): Field = Country.COUNTRY.LAST_UPDATE - override fun component1(): Long? = countryId - override fun component2(): String? = country - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = countryId - override fun value2(): String? = country - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): CountryRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CountryRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): CountryRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: LocalDateTime?): CountryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised CountryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt index 70e71f0..0e60f5b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record9 -import org.jooq.Row9 import org.jooq.demo.kotlin.db.tables.CustomerList import org.jooq.impl.TableRecordImpl @@ -15,7 +12,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CustomerListRecord() : TableRecordImpl(CustomerList.CUSTOMER_LIST), Record9 { +open class CustomerListRecord() : TableRecordImpl(CustomerList.CUSTOMER_LIST) { open var id: Long? set(value): Unit = set(0, value) @@ -53,98 +50,6 @@ open class CustomerListRecord() : TableRecordImpl(CustomerLi set(value): Unit = set(8, value) get(): Long? = get(8) as Long? - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row9 = super.fieldsRow() as Row9 - override fun valuesRow(): Row9 = super.valuesRow() as Row9 - override fun field1(): Field = CustomerList.CUSTOMER_LIST.ID - override fun field2(): Field = CustomerList.CUSTOMER_LIST.NAME - override fun field3(): Field = CustomerList.CUSTOMER_LIST.ADDRESS - override fun field4(): Field = org.jooq.demo.kotlin.db.tables.CustomerList.CUSTOMER_LIST.`ZIP CODE` - override fun field5(): Field = CustomerList.CUSTOMER_LIST.PHONE - override fun field6(): Field = CustomerList.CUSTOMER_LIST.CITY - override fun field7(): Field = CustomerList.CUSTOMER_LIST.COUNTRY - override fun field8(): Field = CustomerList.CUSTOMER_LIST.NOTES - override fun field9(): Field = CustomerList.CUSTOMER_LIST.SID - override fun component1(): Long? = id - override fun component2(): String? = name - override fun component3(): String? = address - override fun component4(): String? = zipCode - override fun component5(): String? = phone - override fun component6(): String? = city - override fun component7(): String? = country - override fun component8(): String? = notes - override fun component9(): Long? = sid - override fun value1(): Long? = id - override fun value2(): String? = name - override fun value3(): String? = address - override fun value4(): String? = zipCode - override fun value5(): String? = phone - override fun value6(): String? = city - override fun value7(): String? = country - override fun value8(): String? = notes - override fun value9(): Long? = sid - - override fun value1(value: Long?): CustomerListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CustomerListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): CustomerListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): CustomerListRecord { - set(3, value) - return this - } - - override fun value5(value: String?): CustomerListRecord { - set(4, value) - return this - } - - override fun value6(value: String?): CustomerListRecord { - set(5, value) - return this - } - - override fun value7(value: String?): CustomerListRecord { - set(6, value) - return this - } - - override fun value8(value: String?): CustomerListRecord { - set(7, value) - return this - } - - override fun value9(value: Long?): CustomerListRecord { - set(8, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: String?, value6: String?, value7: String?, value8: String?, value9: Long?): CustomerListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - return this - } - /** * Create a detached, initialised CustomerListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt index 3797c9c..ae66341 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt @@ -7,10 +7,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDate import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record10 -import org.jooq.Row10 import org.jooq.demo.kotlin.db.tables.Customer import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CustomerRecord() : UpdatableRecordImpl(Customer.CUSTOMER), Record10 { +open class CustomerRecord() : UpdatableRecordImpl(Customer.CUSTOMER) { open var customerId: Long? set(value): Unit = set(0, value) @@ -67,107 +64,6 @@ open class CustomerRecord() : UpdatableRecordImpl(Customer.CUSTO override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row10 = super.fieldsRow() as Row10 - override fun valuesRow(): Row10 = super.valuesRow() as Row10 - override fun field1(): Field = Customer.CUSTOMER.CUSTOMER_ID - override fun field2(): Field = Customer.CUSTOMER.STORE_ID - override fun field3(): Field = Customer.CUSTOMER.FIRST_NAME - override fun field4(): Field = Customer.CUSTOMER.LAST_NAME - override fun field5(): Field = Customer.CUSTOMER.EMAIL - override fun field6(): Field = Customer.CUSTOMER.ADDRESS_ID - override fun field7(): Field = Customer.CUSTOMER.ACTIVEBOOL - override fun field8(): Field = Customer.CUSTOMER.CREATE_DATE - override fun field9(): Field = Customer.CUSTOMER.LAST_UPDATE - override fun field10(): Field = Customer.CUSTOMER.ACTIVE - override fun component1(): Long? = customerId - override fun component2(): Long? = storeId - override fun component3(): String? = firstName - override fun component4(): String? = lastName - override fun component5(): String? = email - override fun component6(): Long? = addressId - override fun component7(): Boolean? = activebool - override fun component8(): LocalDate? = createDate - override fun component9(): LocalDateTime? = lastUpdate - override fun component10(): Int? = active - override fun value1(): Long? = customerId - override fun value2(): Long? = storeId - override fun value3(): String? = firstName - override fun value4(): String? = lastName - override fun value5(): String? = email - override fun value6(): Long? = addressId - override fun value7(): Boolean? = activebool - override fun value8(): LocalDate? = createDate - override fun value9(): LocalDateTime? = lastUpdate - override fun value10(): Int? = active - - override fun value1(value: Long?): CustomerRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): CustomerRecord { - set(1, value) - return this - } - - override fun value3(value: String?): CustomerRecord { - set(2, value) - return this - } - - override fun value4(value: String?): CustomerRecord { - set(3, value) - return this - } - - override fun value5(value: String?): CustomerRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): CustomerRecord { - set(5, value) - return this - } - - override fun value7(value: Boolean?): CustomerRecord { - set(6, value) - return this - } - - override fun value8(value: LocalDate?): CustomerRecord { - set(7, value) - return this - } - - override fun value9(value: LocalDateTime?): CustomerRecord { - set(8, value) - return this - } - - override fun value10(value: Int?): CustomerRecord { - set(9, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: String?, value4: String?, value5: String?, value6: Long?, value7: Boolean?, value8: LocalDate?, value9: LocalDateTime?, value10: Int?): CustomerRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - return this - } - /** * Create a detached, initialised CustomerRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt index 2f749c3..3f55a8c 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.FilmActor import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmActorRecord() : UpdatableRecordImpl(FilmActor.FILM_ACTOR), Record3 { +open class FilmActorRecord() : UpdatableRecordImpl(FilmActor.FILM_ACTOR) { open var actorId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class FilmActorRecord() : UpdatableRecordImpl(FilmActor.FI override fun key(): Record2 = super.key() as Record2 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = FilmActor.FILM_ACTOR.ACTOR_ID - override fun field2(): Field = FilmActor.FILM_ACTOR.FILM_ID - override fun field3(): Field = FilmActor.FILM_ACTOR.LAST_UPDATE - override fun component1(): Long? = actorId - override fun component2(): Long? = filmId - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = actorId - override fun value2(): Long? = filmId - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): FilmActorRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): FilmActorRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): FilmActorRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: LocalDateTime?): FilmActorRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised FilmActorRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt index 59797e7..1ca5050 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.FilmCategory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmCategoryRecord() : UpdatableRecordImpl(FilmCategory.FILM_CATEGORY), Record3 { +open class FilmCategoryRecord() : UpdatableRecordImpl(FilmCategory.FILM_CATEGORY) { open var filmId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class FilmCategoryRecord() : UpdatableRecordImpl(FilmCa override fun key(): Record2 = super.key() as Record2 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = FilmCategory.FILM_CATEGORY.FILM_ID - override fun field2(): Field = FilmCategory.FILM_CATEGORY.CATEGORY_ID - override fun field3(): Field = FilmCategory.FILM_CATEGORY.LAST_UPDATE - override fun component1(): Long? = filmId - override fun component2(): Long? = categoryId - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = filmId - override fun value2(): Long? = categoryId - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): FilmCategoryRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): FilmCategoryRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): FilmCategoryRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: LocalDateTime?): FilmCategoryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised FilmCategoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt index d73de26..832bdf3 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.kotlin.db.tables.FilmInStock import org.jooq.impl.TableRecordImpl @@ -15,32 +12,12 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmInStockRecord() : TableRecordImpl(FilmInStock.FILM_IN_STOCK), Record1 { +open class FilmInStockRecord() : TableRecordImpl(FilmInStock.FILM_IN_STOCK) { open var pFilmCount: Int? set(value): Unit = set(0, value) get(): Int? = get(0) as Int? - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 - override fun valuesRow(): Row1 = super.valuesRow() as Row1 - override fun field1(): Field = FilmInStock.FILM_IN_STOCK.P_FILM_COUNT - override fun component1(): Int? = pFilmCount - override fun value1(): Int? = pFilmCount - - override fun value1(value: Int?): FilmInStockRecord { - set(0, value) - return this - } - - override fun values(value1: Int?): FilmInStockRecord { - this.value1(value1) - return this - } - /** * Create a detached, initialised FilmInStockRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt index 38d1cee..050adc9 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.FilmList import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmListRecord() : TableRecordImpl(FilmList.FILM_LIST), Record8 { +open class FilmListRecord() : TableRecordImpl(FilmList.FILM_LIST) { open var fid: Long? set(value): Unit = set(0, value) @@ -52,89 +49,6 @@ open class FilmListRecord() : TableRecordImpl(FilmList.FILM_LIST set(value): Unit = set(7, value) get(): String? = get(7) as String? - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = FilmList.FILM_LIST.FID - override fun field2(): Field = FilmList.FILM_LIST.TITLE - override fun field3(): Field = FilmList.FILM_LIST.DESCRIPTION - override fun field4(): Field = FilmList.FILM_LIST.CATEGORY - override fun field5(): Field = FilmList.FILM_LIST.PRICE - override fun field6(): Field = FilmList.FILM_LIST.LENGTH - override fun field7(): Field = FilmList.FILM_LIST.RATING - override fun field8(): Field = FilmList.FILM_LIST.ACTORS - override fun component1(): Long? = fid - override fun component2(): String? = title - override fun component3(): String? = description - override fun component4(): String? = category - override fun component5(): BigDecimal? = price - override fun component6(): Short? = length - override fun component7(): MpaaRating? = rating - override fun component8(): String? = actors - override fun value1(): Long? = fid - override fun value2(): String? = title - override fun value3(): String? = description - override fun value4(): String? = category - override fun value5(): BigDecimal? = price - override fun value6(): Short? = length - override fun value7(): MpaaRating? = rating - override fun value8(): String? = actors - - override fun value1(value: Long?): FilmListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): FilmListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): FilmListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): FilmListRecord { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): FilmListRecord { - set(4, value) - return this - } - - override fun value6(value: Short?): FilmListRecord { - set(5, value) - return this - } - - override fun value7(value: MpaaRating?): FilmListRecord { - set(6, value) - return this - } - - override fun value8(value: String?): FilmListRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: BigDecimal?, value6: Short?, value7: MpaaRating?, value8: String?): FilmListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised FilmListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt index e7179b2..fee14e3 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.kotlin.db.tables.FilmNotInStock import org.jooq.impl.TableRecordImpl @@ -15,32 +12,12 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmNotInStockRecord() : TableRecordImpl(FilmNotInStock.FILM_NOT_IN_STOCK), Record1 { +open class FilmNotInStockRecord() : TableRecordImpl(FilmNotInStock.FILM_NOT_IN_STOCK) { open var pFilmCount: Int? set(value): Unit = set(0, value) get(): Int? = get(0) as Int? - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 - override fun valuesRow(): Row1 = super.valuesRow() as Row1 - override fun field1(): Field = FilmNotInStock.FILM_NOT_IN_STOCK.P_FILM_COUNT - override fun component1(): Int? = pFilmCount - override fun value1(): Int? = pFilmCount - - override fun value1(value: Int?): FilmNotInStockRecord { - set(0, value) - return this - } - - override fun values(value1: Int?): FilmNotInStockRecord { - this.value1(value1) - return this - } - /** * Create a detached, initialised FilmNotInStockRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt index d2c0d31..6f6bad1 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt @@ -7,10 +7,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record14 -import org.jooq.Row14 import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.Film import org.jooq.impl.UpdatableRecordImpl @@ -20,7 +17,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmRecord() : UpdatableRecordImpl(Film.FILM), Record14?, Any?> { +open class FilmRecord() : UpdatableRecordImpl(Film.FILM) { open var filmId: Long? set(value): Unit = set(0, value) @@ -84,147 +81,6 @@ open class FilmRecord() : UpdatableRecordImpl(Film.FILM), Record14 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row14?, Any?> = super.fieldsRow() as Row14?, Any?> - override fun valuesRow(): Row14?, Any?> = super.valuesRow() as Row14?, Any?> - override fun field1(): Field = Film.FILM.FILM_ID - override fun field2(): Field = Film.FILM.TITLE - override fun field3(): Field = Film.FILM.DESCRIPTION - override fun field4(): Field = Film.FILM.RELEASE_YEAR - override fun field5(): Field = Film.FILM.LANGUAGE_ID - override fun field6(): Field = Film.FILM.ORIGINAL_LANGUAGE_ID - override fun field7(): Field = Film.FILM.RENTAL_DURATION - override fun field8(): Field = Film.FILM.RENTAL_RATE - override fun field9(): Field = Film.FILM.LENGTH - override fun field10(): Field = Film.FILM.REPLACEMENT_COST - override fun field11(): Field = Film.FILM.RATING - override fun field12(): Field = Film.FILM.LAST_UPDATE - override fun field13(): Field?> = Film.FILM.SPECIAL_FEATURES - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun field14(): Field = Film.FILM.FULLTEXT - override fun component1(): Long? = filmId - override fun component2(): String? = title - override fun component3(): String? = description - override fun component4(): Int? = releaseYear - override fun component5(): Long? = languageId - override fun component6(): Long? = originalLanguageId - override fun component7(): Short? = rentalDuration - override fun component8(): BigDecimal? = rentalRate - override fun component9(): Short? = length - override fun component10(): BigDecimal? = replacementCost - override fun component11(): MpaaRating? = rating - override fun component12(): LocalDateTime? = lastUpdate - override fun component13(): Array? = specialFeatures - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun component14(): Any? = fulltext - override fun value1(): Long? = filmId - override fun value2(): String? = title - override fun value3(): String? = description - override fun value4(): Int? = releaseYear - override fun value5(): Long? = languageId - override fun value6(): Long? = originalLanguageId - override fun value7(): Short? = rentalDuration - override fun value8(): BigDecimal? = rentalRate - override fun value9(): Short? = length - override fun value10(): BigDecimal? = replacementCost - override fun value11(): MpaaRating? = rating - override fun value12(): LocalDateTime? = lastUpdate - override fun value13(): Array? = specialFeatures - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun value14(): Any? = fulltext - - override fun value1(value: Long?): FilmRecord { - set(0, value) - return this - } - - override fun value2(value: String?): FilmRecord { - set(1, value) - return this - } - - override fun value3(value: String?): FilmRecord { - set(2, value) - return this - } - - override fun value4(value: Int?): FilmRecord { - set(3, value) - return this - } - - override fun value5(value: Long?): FilmRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): FilmRecord { - set(5, value) - return this - } - - override fun value7(value: Short?): FilmRecord { - set(6, value) - return this - } - - override fun value8(value: BigDecimal?): FilmRecord { - set(7, value) - return this - } - - override fun value9(value: Short?): FilmRecord { - set(8, value) - return this - } - - override fun value10(value: BigDecimal?): FilmRecord { - set(9, value) - return this - } - - override fun value11(value: MpaaRating?): FilmRecord { - set(10, value) - return this - } - - override fun value12(value: LocalDateTime?): FilmRecord { - set(11, value) - return this - } - - override fun value13(value: Array?): FilmRecord { - set(12, value) - return this - } - - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun value14(value: Any?): FilmRecord { - set(13, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: Int?, value5: Long?, value6: Long?, value7: Short?, value8: BigDecimal?, value9: Short?, value10: BigDecimal?, value11: MpaaRating?, value12: LocalDateTime?, value13: Array?, value14: Any?): FilmRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this.value12(value12) - this.value13(value13) - this.value14(value14) - return this - } - /** * Create a detached, initialised FilmRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt index b8489ac..ffcc3e5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.Inventory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class InventoryRecord() : UpdatableRecordImpl(Inventory.INVENTORY), Record4 { +open class InventoryRecord() : UpdatableRecordImpl(Inventory.INVENTORY) { open var inventoryId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class InventoryRecord() : UpdatableRecordImpl(Inventory.IN override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = Inventory.INVENTORY.INVENTORY_ID - override fun field2(): Field = Inventory.INVENTORY.FILM_ID - override fun field3(): Field = Inventory.INVENTORY.STORE_ID - override fun field4(): Field = Inventory.INVENTORY.LAST_UPDATE - override fun component1(): Long? = inventoryId - override fun component2(): Long? = filmId - override fun component3(): Long? = storeId - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = inventoryId - override fun value2(): Long? = filmId - override fun value3(): Long? = storeId - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): InventoryRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): InventoryRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): InventoryRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): InventoryRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: LocalDateTime?): InventoryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised InventoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt index a2631bf..a806885 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.Language import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class LanguageRecord() : UpdatableRecordImpl(Language.LANGUAGE), Record3 { +open class LanguageRecord() : UpdatableRecordImpl(Language.LANGUAGE) { open var languageId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class LanguageRecord() : UpdatableRecordImpl(Language.LANGU override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = Language.LANGUAGE.LANGUAGE_ID - override fun field2(): Field = Language.LANGUAGE.NAME - override fun field3(): Field = Language.LANGUAGE.LAST_UPDATE - override fun component1(): Long? = languageId - override fun component2(): String? = name - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = languageId - override fun value2(): String? = name - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): LanguageRecord { - set(0, value) - return this - } - - override fun value2(value: String?): LanguageRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): LanguageRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: LocalDateTime?): LanguageRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised LanguageRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt index ef0a40a..c60f09a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.NicerButSlowerFilmList import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class NicerButSlowerFilmListRecord() : TableRecordImpl(NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST), Record8 { +open class NicerButSlowerFilmListRecord() : TableRecordImpl(NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST) { open var fid: Long? set(value): Unit = set(0, value) @@ -52,89 +49,6 @@ open class NicerButSlowerFilmListRecord() : TableRecordImpl = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.FID - override fun field2(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.TITLE - override fun field3(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.DESCRIPTION - override fun field4(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.CATEGORY - override fun field5(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.PRICE - override fun field6(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.LENGTH - override fun field7(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.RATING - override fun field8(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.ACTORS - override fun component1(): Long? = fid - override fun component2(): String? = title - override fun component3(): String? = description - override fun component4(): String? = category - override fun component5(): BigDecimal? = price - override fun component6(): Short? = length - override fun component7(): MpaaRating? = rating - override fun component8(): String? = actors - override fun value1(): Long? = fid - override fun value2(): String? = title - override fun value3(): String? = description - override fun value4(): String? = category - override fun value5(): BigDecimal? = price - override fun value6(): Short? = length - override fun value7(): MpaaRating? = rating - override fun value8(): String? = actors - - override fun value1(value: Long?): NicerButSlowerFilmListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): NicerButSlowerFilmListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): NicerButSlowerFilmListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): NicerButSlowerFilmListRecord { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): NicerButSlowerFilmListRecord { - set(4, value) - return this - } - - override fun value6(value: Short?): NicerButSlowerFilmListRecord { - set(5, value) - return this - } - - override fun value7(value: MpaaRating?): NicerButSlowerFilmListRecord { - set(6, value) - return this - } - - override fun value8(value: String?): NicerButSlowerFilmListRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: BigDecimal?, value6: Short?, value7: MpaaRating?, value8: String?): NicerButSlowerFilmListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised NicerButSlowerFilmListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt index b34209e..0cabf8b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_01 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_01Record() : TableRecordImpl(PaymentP2007_01.PAYMENT_P2007_01), Record6 { +open class PaymentP2007_01Record() : TableRecordImpl(PaymentP2007_01.PAYMENT_P2007_01) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_01Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_ID - override fun field2(): Field = PaymentP2007_01.PAYMENT_P2007_01.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_01.PAYMENT_P2007_01.STAFF_ID - override fun field4(): Field = PaymentP2007_01.PAYMENT_P2007_01.RENTAL_ID - override fun field5(): Field = PaymentP2007_01.PAYMENT_P2007_01.AMOUNT - override fun field6(): Field = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_01Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_01Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_01Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_01Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_01Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_01Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_01Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_01Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt index 5cb93b0..8e5c29b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_02 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_02Record() : TableRecordImpl(PaymentP2007_02.PAYMENT_P2007_02), Record6 { +open class PaymentP2007_02Record() : TableRecordImpl(PaymentP2007_02.PAYMENT_P2007_02) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_02Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_ID - override fun field2(): Field = PaymentP2007_02.PAYMENT_P2007_02.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_02.PAYMENT_P2007_02.STAFF_ID - override fun field4(): Field = PaymentP2007_02.PAYMENT_P2007_02.RENTAL_ID - override fun field5(): Field = PaymentP2007_02.PAYMENT_P2007_02.AMOUNT - override fun field6(): Field = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_02Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_02Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_02Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_02Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_02Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_02Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_02Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_02Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt index c7c86e8..6e27765 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_03 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_03Record() : TableRecordImpl(PaymentP2007_03.PAYMENT_P2007_03), Record6 { +open class PaymentP2007_03Record() : TableRecordImpl(PaymentP2007_03.PAYMENT_P2007_03) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_03Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_ID - override fun field2(): Field = PaymentP2007_03.PAYMENT_P2007_03.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_03.PAYMENT_P2007_03.STAFF_ID - override fun field4(): Field = PaymentP2007_03.PAYMENT_P2007_03.RENTAL_ID - override fun field5(): Field = PaymentP2007_03.PAYMENT_P2007_03.AMOUNT - override fun field6(): Field = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_03Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_03Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_03Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_03Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_03Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_03Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_03Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_03Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt index d19447e..f8b6a26 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_04 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_04Record() : TableRecordImpl(PaymentP2007_04.PAYMENT_P2007_04), Record6 { +open class PaymentP2007_04Record() : TableRecordImpl(PaymentP2007_04.PAYMENT_P2007_04) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_04Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_ID - override fun field2(): Field = PaymentP2007_04.PAYMENT_P2007_04.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_04.PAYMENT_P2007_04.STAFF_ID - override fun field4(): Field = PaymentP2007_04.PAYMENT_P2007_04.RENTAL_ID - override fun field5(): Field = PaymentP2007_04.PAYMENT_P2007_04.AMOUNT - override fun field6(): Field = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_04Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_04Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_04Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_04Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_04Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_04Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_04Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_04Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt index 054d1b2..c7ef019 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_05 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_05Record() : TableRecordImpl(PaymentP2007_05.PAYMENT_P2007_05), Record6 { +open class PaymentP2007_05Record() : TableRecordImpl(PaymentP2007_05.PAYMENT_P2007_05) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_05Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_ID - override fun field2(): Field = PaymentP2007_05.PAYMENT_P2007_05.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_05.PAYMENT_P2007_05.STAFF_ID - override fun field4(): Field = PaymentP2007_05.PAYMENT_P2007_05.RENTAL_ID - override fun field5(): Field = PaymentP2007_05.PAYMENT_P2007_05.AMOUNT - override fun field6(): Field = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_05Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_05Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_05Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_05Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_05Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_05Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_05Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_05Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt index a809a5b..2cc309b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_06 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_06Record() : TableRecordImpl(PaymentP2007_06.PAYMENT_P2007_06), Record6 { +open class PaymentP2007_06Record() : TableRecordImpl(PaymentP2007_06.PAYMENT_P2007_06) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_06Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_ID - override fun field2(): Field = PaymentP2007_06.PAYMENT_P2007_06.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_06.PAYMENT_P2007_06.STAFF_ID - override fun field4(): Field = PaymentP2007_06.PAYMENT_P2007_06.RENTAL_ID - override fun field5(): Field = PaymentP2007_06.PAYMENT_P2007_06.AMOUNT - override fun field6(): Field = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_06Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_06Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_06Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_06Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_06Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_06Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_06Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_06Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt index b014ffd..eb629fd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt @@ -7,10 +7,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.Payment import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentRecord() : UpdatableRecordImpl(Payment.PAYMENT), Record6 { +open class PaymentRecord() : UpdatableRecordImpl(Payment.PAYMENT) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -51,71 +48,6 @@ open class PaymentRecord() : UpdatableRecordImpl(Payment.PAYMENT) override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = Payment.PAYMENT.PAYMENT_ID - override fun field2(): Field = Payment.PAYMENT.CUSTOMER_ID - override fun field3(): Field = Payment.PAYMENT.STAFF_ID - override fun field4(): Field = Payment.PAYMENT.RENTAL_ID - override fun field5(): Field = Payment.PAYMENT.AMOUNT - override fun field6(): Field = Payment.PAYMENT.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentRecord { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentRecord { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentRecord { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentRecord { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt index b88bf6a..4cd6540 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record7 -import org.jooq.Row7 import org.jooq.demo.kotlin.db.tables.Rental import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class RentalRecord() : UpdatableRecordImpl(Rental.RENTAL), Record7 { +open class RentalRecord() : UpdatableRecordImpl(Rental.RENTAL) { open var rentalId: Long? set(value): Unit = set(0, value) @@ -54,80 +51,6 @@ open class RentalRecord() : UpdatableRecordImpl(Rental.RENTAL), Re override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row7 = super.fieldsRow() as Row7 - override fun valuesRow(): Row7 = super.valuesRow() as Row7 - override fun field1(): Field = Rental.RENTAL.RENTAL_ID - override fun field2(): Field = Rental.RENTAL.RENTAL_DATE - override fun field3(): Field = Rental.RENTAL.INVENTORY_ID - override fun field4(): Field = Rental.RENTAL.CUSTOMER_ID - override fun field5(): Field = Rental.RENTAL.RETURN_DATE - override fun field6(): Field = Rental.RENTAL.STAFF_ID - override fun field7(): Field = Rental.RENTAL.LAST_UPDATE - override fun component1(): Long? = rentalId - override fun component2(): LocalDateTime? = rentalDate - override fun component3(): Long? = inventoryId - override fun component4(): Long? = customerId - override fun component5(): LocalDateTime? = returnDate - override fun component6(): Long? = staffId - override fun component7(): LocalDateTime? = lastUpdate - override fun value1(): Long? = rentalId - override fun value2(): LocalDateTime? = rentalDate - override fun value3(): Long? = inventoryId - override fun value4(): Long? = customerId - override fun value5(): LocalDateTime? = returnDate - override fun value6(): Long? = staffId - override fun value7(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): RentalRecord { - set(0, value) - return this - } - - override fun value2(value: LocalDateTime?): RentalRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): RentalRecord { - set(2, value) - return this - } - - override fun value4(value: Long?): RentalRecord { - set(3, value) - return this - } - - override fun value5(value: LocalDateTime?): RentalRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): RentalRecord { - set(5, value) - return this - } - - override fun value7(value: LocalDateTime?): RentalRecord { - set(6, value) - return this - } - - override fun values(value1: Long?, value2: LocalDateTime?, value3: Long?, value4: Long?, value5: LocalDateTime?, value6: Long?, value7: LocalDateTime?): RentalRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - return this - } - /** * Create a detached, initialised RentalRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt index 8a0275c..e38bca9 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record2 -import org.jooq.Row2 import org.jooq.demo.kotlin.db.tables.SalesByFilmCategory import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class SalesByFilmCategoryRecord() : TableRecordImpl(SalesByFilmCategory.SALES_BY_FILM_CATEGORY), Record2 { +open class SalesByFilmCategoryRecord() : TableRecordImpl(SalesByFilmCategory.SALES_BY_FILM_CATEGORY) { open var category: String? set(value): Unit = set(0, value) @@ -27,35 +24,6 @@ open class SalesByFilmCategoryRecord() : TableRecordImpl = super.fieldsRow() as Row2 - override fun valuesRow(): Row2 = super.valuesRow() as Row2 - override fun field1(): Field = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.CATEGORY - override fun field2(): Field = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.TOTAL_SALES - override fun component1(): String? = category - override fun component2(): BigDecimal? = totalSales - override fun value1(): String? = category - override fun value2(): BigDecimal? = totalSales - - override fun value1(value: String?): SalesByFilmCategoryRecord { - set(0, value) - return this - } - - override fun value2(value: BigDecimal?): SalesByFilmCategoryRecord { - set(1, value) - return this - } - - override fun values(value1: String?, value2: BigDecimal?): SalesByFilmCategoryRecord { - this.value1(value1) - this.value2(value2) - return this - } - /** * Create a detached, initialised SalesByFilmCategoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt index c7a1a4c..ed31866 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.SalesByStore import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class SalesByStoreRecord() : TableRecordImpl(SalesByStore.SALES_BY_STORE), Record3 { +open class SalesByStoreRecord() : TableRecordImpl(SalesByStore.SALES_BY_STORE) { open var store: String? set(value): Unit = set(0, value) @@ -31,44 +28,6 @@ open class SalesByStoreRecord() : TableRecordImpl(SalesBySto set(value): Unit = set(2, value) get(): BigDecimal? = get(2) as BigDecimal? - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = SalesByStore.SALES_BY_STORE.STORE - override fun field2(): Field = SalesByStore.SALES_BY_STORE.MANAGER - override fun field3(): Field = SalesByStore.SALES_BY_STORE.TOTAL_SALES - override fun component1(): String? = store - override fun component2(): String? = manager - override fun component3(): BigDecimal? = totalSales - override fun value1(): String? = store - override fun value2(): String? = manager - override fun value3(): BigDecimal? = totalSales - - override fun value1(value: String?): SalesByStoreRecord { - set(0, value) - return this - } - - override fun value2(value: String?): SalesByStoreRecord { - set(1, value) - return this - } - - override fun value3(value: BigDecimal?): SalesByStoreRecord { - set(2, value) - return this - } - - override fun values(value1: String?, value2: String?, value3: BigDecimal?): SalesByStoreRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised SalesByStoreRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt index ece29ce..b96b763 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.tables.StaffList import org.jooq.impl.TableRecordImpl @@ -15,7 +12,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class StaffListRecord() : TableRecordImpl(StaffList.STAFF_LIST), Record8 { +open class StaffListRecord() : TableRecordImpl(StaffList.STAFF_LIST) { open var id: Long? set(value): Unit = set(0, value) @@ -49,89 +46,6 @@ open class StaffListRecord() : TableRecordImpl(StaffList.STAFF_ set(value): Unit = set(7, value) get(): Long? = get(7) as Long? - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = StaffList.STAFF_LIST.ID - override fun field2(): Field = StaffList.STAFF_LIST.NAME - override fun field3(): Field = StaffList.STAFF_LIST.ADDRESS - override fun field4(): Field = org.jooq.demo.kotlin.db.tables.StaffList.STAFF_LIST.`ZIP CODE` - override fun field5(): Field = StaffList.STAFF_LIST.PHONE - override fun field6(): Field = StaffList.STAFF_LIST.CITY - override fun field7(): Field = StaffList.STAFF_LIST.COUNTRY - override fun field8(): Field = StaffList.STAFF_LIST.SID - override fun component1(): Long? = id - override fun component2(): String? = name - override fun component3(): String? = address - override fun component4(): String? = zipCode - override fun component5(): String? = phone - override fun component6(): String? = city - override fun component7(): String? = country - override fun component8(): Long? = sid - override fun value1(): Long? = id - override fun value2(): String? = name - override fun value3(): String? = address - override fun value4(): String? = zipCode - override fun value5(): String? = phone - override fun value6(): String? = city - override fun value7(): String? = country - override fun value8(): Long? = sid - - override fun value1(value: Long?): StaffListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): StaffListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): StaffListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): StaffListRecord { - set(3, value) - return this - } - - override fun value5(value: String?): StaffListRecord { - set(4, value) - return this - } - - override fun value6(value: String?): StaffListRecord { - set(5, value) - return this - } - - override fun value7(value: String?): StaffListRecord { - set(6, value) - return this - } - - override fun value8(value: Long?): StaffListRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: String?, value6: String?, value7: String?, value8: Long?): StaffListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised StaffListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt index 04b3023..10451e5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record11 -import org.jooq.Row11 import org.jooq.demo.kotlin.db.tables.Staff import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class StaffRecord() : UpdatableRecordImpl(Staff.STAFF), Record11 { +open class StaffRecord() : UpdatableRecordImpl(Staff.STAFF) { open var staffId: Long? set(value): Unit = set(0, value) @@ -70,116 +67,6 @@ open class StaffRecord() : UpdatableRecordImpl(Staff.STAFF), Record override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row11 = super.fieldsRow() as Row11 - override fun valuesRow(): Row11 = super.valuesRow() as Row11 - override fun field1(): Field = Staff.STAFF.STAFF_ID - override fun field2(): Field = Staff.STAFF.FIRST_NAME - override fun field3(): Field = Staff.STAFF.LAST_NAME - override fun field4(): Field = Staff.STAFF.ADDRESS_ID - override fun field5(): Field = Staff.STAFF.EMAIL - override fun field6(): Field = Staff.STAFF.STORE_ID - override fun field7(): Field = Staff.STAFF.ACTIVE - override fun field8(): Field = Staff.STAFF.USERNAME - override fun field9(): Field = Staff.STAFF.PASSWORD - override fun field10(): Field = Staff.STAFF.LAST_UPDATE - override fun field11(): Field = Staff.STAFF.PICTURE - override fun component1(): Long? = staffId - override fun component2(): String? = firstName - override fun component3(): String? = lastName - override fun component4(): Long? = addressId - override fun component5(): String? = email - override fun component6(): Long? = storeId - override fun component7(): Boolean? = active - override fun component8(): String? = username - override fun component9(): String? = password - override fun component10(): LocalDateTime? = lastUpdate - override fun component11(): ByteArray? = picture - override fun value1(): Long? = staffId - override fun value2(): String? = firstName - override fun value3(): String? = lastName - override fun value4(): Long? = addressId - override fun value5(): String? = email - override fun value6(): Long? = storeId - override fun value7(): Boolean? = active - override fun value8(): String? = username - override fun value9(): String? = password - override fun value10(): LocalDateTime? = lastUpdate - override fun value11(): ByteArray? = picture - - override fun value1(value: Long?): StaffRecord { - set(0, value) - return this - } - - override fun value2(value: String?): StaffRecord { - set(1, value) - return this - } - - override fun value3(value: String?): StaffRecord { - set(2, value) - return this - } - - override fun value4(value: Long?): StaffRecord { - set(3, value) - return this - } - - override fun value5(value: String?): StaffRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): StaffRecord { - set(5, value) - return this - } - - override fun value7(value: Boolean?): StaffRecord { - set(6, value) - return this - } - - override fun value8(value: String?): StaffRecord { - set(7, value) - return this - } - - override fun value9(value: String?): StaffRecord { - set(8, value) - return this - } - - override fun value10(value: LocalDateTime?): StaffRecord { - set(9, value) - return this - } - - override fun value11(value: ByteArray?): StaffRecord { - set(10, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: Long?, value5: String?, value6: Long?, value7: Boolean?, value8: String?, value9: String?, value10: LocalDateTime?, value11: ByteArray?): StaffRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - return this - } - /** * Create a detached, initialised StaffRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt index 992c13c..9511316 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.Store import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class StoreRecord() : UpdatableRecordImpl(Store.STORE), Record4 { +open class StoreRecord() : UpdatableRecordImpl(Store.STORE) { open var storeId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class StoreRecord() : UpdatableRecordImpl(Store.STORE), Record override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = Store.STORE.STORE_ID - override fun field2(): Field = Store.STORE.MANAGER_STAFF_ID - override fun field3(): Field = Store.STORE.ADDRESS_ID - override fun field4(): Field = Store.STORE.LAST_UPDATE - override fun component1(): Long? = storeId - override fun component2(): Long? = managerStaffId - override fun component3(): Long? = addressId - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = storeId - override fun value2(): Long? = managerStaffId - override fun value3(): Long? = addressId - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): StoreRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): StoreRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): StoreRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): StoreRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: LocalDateTime?): StoreRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised StoreRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt index 478c10d..2eaaef9 100644 --- a/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt +++ b/jOOQ-demo-oss/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt @@ -8,7 +8,6 @@ import org.jooq.tools.jdbc.MockConnection import org.jooq.tools.jdbc.MockDataProvider import org.jooq.tools.jdbc.MockFileDatabase import org.jooq.tools.jdbc.MockResult -import org.junit.After import org.junit.Test @@ -27,7 +26,11 @@ class Demo14Mocking : AbstractDemo() { val p = MockDataProvider { c -> arrayOf( if (c.sql().contains("select")) - MockResult(ctx.newRecord(ACTOR).values(1L, "A", "A", null)) + MockResult( + ctx.newRecord(ACTOR) + .with(ACTOR.ACTOR_ID, 1L) + .with(ACTOR.FIRST_NAME, "A") + .with(ACTOR.LAST_NAME, "A")) else MockResult(0) ) diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml b/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml index 0b9af7e..b8cfdd6 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml +++ b/jOOQ-demo-oss/jOOQ-demo-scala/pom.xml @@ -6,7 +6,7 @@ org.jooq jooq-demo - 3.18.7 + 3.19.1 jooq-demo-scala @@ -134,6 +134,11 @@ 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/DefaultCatalog.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/DefaultCatalog.scala index b9846a2..1406f18 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/DefaultCatalog.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/DefaultCatalog.scala @@ -35,10 +35,10 @@ class DefaultCatalog extends CatalogImpl("") { ) /** - * A reference to the 3.18 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.18. You can turn off the generation of this reference by + * release, namely: 3.19. You can turn off the generation of this reference by * specifying /configuration/generator/generate/jooqVersionReference */ - private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18 + private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19 } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java index 4008182..caa19d1 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java @@ -52,7 +52,9 @@ public String getLiteral() { } /** - * Lookup a value of this EnumType by its literal + * Lookup a value of this EnumType by its literal. Returns + * null, if no such value could be found, see {@link + * EnumType#lookupLiteral(Class, String)}. */ public static MpaaRating lookupLiteral(String literal) { return EnumType.lookupLiteral(MpaaRating.class, literal); 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 742c8b8..0a6cb3e 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -43,6 +49,11 @@ object Actor { * The reference instance of public.actor */ val ACTOR = new Actor + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class ActorPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, ActorRecord], parentPath: InverseForeignKey[_ <: Record, ActorRecord]) extends Actor(path, childPath, parentPath) with Path[ActorRecord] } /** @@ -50,20 +61,24 @@ object Actor { */ class Actor( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, ActorRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, ActorRecord], + parentPath: InverseForeignKey[_ <: Record, ActorRecord], aliased: Table[ActorRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[ActorRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +106,8 @@ extends TableImpl[ActorRecord]( */ val LAST_UPDATE: TableField[ActorRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[ActorRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[ActorRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[ActorRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.actor table reference @@ -108,9 +124,9 @@ extends TableImpl[ActorRecord]( */ def this() = this(DSL.name("actor"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, ActorRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Actor.ACTOR, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, ActorRecord], parentPath: InverseForeignKey[_ <: Record, ActorRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Actor.ACTOR, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_ACTOR_LAST_NAME) @@ -136,19 +152,48 @@ extends TableImpl[ActorRecord]( */ override def rename(name: Table[_]): Actor = new Actor(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Actor = new Actor(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Actor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Actor = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Actor = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): Actor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): Actor = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala index dfc70cf..92c1d3e 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.ActorInfoRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object ActorInfo { */ class ActorInfo( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, ActorInfoRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, ActorInfoRecord], + parentPath: InverseForeignKey[_ <: Record, ActorInfoRecord], aliased: Table[ActorInfoRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[ActorInfoRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -70,7 +77,8 @@ extends TableImpl[ActorInfoRecord]( LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name; - """) + """), + where ) { /** @@ -98,7 +106,8 @@ extends TableImpl[ActorInfoRecord]( */ val FILM_INFO: TableField[ActorInfoRecord, String] = createField(DSL.name("film_info"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[ActorInfoRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[ActorInfoRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[ActorInfoRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.actor_info table reference @@ -115,9 +124,7 @@ extends TableImpl[ActorInfoRecord]( */ def this() = this(DSL.name("actor_info"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, ActorInfoRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.ActorInfo.ACTOR_INFO, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): ActorInfo = new ActorInfo(DSL.name(alias), this) override def as(alias: Name): ActorInfo = new ActorInfo(alias, this) override def as(alias: Table[_]): ActorInfo = new ActorInfo(alias.getQualifiedName(), this) @@ -137,19 +144,48 @@ extends TableImpl[ActorInfoRecord]( */ override def rename(name: Table[_]): ActorInfo = new ActorInfo(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, String, String, String] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): ActorInfo = new ActorInfo(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): ActorInfo = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): ActorInfo = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): ActorInfo = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): ActorInfo = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): ActorInfo = where(DSL.notExists(select)) } 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 257fae8..399f614 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.City.CityPath import org.jooq.demo.skala.db.tables.records.AddressRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +50,11 @@ object Address { * The reference instance of public.address */ val ADDRESS = new Address + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class AddressPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, AddressRecord], parentPath: InverseForeignKey[_ <: Record, AddressRecord]) extends Address(path, childPath, parentPath) with Path[AddressRecord] } /** @@ -50,20 +62,24 @@ object Address { */ class Address( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, AddressRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, AddressRecord], + parentPath: InverseForeignKey[_ <: Record, AddressRecord], aliased: Table[AddressRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[AddressRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -111,7 +127,8 @@ extends TableImpl[AddressRecord]( */ val LAST_UPDATE: TableField[AddressRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[AddressRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[AddressRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[AddressRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.address table reference @@ -128,9 +145,9 @@ extends TableImpl[AddressRecord]( */ def this() = this(DSL.name("address"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, AddressRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Address.ADDRESS, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, AddressRecord], parentPath: InverseForeignKey[_ <: Record, AddressRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Address.ADDRESS, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_CITY_ID) @@ -143,7 +160,7 @@ extends TableImpl[AddressRecord]( /** * Get the implicit join path to the public.city table. */ - lazy val city: City = { new City(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY) } + lazy val city: CityPath = { new CityPath(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY, null) } 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) @@ -163,19 +180,48 @@ extends TableImpl[AddressRecord]( */ override def rename(name: Table[_]): Address = new Address(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, Long, String, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Address = new Address(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Address = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Address = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Address = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): Address = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): Address = where(DSL.notExists(select)) } 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 33326a4..c2b6586 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 @@ -4,20 +4,26 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -39,6 +45,11 @@ object Category { * The reference instance of public.category */ val CATEGORY = new Category + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CategoryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CategoryRecord], parentPath: InverseForeignKey[_ <: Record, CategoryRecord]) extends Category(path, childPath, parentPath) with Path[CategoryRecord] } /** @@ -46,20 +57,24 @@ object Category { */ class Category( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CategoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CategoryRecord], + parentPath: InverseForeignKey[_ <: Record, CategoryRecord], aliased: Table[CategoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CategoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -82,7 +97,8 @@ extends TableImpl[CategoryRecord]( */ val LAST_UPDATE: TableField[CategoryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[CategoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CategoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CategoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.category table reference @@ -99,9 +115,9 @@ extends TableImpl[CategoryRecord]( */ def this() = this(DSL.name("category"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CategoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Category.CATEGORY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CategoryRecord], parentPath: InverseForeignKey[_ <: Record, CategoryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Category.CATEGORY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[CategoryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CategoryRecord, Long] ] @@ -125,19 +141,48 @@ extends TableImpl[CategoryRecord]( */ override def rename(name: Table[_]): Category = new Category(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Category = new Category(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Category = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Category = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Category = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): Category = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): Category = where(DSL.notExists(select)) } 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 58d92ef..b103bfb 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.Country.CountryPath import org.jooq.demo.skala.db.tables.records.CityRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +50,11 @@ object City { * The reference instance of public.city */ val CITY = new City + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CityPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CityRecord], parentPath: InverseForeignKey[_ <: Record, CityRecord]) extends City(path, childPath, parentPath) with Path[CityRecord] } /** @@ -50,20 +62,24 @@ object City { */ class City( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CityRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CityRecord], + parentPath: InverseForeignKey[_ <: Record, CityRecord], aliased: Table[CityRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CityRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +107,8 @@ extends TableImpl[CityRecord]( */ val LAST_UPDATE: TableField[CityRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[CityRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CityRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CityRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.city table reference @@ -108,9 +125,9 @@ extends TableImpl[CityRecord]( */ def this() = this(DSL.name("city"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CityRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.City.CITY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CityRecord], parentPath: InverseForeignKey[_ <: Record, CityRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.City.CITY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_COUNTRY_ID) @@ -123,7 +140,7 @@ extends TableImpl[CityRecord]( /** * Get the implicit join path to the public.country table. */ - lazy val country: Country = { new Country(this, Keys.CITY__CITY_COUNTRY_ID_FKEY) } + lazy val country: CountryPath = { new CountryPath(this, Keys.CITY__CITY_COUNTRY_ID_FKEY, null) } 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) @@ -143,19 +160,48 @@ extends TableImpl[CityRecord]( */ override def rename(name: Table[_]): City = new City(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, String, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): City = new City(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): City = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): City = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): City = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): City = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): City = where(DSL.notExists(select)) } 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 415bd62..28a942f 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 @@ -4,20 +4,26 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -39,6 +45,11 @@ object Country { * The reference instance of public.country */ val COUNTRY = new Country + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CountryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CountryRecord], parentPath: InverseForeignKey[_ <: Record, CountryRecord]) extends Country(path, childPath, parentPath) with Path[CountryRecord] } /** @@ -46,20 +57,24 @@ object Country { */ class Country( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CountryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CountryRecord], + parentPath: InverseForeignKey[_ <: Record, CountryRecord], aliased: Table[CountryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CountryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -82,7 +97,8 @@ extends TableImpl[CountryRecord]( */ val LAST_UPDATE: TableField[CountryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[CountryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CountryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CountryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.country table reference @@ -99,9 +115,9 @@ extends TableImpl[CountryRecord]( */ def this() = this(DSL.name("country"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CountryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Country.COUNTRY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CountryRecord], parentPath: InverseForeignKey[_ <: Record, CountryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Country.COUNTRY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[CountryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CountryRecord, Long] ] @@ -125,19 +141,48 @@ extends TableImpl[CountryRecord]( */ override def rename(name: Table[_]): Country = new Country(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Country = new Country(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Country = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Country = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Country = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): Country = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): Country = where(DSL.notExists(select)) } 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 b08dfc0..df8c86f 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 @@ -12,18 +12,23 @@ import java.lang.String import java.time.LocalDate import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row10 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -31,6 +36,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.Address.AddressPath +import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.CustomerRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -46,6 +53,11 @@ object Customer { * The reference instance of public.customer */ val CUSTOMER = new Customer + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CustomerPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CustomerRecord], parentPath: InverseForeignKey[_ <: Record, CustomerRecord]) extends Customer(path, childPath, parentPath) with Path[CustomerRecord] } /** @@ -53,20 +65,24 @@ object Customer { */ class Customer( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CustomerRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CustomerRecord], + parentPath: InverseForeignKey[_ <: Record, CustomerRecord], aliased: Table[CustomerRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CustomerRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -124,7 +140,8 @@ extends TableImpl[CustomerRecord]( */ val ACTIVE: TableField[CustomerRecord, Integer] = createField(DSL.name("active"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CustomerRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.customer table reference @@ -141,9 +158,9 @@ extends TableImpl[CustomerRecord]( */ def this() = this(DSL.name("customer"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CustomerRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Customer.CUSTOMER, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CustomerRecord], parentPath: InverseForeignKey[_ <: Record, CustomerRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Customer.CUSTOMER, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_ADDRESS_ID, Indexes.IDX_FK_STORE_ID, Indexes.IDX_LAST_NAME) @@ -156,12 +173,12 @@ extends TableImpl[CustomerRecord]( /** * Get the implicit join path to the public.store table. */ - lazy val store: Store = { new Store(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY) } + lazy val store: StorePath = { new StorePath(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY, null) } /** * Get the implicit join path to the public.address table. */ - lazy val address: Address = { new Address(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY) } + lazy val address: AddressPath = { new AddressPath(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null) } 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) @@ -181,19 +198,48 @@ extends TableImpl[CustomerRecord]( */ override def rename(name: Table[_]): Customer = new Customer(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.fieldsRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Customer = new Customer(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Customer = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Customer = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Customer = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) + override def whereExists(select: Select[_]): Customer = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) + override def whereNotExists(select: Select[_]): Customer = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala index 63bd227..70e91b7 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row9 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.CustomerListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object CustomerList { */ class CustomerList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CustomerListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CustomerListRecord], + parentPath: InverseForeignKey[_ <: Record, CustomerListRecord], aliased: Table[CustomerListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CustomerListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -72,7 +79,8 @@ extends TableImpl[CustomerListRecord]( JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where ) { /** @@ -125,7 +133,8 @@ extends TableImpl[CustomerListRecord]( */ val SID: TableField[CustomerListRecord, Long] = createField(DSL.name("sid"), SQLDataType.BIGINT, "") - private def this(alias: Name, aliased: Table[CustomerListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CustomerListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CustomerListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.customer_list table reference @@ -142,9 +151,7 @@ extends TableImpl[CustomerListRecord]( */ def this() = this(DSL.name("customer_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CustomerListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.CustomerList.CUSTOMER_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): CustomerList = new CustomerList(DSL.name(alias), this) override def as(alias: Name): CustomerList = new CustomerList(alias, this) override def as(alias: Table[_]): CustomerList = new CustomerList(alias.getQualifiedName(), this) @@ -164,19 +171,48 @@ extends TableImpl[CustomerListRecord]( */ override def rename(name: Table[_]): CustomerList = new CustomerList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row9[Long, String, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row9[Long, String, String, String, String, String, String, String, Long] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): CustomerList = new CustomerList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): CustomerList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): CustomerList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): CustomerList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9())) + override def whereExists(select: Select[_]): CustomerList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9())) + override def whereNotExists(select: Select[_]): CustomerList = where(DSL.notExists(select)) } 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 9504f3e..35a989e 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 @@ -4,6 +4,7 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Deprecated import java.lang.Integer @@ -14,28 +15,36 @@ import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row14 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey +import org.jooq.demo.skala.db.Domains 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.Language.LanguagePath import org.jooq.demo.skala.db.tables.records.FilmRecord import org.jooq.impl.DSL +import org.jooq.impl.DefaultDataType import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -49,6 +58,11 @@ object Film { * The reference instance of public.film */ val FILM = new Film + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class FilmPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmRecord], parentPath: InverseForeignKey[_ <: Record, FilmRecord]) extends Film(path, childPath, parentPath) with Path[FilmRecord] } /** @@ -56,20 +70,24 @@ object Film { */ class Film( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmRecord], + parentPath: InverseForeignKey[_ <: Record, FilmRecord], aliased: Table[FilmRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -95,7 +113,7 @@ extends TableImpl[FilmRecord]( /** * The column public.film.release_year. */ - val RELEASE_YEAR: TableField[FilmRecord, Integer] = createField(DSL.name("release_year"), org.jooq.demo.skala.db.Domains.YEAR.getDataType(), "") + val RELEASE_YEAR: TableField[FilmRecord, Integer] = createField(DSL.name("release_year"), Domains.YEAR.getDataType(), "") /** * The column public.film.language_id. @@ -130,7 +148,7 @@ extends TableImpl[FilmRecord]( /** * The column public.film.rating. */ - val RATING: TableField[FilmRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(classOf[org.jooq.demo.skala.db.enums.MpaaRating]), "") + val RATING: TableField[FilmRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(classOf[MpaaRating]), "") /** * The column public.film.last_update. @@ -150,9 +168,10 @@ extends TableImpl[FilmRecord]( * } in your code generator configuration. */ @Deprecated - val FULLTEXT: TableField[FilmRecord, Object] = createField(DSL.name("fulltext"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), "") + val FULLTEXT: TableField[FilmRecord, Object] = createField(DSL.name("fulltext"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), "") - private def this(alias: Name, aliased: Table[FilmRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film table reference @@ -169,9 +188,9 @@ extends TableImpl[FilmRecord]( */ def this() = this(DSL.name("film"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Film.FILM, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmRecord], parentPath: InverseForeignKey[_ <: Record, FilmRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Film.FILM, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.FILM_FULLTEXT_IDX, Indexes.IDX_FK_LANGUAGE_ID, Indexes.IDX_FK_ORIGINAL_LANGUAGE_ID, Indexes.IDX_TITLE) @@ -185,13 +204,13 @@ extends TableImpl[FilmRecord]( * Get the implicit join path to the public.language table, via * the film_language_id_fkey key. */ - lazy val filmLanguageIdFkey: Language = { new Language(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY) } + lazy val filmLanguageIdFkey: LanguagePath = { new LanguagePath(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY, null) } /** * Get the implicit join path to the public.language table, via * the film_original_language_id_fkey key. */ - lazy val filmOriginalLanguageIdFkey: Language = { new Language(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY) } + lazy val filmOriginalLanguageIdFkey: LanguagePath = { new LanguagePath(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null) } 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) @@ -211,19 +230,48 @@ extends TableImpl[FilmRecord]( */ override def rename(name: Table[_]): Film = new Film(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row14 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] = super.fieldsRow.asInstanceOf[ Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Film = new Film(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Film = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Film = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Film = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11(), r.value12(), r.value13(), r.value14())) + override def whereExists(select: Select[_]): Film = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11(), r.value12(), r.value13(), r.value14())) + override def whereNotExists(select: Select[_]): Film = where(DSL.notExists(select)) } 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 1eed571..c1bae94 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 @@ -4,22 +4,27 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -27,9 +32,10 @@ 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.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 @@ -49,20 +55,24 @@ object FilmActor { */ class FilmActor( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmActorRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmActorRecord], + parentPath: InverseForeignKey[_ <: Record, FilmActorRecord], aliased: Table[FilmActorRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmActorRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -85,7 +95,8 @@ extends TableImpl[FilmActorRecord]( */ val LAST_UPDATE: TableField[FilmActorRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[FilmActorRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmActorRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmActorRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_actor table reference @@ -102,9 +113,7 @@ extends TableImpl[FilmActorRecord]( */ def this() = this(DSL.name("film_actor"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmActorRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.FilmActor.FILM_ACTOR, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_FILM_ID) @@ -115,12 +124,12 @@ extends TableImpl[FilmActorRecord]( /** * Get the implicit join path to the public.actor table. */ - lazy val actor: Actor = { new Actor(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY) } + lazy val actor: ActorPath = { new ActorPath(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, null) } /** * Get the implicit join path to the public.film table. */ - lazy val film: Film = { new Film(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY) } + lazy val film: FilmPath = { new FilmPath(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY, null) } override def as(alias: String): FilmActor = new FilmActor(DSL.name(alias), this) override def as(alias: Name): FilmActor = new FilmActor(alias, this) override def as(alias: Table[_]): FilmActor = new FilmActor(alias.getQualifiedName(), this) @@ -140,19 +149,48 @@ extends TableImpl[FilmActorRecord]( */ override def rename(name: Table[_]): FilmActor = new FilmActor(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): FilmActor = new FilmActor(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): FilmActor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): FilmActor = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): FilmActor = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): FilmActor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): FilmActor = where(DSL.notExists(select)) } 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 f05bab3..a60488d 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 @@ -4,30 +4,36 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField 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.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 @@ -47,20 +53,24 @@ object FilmCategory { */ class FilmCategory( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmCategoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmCategoryRecord], + parentPath: InverseForeignKey[_ <: Record, FilmCategoryRecord], aliased: Table[FilmCategoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmCategoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -83,7 +93,8 @@ extends TableImpl[FilmCategoryRecord]( */ val LAST_UPDATE: TableField[FilmCategoryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[FilmCategoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmCategoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmCategoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_category table reference @@ -100,9 +111,7 @@ extends TableImpl[FilmCategoryRecord]( */ def this() = this(DSL.name("film_category"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmCategoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.FilmCategory.FILM_CATEGORY, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getPrimaryKey: UniqueKey[FilmCategoryRecord] = Keys.FILM_CATEGORY_PKEY @@ -111,12 +120,12 @@ extends TableImpl[FilmCategoryRecord]( /** * Get the implicit join path to the public.film table. */ - lazy val film: Film = { new Film(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY) } + lazy val film: FilmPath = { new FilmPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, null) } /** * Get the implicit join path to the public.category table. */ - lazy val category: Category = { new Category(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY) } + lazy val category: CategoryPath = { new CategoryPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY, null) } override def as(alias: String): FilmCategory = new FilmCategory(DSL.name(alias), this) override def as(alias: Name): FilmCategory = new FilmCategory(alias, this) override def as(alias: Table[_]): FilmCategory = new FilmCategory(alias.getQualifiedName(), this) @@ -136,19 +145,48 @@ extends TableImpl[FilmCategoryRecord]( */ override def rename(name: Table[_]): FilmCategory = new FilmCategory(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): FilmCategory = new FilmCategory(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): FilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): FilmCategory = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): FilmCategory = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): FilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): FilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala index 247a902..3b0d7e8 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala @@ -8,15 +8,14 @@ import java.lang.Class import java.lang.Integer import java.lang.Long import java.lang.String -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -42,20 +41,24 @@ object FilmInStock { */ class FilmInStock( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmInStockRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmInStockRecord], + parentPath: InverseForeignKey[_ <: Record, FilmInStockRecord], aliased: Table[FilmInStockRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmInStockRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function + TableOptions.function, + where ) { /** @@ -68,10 +71,10 @@ extends TableImpl[FilmInStockRecord]( */ val P_FILM_COUNT: TableField[FilmInStockRecord, Integer] = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[FilmInStockRecord]) = this(alias, null, null, aliased, Array( + private def this(alias: Name, aliased: Table[FilmInStockRecord]) = this(alias, null, null, null, aliased, Array( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) + ), null) /** * Create an aliased public.film_in_stock table reference @@ -88,30 +91,25 @@ extends TableImpl[FilmInStockRecord]( */ def this() = this(DSL.name("film_in_stock"), null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC - override def as(alias: String): FilmInStock = new FilmInStock(DSL.name(alias), null, null, this, parameters) - override def as(alias: Name): FilmInStock = new FilmInStock(alias, null, null, this, parameters) - override def as(alias: Table[_]): FilmInStock = new FilmInStock(alias.getQualifiedName(), null, null, this, parameters) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC + override def as(alias: String): FilmInStock = new FilmInStock(DSL.name(alias), null, null, null, this, parameters, null) + override def as(alias: Name): FilmInStock = new FilmInStock(alias, null, null, null, this, parameters, null) + override def as(alias: Table[_]): FilmInStock = new FilmInStock(alias.getQualifiedName(), null, null, null, this, parameters, null) /** * Rename this table */ - override def rename(name: String): FilmInStock = new FilmInStock(DSL.name(name), null, null, null, parameters) + override def rename(name: String): FilmInStock = new FilmInStock(DSL.name(name), null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Name): FilmInStock = new FilmInStock(name, null, null, null, parameters) + override def rename(name: Name): FilmInStock = new FilmInStock(name, null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Table[_]): FilmInStock = new FilmInStock(name.getQualifiedName(), null, null, null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] + override def rename(name: Table[_]): FilmInStock = new FilmInStock(name.getQualifiedName(), null, null, null, null, parameters, null) /** * Call this table-valued function @@ -119,10 +117,10 @@ extends TableImpl[FilmInStockRecord]( def call( pFilmId: Long , pStoreId: Long - ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, Array( + ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, null, Array( DSL.value(pFilmId, SQLDataType.BIGINT), DSL.value(pStoreId, SQLDataType.BIGINT) - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get /** * Call this table-valued function @@ -130,19 +128,8 @@ extends TableImpl[FilmInStockRecord]( def call( pFilmId: Field[Long] , pStoreId: Field[Long] - ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, Array( + ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, null, Array( pFilmId, pStoreId - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - def mapping[U](from: (Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1())) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - def mapping[U](toType: Class[U], from: (Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1())) + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala index 6f5b696..829efe0 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala @@ -4,20 +4,25 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.Short import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -25,7 +30,6 @@ import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.records.FilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -45,16 +49,19 @@ object FilmList { */ class FilmList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmListRecord], + parentPath: InverseForeignKey[_ <: Record, FilmListRecord], aliased: Table[FilmListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -73,7 +80,8 @@ extends TableImpl[FilmListRecord]( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where ) { /** @@ -114,14 +122,15 @@ extends TableImpl[FilmListRecord]( /** * The column public.film_list.rating. */ - val RATING: TableField[FilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[org.jooq.demo.skala.db.enums.MpaaRating]), "") + val RATING: TableField[FilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[MpaaRating]), "") /** * The column public.film_list.actors. */ val ACTORS: TableField[FilmListRecord, String] = createField(DSL.name("actors"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[FilmListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_list table reference @@ -138,9 +147,7 @@ extends TableImpl[FilmListRecord]( */ def this() = this(DSL.name("film_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.FilmList.FILM_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): FilmList = new FilmList(DSL.name(alias), this) override def as(alias: Name): FilmList = new FilmList(alias, this) override def as(alias: Table[_]): FilmList = new FilmList(alias.getQualifiedName(), this) @@ -160,19 +167,48 @@ extends TableImpl[FilmListRecord]( */ override def rename(name: Table[_]): FilmList = new FilmList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): FilmList = new FilmList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): FilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): FilmList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): FilmList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): FilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): FilmList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala index 08351a2..6f79c16 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala @@ -8,15 +8,14 @@ import java.lang.Class import java.lang.Integer import java.lang.Long import java.lang.String -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -42,20 +41,24 @@ object FilmNotInStock { */ class FilmNotInStock( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmNotInStockRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmNotInStockRecord], + parentPath: InverseForeignKey[_ <: Record, FilmNotInStockRecord], aliased: Table[FilmNotInStockRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmNotInStockRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function + TableOptions.function, + where ) { /** @@ -68,10 +71,10 @@ extends TableImpl[FilmNotInStockRecord]( */ val P_FILM_COUNT: TableField[FilmNotInStockRecord, Integer] = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[FilmNotInStockRecord]) = this(alias, null, null, aliased, Array( + private def this(alias: Name, aliased: Table[FilmNotInStockRecord]) = this(alias, null, null, null, aliased, Array( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) + ), null) /** * Create an aliased public.film_not_in_stock table reference @@ -88,30 +91,25 @@ extends TableImpl[FilmNotInStockRecord]( */ def this() = this(DSL.name("film_not_in_stock"), null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC - override def as(alias: String): FilmNotInStock = new FilmNotInStock(DSL.name(alias), null, null, this, parameters) - override def as(alias: Name): FilmNotInStock = new FilmNotInStock(alias, null, null, this, parameters) - override def as(alias: Table[_]): FilmNotInStock = new FilmNotInStock(alias.getQualifiedName(), null, null, this, parameters) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC + override def as(alias: String): FilmNotInStock = new FilmNotInStock(DSL.name(alias), null, null, null, this, parameters, null) + override def as(alias: Name): FilmNotInStock = new FilmNotInStock(alias, null, null, null, this, parameters, null) + override def as(alias: Table[_]): FilmNotInStock = new FilmNotInStock(alias.getQualifiedName(), null, null, null, this, parameters, null) /** * Rename this table */ - override def rename(name: String): FilmNotInStock = new FilmNotInStock(DSL.name(name), null, null, null, parameters) + override def rename(name: String): FilmNotInStock = new FilmNotInStock(DSL.name(name), null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Name): FilmNotInStock = new FilmNotInStock(name, null, null, null, parameters) + override def rename(name: Name): FilmNotInStock = new FilmNotInStock(name, null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Table[_]): FilmNotInStock = new FilmNotInStock(name.getQualifiedName(), null, null, null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] + override def rename(name: Table[_]): FilmNotInStock = new FilmNotInStock(name.getQualifiedName(), null, null, null, null, parameters, null) /** * Call this table-valued function @@ -119,10 +117,10 @@ extends TableImpl[FilmNotInStockRecord]( def call( pFilmId: Long , pStoreId: Long - ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, Array( + ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, null, Array( DSL.value(pFilmId, SQLDataType.BIGINT), DSL.value(pStoreId, SQLDataType.BIGINT) - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get /** * Call this table-valued function @@ -130,19 +128,8 @@ extends TableImpl[FilmNotInStockRecord]( def call( pFilmId: Field[Long] , pStoreId: Field[Long] - ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, Array( + ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, null, Array( pFilmId, pStoreId - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - def mapping[U](from: (Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1())) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - def mapping[U](toType: Class[U], from: (Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1())) + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get } 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 3149a47..e0b9206 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.Store.StorePath import org.jooq.demo.skala.db.tables.records.InventoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +51,11 @@ object Inventory { * The reference instance of public.inventory */ val INVENTORY = new Inventory + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class InventoryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, InventoryRecord], parentPath: InverseForeignKey[_ <: Record, InventoryRecord]) extends Inventory(path, childPath, parentPath) with Path[InventoryRecord] } /** @@ -50,20 +63,24 @@ object Inventory { */ class Inventory( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, InventoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, InventoryRecord], + parentPath: InverseForeignKey[_ <: Record, InventoryRecord], aliased: Table[InventoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[InventoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +108,8 @@ extends TableImpl[InventoryRecord]( */ val LAST_UPDATE: TableField[InventoryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[InventoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[InventoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[InventoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.inventory table reference @@ -108,9 +126,9 @@ extends TableImpl[InventoryRecord]( */ def this() = this(DSL.name("inventory"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, InventoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Inventory.INVENTORY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, InventoryRecord], parentPath: InverseForeignKey[_ <: Record, InventoryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Inventory.INVENTORY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_STORE_ID_FILM_ID) @@ -123,12 +141,12 @@ extends TableImpl[InventoryRecord]( /** * Get the implicit join path to the public.film table. */ - lazy val film: Film = { new Film(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY) } + lazy val film: FilmPath = { new FilmPath(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY, null) } /** * Get the implicit join path to the public.store table. */ - lazy val store: Store = { new Store(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY) } + lazy val store: StorePath = { new StorePath(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY, null) } 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) @@ -148,19 +166,48 @@ extends TableImpl[InventoryRecord]( */ override def rename(name: Table[_]): Inventory = new Inventory(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Inventory = new Inventory(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Inventory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Inventory = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Inventory = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): Inventory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): Inventory = where(DSL.notExists(select)) } 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 0739874..2846cbb 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 @@ -4,20 +4,26 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -39,6 +45,11 @@ object Language { * The reference instance of public.language */ val LANGUAGE = new Language + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class LanguagePath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, LanguageRecord], parentPath: InverseForeignKey[_ <: Record, LanguageRecord]) extends Language(path, childPath, parentPath) with Path[LanguageRecord] } /** @@ -46,20 +57,24 @@ object Language { */ class Language( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, LanguageRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, LanguageRecord], + parentPath: InverseForeignKey[_ <: Record, LanguageRecord], aliased: Table[LanguageRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[LanguageRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -82,7 +97,8 @@ extends TableImpl[LanguageRecord]( */ val LAST_UPDATE: TableField[LanguageRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[LanguageRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[LanguageRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[LanguageRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.language table reference @@ -99,9 +115,9 @@ extends TableImpl[LanguageRecord]( */ def this() = this(DSL.name("language"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, LanguageRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Language.LANGUAGE, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, LanguageRecord], parentPath: InverseForeignKey[_ <: Record, LanguageRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Language.LANGUAGE, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[LanguageRecord, Long] = super.getIdentity.asInstanceOf[ Identity[LanguageRecord, Long] ] @@ -125,19 +141,48 @@ extends TableImpl[LanguageRecord]( */ override def rename(name: Table[_]): Language = new Language(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Language = new Language(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Language = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Language = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Language = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): Language = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): Language = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala index 50c5929..aac13ce 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala @@ -4,20 +4,25 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.Short import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -25,7 +30,6 @@ import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.records.NicerButSlowerFilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -45,16 +49,19 @@ object NicerButSlowerFilmList { */ class NicerButSlowerFilmList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, NicerButSlowerFilmListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, NicerButSlowerFilmListRecord], + parentPath: InverseForeignKey[_ <: Record, NicerButSlowerFilmListRecord], aliased: Table[NicerButSlowerFilmListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[NicerButSlowerFilmListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -73,7 +80,8 @@ extends TableImpl[NicerButSlowerFilmListRecord]( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where ) { /** @@ -114,14 +122,15 @@ extends TableImpl[NicerButSlowerFilmListRecord]( /** * The column public.nicer_but_slower_film_list.rating. */ - val RATING: TableField[NicerButSlowerFilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[org.jooq.demo.skala.db.enums.MpaaRating]), "") + val RATING: TableField[NicerButSlowerFilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[MpaaRating]), "") /** * The column public.nicer_but_slower_film_list.actors. */ val ACTORS: TableField[NicerButSlowerFilmListRecord, String] = createField(DSL.name("actors"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[NicerButSlowerFilmListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[NicerButSlowerFilmListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[NicerButSlowerFilmListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.nicer_but_slower_film_list table @@ -140,9 +149,7 @@ extends TableImpl[NicerButSlowerFilmListRecord]( */ def this() = this(DSL.name("nicer_but_slower_film_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, NicerButSlowerFilmListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): NicerButSlowerFilmList = new NicerButSlowerFilmList(DSL.name(alias), this) override def as(alias: Name): NicerButSlowerFilmList = new NicerButSlowerFilmList(alias, this) override def as(alias: Table[_]): NicerButSlowerFilmList = new NicerButSlowerFilmList(alias.getQualifiedName(), this) @@ -162,19 +169,48 @@ extends TableImpl[NicerButSlowerFilmListRecord]( */ override def rename(name: Table[_]): NicerButSlowerFilmList = new NicerButSlowerFilmList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): NicerButSlowerFilmList = new NicerButSlowerFilmList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): NicerButSlowerFilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): NicerButSlowerFilmList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): NicerButSlowerFilmList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): NicerButSlowerFilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): NicerButSlowerFilmList = where(DSL.notExists(select)) } 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 9eecff7..1db126e 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 @@ -4,24 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -29,9 +34,11 @@ 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.Customer.CustomerPath +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,20 +58,24 @@ object Payment { */ class Payment( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentRecord], + parentPath: InverseForeignKey[_ <: Record, PaymentRecord], aliased: Table[PaymentRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +113,8 @@ extends TableImpl[PaymentRecord]( */ val PAYMENT_DATE: TableField[PaymentRecord, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment table reference @@ -119,9 +131,7 @@ extends TableImpl[PaymentRecord]( */ def this() = this(DSL.name("payment"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Payment.PAYMENT, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -134,17 +144,17 @@ extends TableImpl[PaymentRecord]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY, null) } override def as(alias: String): Payment = new Payment(DSL.name(alias), this) override def as(alias: Name): Payment = new Payment(alias, this) override def as(alias: Table[_]): Payment = new Payment(alias.getQualifiedName(), this) @@ -164,19 +174,48 @@ extends TableImpl[PaymentRecord]( */ override def rename(name: Table[_]): Payment = new Payment(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Payment = new Payment(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Payment = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Payment = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Payment = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): Payment = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): Payment = where(DSL.notExists(select)) } 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 e8d3d33..9cd61a3 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_01Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_01 { */ class PaymentP2007_01( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_01Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_01Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_01Record], aliased: Table[PaymentP2007_01Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_01Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_01Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_01Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_01Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_01Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_01Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_01 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_01Record]( */ def this() = this(DSL.name("payment_p2007_01"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_01Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_01.PAYMENT_P2007_01, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_01Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_01Record] ] = Arrays.asList[ Check[PaymentP2007_01Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_01_payment_date_check"), "(((payment_date >= '2007-01-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-02-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_01Record]( */ override def rename(name: Table[_]): PaymentP2007_01 = new PaymentP2007_01(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_01 = new PaymentP2007_01(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_01 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_01 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_01 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_01 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_01 = where(DSL.notExists(select)) } 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 9ef4746..0065717 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_02Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_02 { */ class PaymentP2007_02( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_02Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_02Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_02Record], aliased: Table[PaymentP2007_02Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_02Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_02Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_02Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_02Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_02Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_02Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_02 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_02Record]( */ def this() = this(DSL.name("payment_p2007_02"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_02Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_02.PAYMENT_P2007_02, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_02Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_02Record] ] = Arrays.asList[ Check[PaymentP2007_02Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_02_payment_date_check"), "(((payment_date >= '2007-02-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-03-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_02Record]( */ override def rename(name: Table[_]): PaymentP2007_02 = new PaymentP2007_02(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_02 = new PaymentP2007_02(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_02 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_02 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_02 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_02 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_02 = where(DSL.notExists(select)) } 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 9891515..7baecf3 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_03Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_03 { */ class PaymentP2007_03( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_03Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_03Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_03Record], aliased: Table[PaymentP2007_03Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_03Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_03Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_03Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_03Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_03Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_03Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_03 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_03Record]( */ def this() = this(DSL.name("payment_p2007_03"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_03Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_03.PAYMENT_P2007_03, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_03Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_03Record] ] = Arrays.asList[ Check[PaymentP2007_03Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_03_payment_date_check"), "(((payment_date >= '2007-03-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-04-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_03Record]( */ override def rename(name: Table[_]): PaymentP2007_03 = new PaymentP2007_03(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_03 = new PaymentP2007_03(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_03 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_03 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_03 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_03 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_03 = where(DSL.notExists(select)) } 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 9582956..a55709b 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_04Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_04 { */ class PaymentP2007_04( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_04Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_04Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_04Record], aliased: Table[PaymentP2007_04Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_04Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_04Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_04Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_04Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_04Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_04Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_04 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_04Record]( */ def this() = this(DSL.name("payment_p2007_04"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_04Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_04.PAYMENT_P2007_04, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_04Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_04Record] ] = Arrays.asList[ Check[PaymentP2007_04Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_04_payment_date_check"), "(((payment_date >= '2007-04-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-05-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_04Record]( */ override def rename(name: Table[_]): PaymentP2007_04 = new PaymentP2007_04(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_04 = new PaymentP2007_04(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_04 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_04 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_04 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_04 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_04 = where(DSL.notExists(select)) } 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 65d2b2c..73a15c7 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_05Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_05 { */ class PaymentP2007_05( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_05Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_05Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_05Record], aliased: Table[PaymentP2007_05Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_05Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_05Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_05Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_05Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_05Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_05Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_05 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_05Record]( */ def this() = this(DSL.name("payment_p2007_05"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_05Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_05.PAYMENT_P2007_05, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_05Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_05Record] ] = Arrays.asList[ Check[PaymentP2007_05Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_05_payment_date_check"), "(((payment_date >= '2007-05-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-06-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_05Record]( */ override def rename(name: Table[_]): PaymentP2007_05 = new PaymentP2007_05(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_05 = new PaymentP2007_05(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_05 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_05 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_05 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_05 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_05 = where(DSL.notExists(select)) } 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 7d6f1c4..8d44fa3 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_06Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_06 { */ class PaymentP2007_06( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_06Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_06Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_06Record], aliased: Table[PaymentP2007_06Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_06Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_06Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_06Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_06Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_06Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_06Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_06 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_06Record]( */ def this() = this(DSL.name("payment_p2007_06"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_06Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_06.PAYMENT_P2007_06, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_06Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_06Record] ] = Arrays.asList[ Check[PaymentP2007_06Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_06_payment_date_check"), "(((payment_date >= '2007-06-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-07-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_06Record]( */ override def rename(name: Table[_]): PaymentP2007_06 = new PaymentP2007_06(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_06 = new PaymentP2007_06(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_06 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_06 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_06 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_06 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_06 = where(DSL.notExists(select)) } 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 c730ee7..63275ef 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row7 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,6 +34,9 @@ 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.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.RentalRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +52,11 @@ object Rental { * The reference instance of public.rental */ val RENTAL = new Rental + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class RentalPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, RentalRecord], parentPath: InverseForeignKey[_ <: Record, RentalRecord]) extends Rental(path, childPath, parentPath) with Path[RentalRecord] } /** @@ -50,20 +64,24 @@ object Rental { */ class Rental( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, RentalRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, RentalRecord], + parentPath: InverseForeignKey[_ <: Record, RentalRecord], aliased: Table[RentalRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[RentalRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -106,7 +124,8 @@ extends TableImpl[RentalRecord]( */ val LAST_UPDATE: TableField[RentalRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[RentalRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[RentalRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[RentalRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.rental table reference @@ -123,9 +142,9 @@ extends TableImpl[RentalRecord]( */ def this() = this(DSL.name("rental"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, RentalRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Rental.RENTAL, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, RentalRecord], parentPath: InverseForeignKey[_ <: Record, RentalRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Rental.RENTAL, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_INVENTORY_ID, Indexes.IDX_UNQ_RENTAL_RENTAL_DATE_INVENTORY_ID_CUSTOMER_ID) @@ -138,17 +157,17 @@ extends TableImpl[RentalRecord]( /** * Get the implicit join path to the public.inventory table. */ - lazy val inventory: Inventory = { new Inventory(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY) } + lazy val inventory: InventoryPath = { new InventoryPath(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY, null) } /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY, null) } 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) @@ -168,19 +187,48 @@ extends TableImpl[RentalRecord]( */ override def rename(name: Table[_]): Rental = new Rental(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Rental = new Rental(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Rental = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Rental = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Rental = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7())) + override def whereExists(select: Select[_]): Rental = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7())) + override def whereNotExists(select: Select[_]): Rental = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala index 6e7e9c9..5bccead 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala @@ -12,16 +12,15 @@ import java.lang.String import java.math.BigDecimal import java.time.LocalDate import java.time.LocalDateTime -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Row10 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -47,20 +46,24 @@ object RewardsReport { */ class RewardsReport( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CustomerRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CustomerRecord], + parentPath: InverseForeignKey[_ <: Record, CustomerRecord], aliased: Table[CustomerRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CustomerRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function + TableOptions.function, + where ) { /** @@ -118,10 +121,10 @@ extends TableImpl[CustomerRecord]( */ val ACTIVE: TableField[CustomerRecord, Integer] = createField(DSL.name("active"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, aliased, Array( + private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, null, aliased, Array( DSL.value(null, SQLDataType.INTEGER), DSL.value(null, SQLDataType.NUMERIC) - )) + ), null) /** * Create an aliased public.rewards_report table reference @@ -138,32 +141,27 @@ extends TableImpl[CustomerRecord]( */ def this() = this(DSL.name("rewards_report"), null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[CustomerRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CustomerRecord, Long] ] - override def as(alias: String): RewardsReport = new RewardsReport(DSL.name(alias), null, null, this, parameters) - override def as(alias: Name): RewardsReport = new RewardsReport(alias, null, null, this, parameters) - override def as(alias: Table[_]): RewardsReport = new RewardsReport(alias.getQualifiedName(), null, null, this, parameters) + override def as(alias: String): RewardsReport = new RewardsReport(DSL.name(alias), null, null, null, this, parameters, null) + override def as(alias: Name): RewardsReport = new RewardsReport(alias, null, null, null, this, parameters, null) + override def as(alias: Table[_]): RewardsReport = new RewardsReport(alias.getQualifiedName(), null, null, null, this, parameters, null) /** * Rename this table */ - override def rename(name: String): RewardsReport = new RewardsReport(DSL.name(name), null, null, null, parameters) + override def rename(name: String): RewardsReport = new RewardsReport(DSL.name(name), null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Name): RewardsReport = new RewardsReport(name, null, null, null, parameters) + override def rename(name: Name): RewardsReport = new RewardsReport(name, null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Table[_]): RewardsReport = new RewardsReport(name.getQualifiedName(), null, null, null, parameters) - - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.fieldsRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] + override def rename(name: Table[_]): RewardsReport = new RewardsReport(name.getQualifiedName(), null, null, null, null, parameters, null) /** * Call this table-valued function @@ -171,10 +169,10 @@ extends TableImpl[CustomerRecord]( def call( minMonthlyPurchases: Integer , minDollarAmountPurchased: BigDecimal - ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, Array( + ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, null, Array( DSL.value(minMonthlyPurchases, SQLDataType.INTEGER), DSL.value(minDollarAmountPurchased, SQLDataType.NUMERIC) - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get /** * Call this table-valued function @@ -182,19 +180,8 @@ extends TableImpl[CustomerRecord]( def call( minMonthlyPurchases: Field[Integer] , minDollarAmountPurchased: Field[BigDecimal] - ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, Array( + ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, null, Array( minMonthlyPurchases, minDollarAmountPurchased - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - def mapping[U](from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - def mapping[U](toType: Class[U], from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala index 9f1f7d4..dca0472 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row2 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.SalesByFilmCategoryRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object SalesByFilmCategory { */ class SalesByFilmCategory( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, SalesByFilmCategoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, SalesByFilmCategoryRecord], + parentPath: InverseForeignKey[_ <: Record, SalesByFilmCategoryRecord], aliased: Table[SalesByFilmCategoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[SalesByFilmCategoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -66,7 +73,8 @@ extends TableImpl[SalesByFilmCategoryRecord]( JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY (sum(p.amount)) DESC; - """) + """), + where ) { /** @@ -84,7 +92,8 @@ extends TableImpl[SalesByFilmCategoryRecord]( */ val TOTAL_SALES: TableField[SalesByFilmCategoryRecord, BigDecimal] = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, "") - private def this(alias: Name, aliased: Table[SalesByFilmCategoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[SalesByFilmCategoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[SalesByFilmCategoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.sales_by_film_category table @@ -103,9 +112,7 @@ extends TableImpl[SalesByFilmCategoryRecord]( */ def this() = this(DSL.name("sales_by_film_category"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, SalesByFilmCategoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.SalesByFilmCategory.SALES_BY_FILM_CATEGORY, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): SalesByFilmCategory = new SalesByFilmCategory(DSL.name(alias), this) override def as(alias: Name): SalesByFilmCategory = new SalesByFilmCategory(alias, this) override def as(alias: Table[_]): SalesByFilmCategory = new SalesByFilmCategory(alias.getQualifiedName(), this) @@ -125,19 +132,48 @@ extends TableImpl[SalesByFilmCategoryRecord]( */ override def rename(name: Table[_]): SalesByFilmCategory = new SalesByFilmCategory(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row2[String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row2[String, BigDecimal] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): SalesByFilmCategory = new SalesByFilmCategory(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): SalesByFilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): SalesByFilmCategory = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): SalesByFilmCategory = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (String, BigDecimal) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2())) + override def whereExists(select: Select[_]): SalesByFilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (String, BigDecimal) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2())) + override def whereNotExists(select: Select[_]): SalesByFilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala index b88f340..c24750c 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.SalesByStoreRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object SalesByStore { */ class SalesByStore( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, SalesByStoreRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, SalesByStoreRecord], + parentPath: InverseForeignKey[_ <: Record, SalesByStoreRecord], aliased: Table[SalesByStoreRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[SalesByStoreRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -69,7 +76,8 @@ extends TableImpl[SalesByStoreRecord]( JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city; - """) + """), + where ) { /** @@ -92,7 +100,8 @@ extends TableImpl[SalesByStoreRecord]( */ val TOTAL_SALES: TableField[SalesByStoreRecord, BigDecimal] = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, "") - private def this(alias: Name, aliased: Table[SalesByStoreRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[SalesByStoreRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[SalesByStoreRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.sales_by_store table reference @@ -109,9 +118,7 @@ extends TableImpl[SalesByStoreRecord]( */ def this() = this(DSL.name("sales_by_store"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, SalesByStoreRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.SalesByStore.SALES_BY_STORE, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): SalesByStore = new SalesByStore(DSL.name(alias), this) override def as(alias: Name): SalesByStore = new SalesByStore(alias, this) override def as(alias: Table[_]): SalesByStore = new SalesByStore(alias.getQualifiedName(), this) @@ -131,19 +138,48 @@ extends TableImpl[SalesByStoreRecord]( */ override def rename(name: Table[_]): SalesByStore = new SalesByStore(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[String, String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row3[String, String, BigDecimal] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): SalesByStore = new SalesByStore(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): SalesByStore = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): SalesByStore = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): SalesByStore = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (String, String, BigDecimal) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): SalesByStore = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (String, String, BigDecimal) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): SalesByStore = where(DSL.notExists(select)) } 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 c1f0123..d0a9eb1 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 @@ -10,23 +10,30 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row11 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField 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.Address.AddressPath +import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.StaffRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +50,11 @@ object Staff { * The reference instance of public.staff */ val STAFF = new Staff + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class StaffPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StaffRecord], parentPath: InverseForeignKey[_ <: Record, StaffRecord]) extends Staff(path, childPath, parentPath) with Path[StaffRecord] } /** @@ -50,20 +62,24 @@ object Staff { */ class Staff( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, StaffRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, StaffRecord], + parentPath: InverseForeignKey[_ <: Record, StaffRecord], aliased: Table[StaffRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[StaffRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -126,7 +142,8 @@ extends TableImpl[StaffRecord]( */ val PICTURE: TableField[StaffRecord, Array[Byte]] = createField(DSL.name("picture"), SQLDataType.BLOB, "") - private def this(alias: Name, aliased: Table[StaffRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[StaffRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[StaffRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.staff table reference @@ -143,9 +160,9 @@ extends TableImpl[StaffRecord]( */ def this() = this(DSL.name("staff"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, StaffRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Staff.STAFF, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StaffRecord], parentPath: InverseForeignKey[_ <: Record, StaffRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Staff.STAFF, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[StaffRecord, Long] = super.getIdentity.asInstanceOf[ Identity[StaffRecord, Long] ] @@ -156,12 +173,12 @@ extends TableImpl[StaffRecord]( /** * Get the implicit join path to the public.address table. */ - lazy val address: Address = { new Address(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY) } + lazy val address: AddressPath = { new AddressPath(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY, null) } /** * Get the implicit join path to the public.store table. */ - lazy val store: Store = { new Store(this, Keys.STAFF__STAFF_STORE_ID_FKEY) } + lazy val store: StorePath = { new StorePath(this, Keys.STAFF__STAFF_STORE_ID_FKEY, null) } 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) @@ -181,19 +198,48 @@ extends TableImpl[StaffRecord]( */ override def rename(name: Table[_]): Staff = new Staff(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row11 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] = super.fieldsRow.asInstanceOf[ Row11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Staff = new Staff(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Staff = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Staff = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Staff = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11())) + override def whereExists(select: Select[_]): Staff = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11())) + override def whereNotExists(select: Select[_]): Staff = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala index 6dba585..70af991 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.StaffListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object StaffList { */ class StaffList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, StaffListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, StaffListRecord], + parentPath: InverseForeignKey[_ <: Record, StaffListRecord], aliased: Table[StaffListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[StaffListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -68,7 +75,8 @@ extends TableImpl[StaffListRecord]( JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where ) { /** @@ -116,7 +124,8 @@ extends TableImpl[StaffListRecord]( */ val SID: TableField[StaffListRecord, Long] = createField(DSL.name("sid"), SQLDataType.BIGINT, "") - private def this(alias: Name, aliased: Table[StaffListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[StaffListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[StaffListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.staff_list table reference @@ -133,9 +142,7 @@ extends TableImpl[StaffListRecord]( */ def this() = this(DSL.name("staff_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, StaffListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.StaffList.STAFF_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): StaffList = new StaffList(DSL.name(alias), this) override def as(alias: Name): StaffList = new StaffList(alias, this) override def as(alias: Table[_]): StaffList = new StaffList(alias.getQualifiedName(), this) @@ -155,19 +162,48 @@ extends TableImpl[StaffListRecord]( */ override def rename(name: Table[_]): StaffList = new StaffList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, String, String, String, Long] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): StaffList = new StaffList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): StaffList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): StaffList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): StaffList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): StaffList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): StaffList = where(DSL.notExists(select)) } 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 d7fcf92..55fa896 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.Address.AddressPath +import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.StoreRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +51,11 @@ object Store { * The reference instance of public.store */ val STORE = new Store + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class StorePath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StoreRecord], parentPath: InverseForeignKey[_ <: Record, StoreRecord]) extends Store(path, childPath, parentPath) with Path[StoreRecord] } /** @@ -50,20 +63,24 @@ object Store { */ class Store( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, StoreRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, StoreRecord], + parentPath: InverseForeignKey[_ <: Record, StoreRecord], aliased: Table[StoreRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[StoreRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +108,8 @@ extends TableImpl[StoreRecord]( */ val LAST_UPDATE: TableField[StoreRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[StoreRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[StoreRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[StoreRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.store table reference @@ -108,9 +126,9 @@ extends TableImpl[StoreRecord]( */ def this() = this(DSL.name("store"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, StoreRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Store.STORE, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StoreRecord], parentPath: InverseForeignKey[_ <: Record, StoreRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Store.STORE, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_UNQ_MANAGER_STAFF_ID) @@ -123,12 +141,12 @@ extends TableImpl[StoreRecord]( /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.address table. */ - lazy val address: Address = { new Address(this, Keys.STORE__STORE_ADDRESS_ID_FKEY) } + lazy val address: AddressPath = { new AddressPath(this, Keys.STORE__STORE_ADDRESS_ID_FKEY, null) } 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) @@ -148,19 +166,48 @@ extends TableImpl[StoreRecord]( */ override def rename(name: Table[_]): Store = new Store(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Store = new Store(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Store = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Store = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Store = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): Store = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): Store = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala index 8eb5c21..85535cd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.lang.String -import org.jooq.Field -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.ActorInfo import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class ActorInfoRecord extends TableRecordImpl[ActorInfoRecord](ActorInfo.ACTOR_INFO) with Record4[Long, String, String, String] { +class ActorInfoRecord extends TableRecordImpl[ActorInfoRecord](ActorInfo.ACTOR_INFO) { /** * Setter for public.actor_info.actor_id. @@ -67,54 +64,6 @@ class ActorInfoRecord extends TableRecordImpl[ActorInfoRecord](ActorInfo.ACTOR_I */ def getFilmInfo: String = get(3).asInstanceOf[String] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, String, String, String] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, String] ] - - override def valuesRow: Row4[Long, String, String, String] = super.valuesRow.asInstanceOf[ Row4[Long, String, String, String] ] - override def field1: Field[Long] = ActorInfo.ACTOR_INFO.ACTOR_ID - override def field2: Field[String] = ActorInfo.ACTOR_INFO.FIRST_NAME - override def field3: Field[String] = ActorInfo.ACTOR_INFO.LAST_NAME - override def field4: Field[String] = ActorInfo.ACTOR_INFO.FILM_INFO - override def component1: Long = getActorId - override def component2: String = getFirstName - override def component3: String = getLastName - override def component4: String = getFilmInfo - override def value1: Long = getActorId - override def value2: String = getFirstName - override def value3: String = getLastName - override def value4: String = getFilmInfo - - override def value1(value: Long): ActorInfoRecord = { - setActorId(value) - this - } - - override def value2(value: String): ActorInfoRecord = { - setFirstName(value) - this - } - - override def value3(value: String): ActorInfoRecord = { - setLastName(value) - this - } - - override def value4(value: String): ActorInfoRecord = { - setFilmInfo(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String): ActorInfoRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised ActorInfoRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala index 0e0c0de..7cece69 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.Actor import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class ActorRecord extends UpdatableRecordImpl[ActorRecord](Actor.ACTOR) with Record4[Long, String, String, LocalDateTime] { +class ActorRecord extends UpdatableRecordImpl[ActorRecord](Actor.ACTOR) { /** * Setter for public.actor.actor_id. @@ -75,54 +72,6 @@ class ActorRecord extends UpdatableRecordImpl[ActorRecord](Actor.ACTOR) with Rec override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, LocalDateTime] ] - - override def valuesRow: Row4[Long, String, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, String, String, LocalDateTime] ] - override def field1: Field[Long] = Actor.ACTOR.ACTOR_ID - override def field2: Field[String] = Actor.ACTOR.FIRST_NAME - override def field3: Field[String] = Actor.ACTOR.LAST_NAME - override def field4: Field[LocalDateTime] = Actor.ACTOR.LAST_UPDATE - override def component1: Long = getActorId - override def component2: String = getFirstName - override def component3: String = getLastName - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getActorId - override def value2: String = getFirstName - override def value3: String = getLastName - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): ActorRecord = { - setActorId(value) - this - } - - override def value2(value: String): ActorRecord = { - setFirstName(value) - this - } - - override def value3(value: String): ActorRecord = { - setLastName(value) - this - } - - override def value4(value: LocalDateTime): ActorRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : LocalDateTime): ActorRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised ActorRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala index e80db0b..22f2a77 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.tables.Address import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class AddressRecord extends UpdatableRecordImpl[AddressRecord](Address.ADDRESS) with Record8[Long, String, String, String, Long, String, String, LocalDateTime] { +class AddressRecord extends UpdatableRecordImpl[AddressRecord](Address.ADDRESS) { /** * Setter for public.address.address_id. @@ -123,90 +120,6 @@ class AddressRecord extends UpdatableRecordImpl[AddressRecord](Address.ADDRESS) override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, Long, String, String, LocalDateTime] ] - - override def valuesRow: Row8[Long, String, String, String, Long, String, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, Long, String, String, LocalDateTime] ] - override def field1: Field[Long] = Address.ADDRESS.ADDRESS_ID - override def field2: Field[String] = Address.ADDRESS.ADDRESS_ - override def field3: Field[String] = Address.ADDRESS.ADDRESS2 - override def field4: Field[String] = Address.ADDRESS.DISTRICT - override def field5: Field[Long] = Address.ADDRESS.CITY_ID - override def field6: Field[String] = Address.ADDRESS.POSTAL_CODE - override def field7: Field[String] = Address.ADDRESS.PHONE - override def field8: Field[LocalDateTime] = Address.ADDRESS.LAST_UPDATE - override def component1: Long = getAddressId - override def component2: String = getAddress - override def component3: String = getAddress2 - override def component4: String = getDistrict - override def component5: Long = getCityId - override def component6: String = getPostalCode - override def component7: String = getPhone - override def component8: LocalDateTime = getLastUpdate - override def value1: Long = getAddressId - override def value2: String = getAddress - override def value3: String = getAddress2 - override def value4: String = getDistrict - override def value5: Long = getCityId - override def value6: String = getPostalCode - override def value7: String = getPhone - override def value8: LocalDateTime = getLastUpdate - - override def value1(value: Long): AddressRecord = { - setAddressId(value) - this - } - - override def value2(value: String): AddressRecord = { - setAddress(value) - this - } - - override def value3(value: String): AddressRecord = { - setAddress2(value) - this - } - - override def value4(value: String): AddressRecord = { - setDistrict(value) - this - } - - override def value5(value: Long): AddressRecord = { - setCityId(value) - this - } - - override def value6(value: String): AddressRecord = { - setPostalCode(value) - this - } - - override def value7(value: String): AddressRecord = { - setPhone(value) - this - } - - override def value8(value: LocalDateTime): AddressRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : Long, value6 : String, value7 : String, value8 : LocalDateTime): AddressRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised AddressRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala index 06e3959..0709ac4 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.Category import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CategoryRecord extends UpdatableRecordImpl[CategoryRecord](Category.CATEGORY) with Record3[Long, String, LocalDateTime] { +class CategoryRecord extends UpdatableRecordImpl[CategoryRecord](Category.CATEGORY) { /** * Setter for public.category.category_id. @@ -63,45 +60,6 @@ class CategoryRecord extends UpdatableRecordImpl[CategoryRecord](Category.CATEGO override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - - override def valuesRow: Row3[Long, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - override def field1: Field[Long] = Category.CATEGORY.CATEGORY_ID - override def field2: Field[String] = Category.CATEGORY.NAME - override def field3: Field[LocalDateTime] = Category.CATEGORY.LAST_UPDATE - override def component1: Long = getCategoryId - override def component2: String = getName - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getCategoryId - override def value2: String = getName - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): CategoryRecord = { - setCategoryId(value) - this - } - - override def value2(value: String): CategoryRecord = { - setName(value) - this - } - - override def value3(value: LocalDateTime): CategoryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : LocalDateTime): CategoryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised CategoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala index e8dd211..699ea4d 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.City import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CityRecord extends UpdatableRecordImpl[CityRecord](City.CITY) with Record4[Long, String, Long, LocalDateTime] { +class CityRecord extends UpdatableRecordImpl[CityRecord](City.CITY) { /** * Setter for public.city.city_id. @@ -75,54 +72,6 @@ class CityRecord extends UpdatableRecordImpl[CityRecord](City.CITY) with Record4 override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, String, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, Long, LocalDateTime] ] - - override def valuesRow: Row4[Long, String, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, String, Long, LocalDateTime] ] - override def field1: Field[Long] = City.CITY.CITY_ID - override def field2: Field[String] = City.CITY.CITY_ - override def field3: Field[Long] = City.CITY.COUNTRY_ID - override def field4: Field[LocalDateTime] = City.CITY.LAST_UPDATE - override def component1: Long = getCityId - override def component2: String = getCity - override def component3: Long = getCountryId - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getCityId - override def value2: String = getCity - override def value3: Long = getCountryId - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): CityRecord = { - setCityId(value) - this - } - - override def value2(value: String): CityRecord = { - setCity(value) - this - } - - override def value3(value: Long): CityRecord = { - setCountryId(value) - this - } - - override def value4(value: LocalDateTime): CityRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : Long, value4 : LocalDateTime): CityRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised CityRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala index 22fc6aa..e90a233 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.Country import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CountryRecord extends UpdatableRecordImpl[CountryRecord](Country.COUNTRY) with Record3[Long, String, LocalDateTime] { +class CountryRecord extends UpdatableRecordImpl[CountryRecord](Country.COUNTRY) { /** * Setter for public.country.country_id. @@ -63,45 +60,6 @@ class CountryRecord extends UpdatableRecordImpl[CountryRecord](Country.COUNTRY) override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - - override def valuesRow: Row3[Long, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - override def field1: Field[Long] = Country.COUNTRY.COUNTRY_ID - override def field2: Field[String] = Country.COUNTRY.COUNTRY_ - override def field3: Field[LocalDateTime] = Country.COUNTRY.LAST_UPDATE - override def component1: Long = getCountryId - override def component2: String = getCountry - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getCountryId - override def value2: String = getCountry - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): CountryRecord = { - setCountryId(value) - this - } - - override def value2(value: String): CountryRecord = { - setCountry(value) - this - } - - override def value3(value: LocalDateTime): CountryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : LocalDateTime): CountryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised CountryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala index 2ffd3a6..4fe8d8b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.lang.String -import org.jooq.Field -import org.jooq.Record9 -import org.jooq.Row9 import org.jooq.demo.skala.db.tables.CustomerList import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class CustomerListRecord extends TableRecordImpl[CustomerListRecord](CustomerList.CUSTOMER_LIST) with Record9[Long, String, String, String, String, String, String, String, Long] { +class CustomerListRecord extends TableRecordImpl[CustomerListRecord](CustomerList.CUSTOMER_LIST) { /** * Setter for public.customer_list.id. @@ -127,99 +124,6 @@ class CustomerListRecord extends TableRecordImpl[CustomerListRecord](CustomerLis */ def getSid: Long = get(8).asInstanceOf[Long] - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row9[Long, String, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row9[Long, String, String, String, String, String, String, String, Long] ] - - override def valuesRow: Row9[Long, String, String, String, String, String, String, String, Long] = super.valuesRow.asInstanceOf[ Row9[Long, String, String, String, String, String, String, String, Long] ] - override def field1: Field[Long] = CustomerList.CUSTOMER_LIST.ID - override def field2: Field[String] = CustomerList.CUSTOMER_LIST.NAME - override def field3: Field[String] = CustomerList.CUSTOMER_LIST.ADDRESS - override def field4: Field[String] = CustomerList.CUSTOMER_LIST.ZIP_CODE - override def field5: Field[String] = CustomerList.CUSTOMER_LIST.PHONE - override def field6: Field[String] = CustomerList.CUSTOMER_LIST.CITY - override def field7: Field[String] = CustomerList.CUSTOMER_LIST.COUNTRY - override def field8: Field[String] = CustomerList.CUSTOMER_LIST.NOTES - override def field9: Field[Long] = CustomerList.CUSTOMER_LIST.SID - override def component1: Long = getId - override def component2: String = getName - override def component3: String = getAddress - override def component4: String = getZipCode - override def component5: String = getPhone - override def component6: String = getCity - override def component7: String = getCountry - override def component8: String = getNotes - override def component9: Long = getSid - override def value1: Long = getId - override def value2: String = getName - override def value3: String = getAddress - override def value4: String = getZipCode - override def value5: String = getPhone - override def value6: String = getCity - override def value7: String = getCountry - override def value8: String = getNotes - override def value9: Long = getSid - - override def value1(value: Long): CustomerListRecord = { - setId(value) - this - } - - override def value2(value: String): CustomerListRecord = { - setName(value) - this - } - - override def value3(value: String): CustomerListRecord = { - setAddress(value) - this - } - - override def value4(value: String): CustomerListRecord = { - setZipCode(value) - this - } - - override def value5(value: String): CustomerListRecord = { - setPhone(value) - this - } - - override def value6(value: String): CustomerListRecord = { - setCity(value) - this - } - - override def value7(value: String): CustomerListRecord = { - setCountry(value) - this - } - - override def value8(value: String): CustomerListRecord = { - setNotes(value) - this - } - - override def value9(value: Long): CustomerListRecord = { - setSid(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : String, value6 : String, value7 : String, value8 : String, value9 : Long): CustomerListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this - } - /** * Create a detached, initialised CustomerListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala index 46435cb..bedcc64 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala @@ -11,10 +11,7 @@ import java.lang.String import java.time.LocalDate import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record10 -import org.jooq.Row10 import org.jooq.demo.skala.db.tables.Customer import org.jooq.impl.UpdatableRecordImpl @@ -22,7 +19,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CustomerRecord extends UpdatableRecordImpl[CustomerRecord](Customer.CUSTOMER) with Record10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] { +class CustomerRecord extends UpdatableRecordImpl[CustomerRecord](Customer.CUSTOMER) { /** * Setter for public.customer.customer_id. @@ -150,108 +147,6 @@ class CustomerRecord extends UpdatableRecordImpl[CustomerRecord](Customer.CUSTOM override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.fieldsRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] - - override def valuesRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.valuesRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] - override def field1: Field[Long] = Customer.CUSTOMER.CUSTOMER_ID - override def field2: Field[Long] = Customer.CUSTOMER.STORE_ID - override def field3: Field[String] = Customer.CUSTOMER.FIRST_NAME - override def field4: Field[String] = Customer.CUSTOMER.LAST_NAME - override def field5: Field[String] = Customer.CUSTOMER.EMAIL - override def field6: Field[Long] = Customer.CUSTOMER.ADDRESS_ID - override def field7: Field[Boolean] = Customer.CUSTOMER.ACTIVEBOOL - override def field8: Field[LocalDate] = Customer.CUSTOMER.CREATE_DATE - override def field9: Field[LocalDateTime] = Customer.CUSTOMER.LAST_UPDATE - override def field10: Field[Integer] = Customer.CUSTOMER.ACTIVE - override def component1: Long = getCustomerId - override def component2: Long = getStoreId - override def component3: String = getFirstName - override def component4: String = getLastName - override def component5: String = getEmail - override def component6: Long = getAddressId - override def component7: Boolean = getActivebool - override def component8: LocalDate = getCreateDate - override def component9: LocalDateTime = getLastUpdate - override def component10: Integer = getActive - override def value1: Long = getCustomerId - override def value2: Long = getStoreId - override def value3: String = getFirstName - override def value4: String = getLastName - override def value5: String = getEmail - override def value6: Long = getAddressId - override def value7: Boolean = getActivebool - override def value8: LocalDate = getCreateDate - override def value9: LocalDateTime = getLastUpdate - override def value10: Integer = getActive - - override def value1(value: Long): CustomerRecord = { - setCustomerId(value) - this - } - - override def value2(value: Long): CustomerRecord = { - setStoreId(value) - this - } - - override def value3(value: String): CustomerRecord = { - setFirstName(value) - this - } - - override def value4(value: String): CustomerRecord = { - setLastName(value) - this - } - - override def value5(value: String): CustomerRecord = { - setEmail(value) - this - } - - override def value6(value: Long): CustomerRecord = { - setAddressId(value) - this - } - - override def value7(value: Boolean): CustomerRecord = { - setActivebool(value) - this - } - - override def value8(value: LocalDate): CustomerRecord = { - setCreateDate(value) - this - } - - override def value9(value: LocalDateTime): CustomerRecord = { - setLastUpdate(value) - this - } - - override def value10(value: Integer): CustomerRecord = { - setActive(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : String, value4 : String, value5 : String, value6 : Long, value7 : Boolean, value8 : LocalDate, value9 : LocalDateTime, value10 : Integer): CustomerRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this - } - /** * Create a detached, initialised CustomerRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala index e0acc9a..3dd5cdc 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.FilmActor import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class FilmActorRecord extends UpdatableRecordImpl[FilmActorRecord](FilmActor.FILM_ACTOR) with Record3[Long, Long, LocalDateTime] { +class FilmActorRecord extends UpdatableRecordImpl[FilmActorRecord](FilmActor.FILM_ACTOR) { /** * Setter for public.film_actor.actor_id. @@ -62,45 +59,6 @@ class FilmActorRecord extends UpdatableRecordImpl[FilmActorRecord](FilmActor.FIL override def key: Record2[Long, Long] = super.key.asInstanceOf[ Record2[Long, Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - - override def valuesRow: Row3[Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - override def field1: Field[Long] = FilmActor.FILM_ACTOR.ACTOR_ID - override def field2: Field[Long] = FilmActor.FILM_ACTOR.FILM_ID - override def field3: Field[LocalDateTime] = FilmActor.FILM_ACTOR.LAST_UPDATE - override def component1: Long = getActorId - override def component2: Long = getFilmId - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getActorId - override def value2: Long = getFilmId - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): FilmActorRecord = { - setActorId(value) - this - } - - override def value2(value: Long): FilmActorRecord = { - setFilmId(value) - this - } - - override def value3(value: LocalDateTime): FilmActorRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : LocalDateTime): FilmActorRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised FilmActorRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala index c989526..4159c7e 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.FilmCategory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class FilmCategoryRecord extends UpdatableRecordImpl[FilmCategoryRecord](FilmCategory.FILM_CATEGORY) with Record3[Long, Long, LocalDateTime] { +class FilmCategoryRecord extends UpdatableRecordImpl[FilmCategoryRecord](FilmCategory.FILM_CATEGORY) { /** * Setter for public.film_category.film_id. @@ -62,45 +59,6 @@ class FilmCategoryRecord extends UpdatableRecordImpl[FilmCategoryRecord](FilmCat override def key: Record2[Long, Long] = super.key.asInstanceOf[ Record2[Long, Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - - override def valuesRow: Row3[Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - override def field1: Field[Long] = FilmCategory.FILM_CATEGORY.FILM_ID - override def field2: Field[Long] = FilmCategory.FILM_CATEGORY.CATEGORY_ID - override def field3: Field[LocalDateTime] = FilmCategory.FILM_CATEGORY.LAST_UPDATE - override def component1: Long = getFilmId - override def component2: Long = getCategoryId - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getFilmId - override def value2: Long = getCategoryId - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): FilmCategoryRecord = { - setFilmId(value) - this - } - - override def value2(value: Long): FilmCategoryRecord = { - setCategoryId(value) - this - } - - override def value3(value: LocalDateTime): FilmCategoryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : LocalDateTime): FilmCategoryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised FilmCategoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala index 91ec834..633dbb5 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala @@ -6,9 +6,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Integer -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.skala.db.tables.FilmInStock import org.jooq.impl.TableRecordImpl @@ -16,7 +13,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class FilmInStockRecord extends TableRecordImpl[FilmInStockRecord](FilmInStock.FILM_IN_STOCK) with Record1[Integer] { +class FilmInStockRecord extends TableRecordImpl[FilmInStockRecord](FilmInStock.FILM_IN_STOCK) { /** * Setter for public.film_in_stock.p_film_count. @@ -30,27 +27,6 @@ class FilmInStockRecord extends TableRecordImpl[FilmInStockRecord](FilmInStock.F */ def getPFilmCount: Integer = get(0).asInstanceOf[Integer] - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] - - override def valuesRow: Row1[Integer] = super.valuesRow.asInstanceOf[ Row1[Integer] ] - override def field1: Field[Integer] = FilmInStock.FILM_IN_STOCK.P_FILM_COUNT - override def component1: Integer = getPFilmCount - override def value1: Integer = getPFilmCount - - override def value1(value: Integer): FilmInStockRecord = { - setPFilmCount(value) - this - } - - override def values(value1 : Integer): FilmInStockRecord = { - this.value1(value1) - this - } - /** * Create a detached, initialised FilmInStockRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala index 953fea0..3843ecb 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala @@ -9,9 +9,6 @@ import java.lang.Short import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.FilmList import org.jooq.impl.TableRecordImpl @@ -20,7 +17,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class FilmListRecord extends TableRecordImpl[FilmListRecord](FilmList.FILM_LIST) with Record8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] { +class FilmListRecord extends TableRecordImpl[FilmListRecord](FilmList.FILM_LIST) { /** * Setter for public.film_list.fid. @@ -118,90 +115,6 @@ class FilmListRecord extends TableRecordImpl[FilmListRecord](FilmList.FILM_LIST) */ def getActors: String = get(7).asInstanceOf[String] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - - override def valuesRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - override def field1: Field[Long] = FilmList.FILM_LIST.FID - override def field2: Field[String] = FilmList.FILM_LIST.TITLE - override def field3: Field[String] = FilmList.FILM_LIST.DESCRIPTION - override def field4: Field[String] = FilmList.FILM_LIST.CATEGORY - override def field5: Field[BigDecimal] = FilmList.FILM_LIST.PRICE - override def field6: Field[Short] = FilmList.FILM_LIST.LENGTH - override def field7: Field[MpaaRating] = FilmList.FILM_LIST.RATING - override def field8: Field[String] = FilmList.FILM_LIST.ACTORS - override def component1: Long = getFid - override def component2: String = getTitle - override def component3: String = getDescription - override def component4: String = getCategory - override def component5: BigDecimal = getPrice - override def component6: Short = getLength - override def component7: MpaaRating = getRating - override def component8: String = getActors - override def value1: Long = getFid - override def value2: String = getTitle - override def value3: String = getDescription - override def value4: String = getCategory - override def value5: BigDecimal = getPrice - override def value6: Short = getLength - override def value7: MpaaRating = getRating - override def value8: String = getActors - - override def value1(value: Long): FilmListRecord = { - setFid(value) - this - } - - override def value2(value: String): FilmListRecord = { - setTitle(value) - this - } - - override def value3(value: String): FilmListRecord = { - setDescription(value) - this - } - - override def value4(value: String): FilmListRecord = { - setCategory(value) - this - } - - override def value5(value: BigDecimal): FilmListRecord = { - setPrice(value) - this - } - - override def value6(value: Short): FilmListRecord = { - setLength(value) - this - } - - override def value7(value: MpaaRating): FilmListRecord = { - setRating(value) - this - } - - override def value8(value: String): FilmListRecord = { - setActors(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : BigDecimal, value6 : Short, value7 : MpaaRating, value8 : String): FilmListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised FilmListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala index 224b1ae..eab119b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala @@ -6,9 +6,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Integer -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.skala.db.tables.FilmNotInStock import org.jooq.impl.TableRecordImpl @@ -16,7 +13,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class FilmNotInStockRecord extends TableRecordImpl[FilmNotInStockRecord](FilmNotInStock.FILM_NOT_IN_STOCK) with Record1[Integer] { +class FilmNotInStockRecord extends TableRecordImpl[FilmNotInStockRecord](FilmNotInStock.FILM_NOT_IN_STOCK) { /** * Setter for public.film_not_in_stock.p_film_count. @@ -30,27 +27,6 @@ class FilmNotInStockRecord extends TableRecordImpl[FilmNotInStockRecord](FilmNot */ def getPFilmCount: Integer = get(0).asInstanceOf[Integer] - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] - - override def valuesRow: Row1[Integer] = super.valuesRow.asInstanceOf[ Row1[Integer] ] - override def field1: Field[Integer] = FilmNotInStock.FILM_NOT_IN_STOCK.P_FILM_COUNT - override def component1: Integer = getPFilmCount - override def value1: Integer = getPFilmCount - - override def value1(value: Integer): FilmNotInStockRecord = { - setPFilmCount(value) - this - } - - override def values(value1 : Integer): FilmNotInStockRecord = { - this.value1(value1) - this - } - /** * Create a detached, initialised FilmNotInStockRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala index 4f73a0b..5a9b917 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala @@ -13,10 +13,7 @@ import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record14 -import org.jooq.Row14 import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.Film import org.jooq.impl.UpdatableRecordImpl @@ -27,7 +24,7 @@ import scala.Array /** * This class is generated by jOOQ. */ -class FilmRecord extends UpdatableRecordImpl[FilmRecord](Film.FILM) with Record14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] { +class FilmRecord extends UpdatableRecordImpl[FilmRecord](Film.FILM) { /** * Setter for public.film.film_id. @@ -213,180 +210,6 @@ class FilmRecord extends UpdatableRecordImpl[FilmRecord](Film.FILM) with Record1 override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] = super.fieldsRow.asInstanceOf[ Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] ] - - override def valuesRow: Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] = super.valuesRow.asInstanceOf[ Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] ] - override def field1: Field[Long] = Film.FILM.FILM_ID - override def field2: Field[String] = Film.FILM.TITLE - override def field3: Field[String] = Film.FILM.DESCRIPTION - override def field4: Field[Integer] = Film.FILM.RELEASE_YEAR - override def field5: Field[Long] = Film.FILM.LANGUAGE_ID - override def field6: Field[Long] = Film.FILM.ORIGINAL_LANGUAGE_ID - override def field7: Field[Short] = Film.FILM.RENTAL_DURATION - override def field8: Field[BigDecimal] = Film.FILM.RENTAL_RATE - override def field9: Field[Short] = Film.FILM.LENGTH - override def field10: Field[BigDecimal] = Film.FILM.REPLACEMENT_COST - override def field11: Field[MpaaRating] = Film.FILM.RATING - override def field12: Field[LocalDateTime] = Film.FILM.LAST_UPDATE - override def field13: Field[Array[String]] = Film.FILM.SPECIAL_FEATURES - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def field14: Field[Object] = Film.FILM.FULLTEXT - override def component1: Long = getFilmId - override def component2: String = getTitle - override def component3: String = getDescription - override def component4: Integer = getReleaseYear - override def component5: Long = getLanguageId - override def component6: Long = getOriginalLanguageId - override def component7: Short = getRentalDuration - override def component8: BigDecimal = getRentalRate - override def component9: Short = getLength - override def component10: BigDecimal = getReplacementCost - override def component11: MpaaRating = getRating - override def component12: LocalDateTime = getLastUpdate - override def component13: Array[String] = getSpecialFeatures - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def component14: Object = getFulltext - override def value1: Long = getFilmId - override def value2: String = getTitle - override def value3: String = getDescription - override def value4: Integer = getReleaseYear - override def value5: Long = getLanguageId - override def value6: Long = getOriginalLanguageId - override def value7: Short = getRentalDuration - override def value8: BigDecimal = getRentalRate - override def value9: Short = getLength - override def value10: BigDecimal = getReplacementCost - override def value11: MpaaRating = getRating - override def value12: LocalDateTime = getLastUpdate - override def value13: Array[String] = getSpecialFeatures - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def value14: Object = getFulltext - - override def value1(value: Long): FilmRecord = { - setFilmId(value) - this - } - - override def value2(value: String): FilmRecord = { - setTitle(value) - this - } - - override def value3(value: String): FilmRecord = { - setDescription(value) - this - } - - override def value4(value: Integer): FilmRecord = { - setReleaseYear(value) - this - } - - override def value5(value: Long): FilmRecord = { - setLanguageId(value) - this - } - - override def value6(value: Long): FilmRecord = { - setOriginalLanguageId(value) - this - } - - override def value7(value: Short): FilmRecord = { - setRentalDuration(value) - this - } - - override def value8(value: BigDecimal): FilmRecord = { - setRentalRate(value) - this - } - - override def value9(value: Short): FilmRecord = { - setLength(value) - this - } - - override def value10(value: BigDecimal): FilmRecord = { - setReplacementCost(value) - this - } - - override def value11(value: MpaaRating): FilmRecord = { - setRating(value) - this - } - - override def value12(value: LocalDateTime): FilmRecord = { - setLastUpdate(value) - this - } - - override def value13(value: Array[String]): FilmRecord = { - setSpecialFeatures(value) - this - } - - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def value14(value: Object): FilmRecord = { - setFulltext(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : Integer, value5 : Long, value6 : Long, value7 : Short, value8 : BigDecimal, value9 : Short, value10 : BigDecimal, value11 : MpaaRating, value12 : LocalDateTime, value13 : Array[String], value14 : Object): FilmRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this.value12(value12) - this.value13(value13) - this.value14(value14) - this - } - /** * Create a detached, initialised FilmRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala index fad2727..8c54fc6 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.Inventory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class InventoryRecord extends UpdatableRecordImpl[InventoryRecord](Inventory.INVENTORY) with Record4[Long, Long, Long, LocalDateTime] { +class InventoryRecord extends UpdatableRecordImpl[InventoryRecord](Inventory.INVENTORY) { /** * Setter for public.inventory.inventory_id. @@ -74,54 +71,6 @@ class InventoryRecord extends UpdatableRecordImpl[InventoryRecord](Inventory.INV override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] - - override def valuesRow: Row4[Long, Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] - override def field1: Field[Long] = Inventory.INVENTORY.INVENTORY_ID - override def field2: Field[Long] = Inventory.INVENTORY.FILM_ID - override def field3: Field[Long] = Inventory.INVENTORY.STORE_ID - override def field4: Field[LocalDateTime] = Inventory.INVENTORY.LAST_UPDATE - override def component1: Long = getInventoryId - override def component2: Long = getFilmId - override def component3: Long = getStoreId - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getInventoryId - override def value2: Long = getFilmId - override def value3: Long = getStoreId - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): InventoryRecord = { - setInventoryId(value) - this - } - - override def value2(value: Long): InventoryRecord = { - setFilmId(value) - this - } - - override def value3(value: Long): InventoryRecord = { - setStoreId(value) - this - } - - override def value4(value: LocalDateTime): InventoryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : LocalDateTime): InventoryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised InventoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala index d682f97..172babe 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.Language import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class LanguageRecord extends UpdatableRecordImpl[LanguageRecord](Language.LANGUAGE) with Record3[Long, String, LocalDateTime] { +class LanguageRecord extends UpdatableRecordImpl[LanguageRecord](Language.LANGUAGE) { /** * Setter for public.language.language_id. @@ -63,45 +60,6 @@ class LanguageRecord extends UpdatableRecordImpl[LanguageRecord](Language.LANGUA override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - - override def valuesRow: Row3[Long, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - override def field1: Field[Long] = Language.LANGUAGE.LANGUAGE_ID - override def field2: Field[String] = Language.LANGUAGE.NAME - override def field3: Field[LocalDateTime] = Language.LANGUAGE.LAST_UPDATE - override def component1: Long = getLanguageId - override def component2: String = getName - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getLanguageId - override def value2: String = getName - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): LanguageRecord = { - setLanguageId(value) - this - } - - override def value2(value: String): LanguageRecord = { - setName(value) - this - } - - override def value3(value: LocalDateTime): LanguageRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : LocalDateTime): LanguageRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised LanguageRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala index 382d050..900d056 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala @@ -9,9 +9,6 @@ import java.lang.Short import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.NicerButSlowerFilmList import org.jooq.impl.TableRecordImpl @@ -20,7 +17,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class NicerButSlowerFilmListRecord extends TableRecordImpl[NicerButSlowerFilmListRecord](NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST) with Record8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] { +class NicerButSlowerFilmListRecord extends TableRecordImpl[NicerButSlowerFilmListRecord](NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST) { /** * Setter for public.nicer_but_slower_film_list.fid. @@ -118,90 +115,6 @@ class NicerButSlowerFilmListRecord extends TableRecordImpl[NicerButSlowerFilmLis */ def getActors: String = get(7).asInstanceOf[String] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - - override def valuesRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - override def field1: Field[Long] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.FID - override def field2: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.TITLE - override def field3: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.DESCRIPTION - override def field4: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.CATEGORY - override def field5: Field[BigDecimal] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.PRICE - override def field6: Field[Short] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.LENGTH - override def field7: Field[MpaaRating] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.RATING - override def field8: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.ACTORS - override def component1: Long = getFid - override def component2: String = getTitle - override def component3: String = getDescription - override def component4: String = getCategory - override def component5: BigDecimal = getPrice - override def component6: Short = getLength - override def component7: MpaaRating = getRating - override def component8: String = getActors - override def value1: Long = getFid - override def value2: String = getTitle - override def value3: String = getDescription - override def value4: String = getCategory - override def value5: BigDecimal = getPrice - override def value6: Short = getLength - override def value7: MpaaRating = getRating - override def value8: String = getActors - - override def value1(value: Long): NicerButSlowerFilmListRecord = { - setFid(value) - this - } - - override def value2(value: String): NicerButSlowerFilmListRecord = { - setTitle(value) - this - } - - override def value3(value: String): NicerButSlowerFilmListRecord = { - setDescription(value) - this - } - - override def value4(value: String): NicerButSlowerFilmListRecord = { - setCategory(value) - this - } - - override def value5(value: BigDecimal): NicerButSlowerFilmListRecord = { - setPrice(value) - this - } - - override def value6(value: Short): NicerButSlowerFilmListRecord = { - setLength(value) - this - } - - override def value7(value: MpaaRating): NicerButSlowerFilmListRecord = { - setRating(value) - this - } - - override def value8(value: String): NicerButSlowerFilmListRecord = { - setActors(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : BigDecimal, value6 : Short, value7 : MpaaRating, value8 : String): NicerButSlowerFilmListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised NicerButSlowerFilmListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala index 0e5d0a5..c8702dd 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_01 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_01Record extends TableRecordImpl[PaymentP2007_01Record](PaymentP2007_01.PAYMENT_P2007_01) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_01Record extends TableRecordImpl[PaymentP2007_01Record](PaymentP2007_01.PAYMENT_P2007_01) { /** * Setter for public.payment_p2007_01.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_01Record extends TableRecordImpl[PaymentP2007_01Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.STAFF_ID - override def field4: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_01.PAYMENT_P2007_01.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_01Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_01Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_01Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_01Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_01Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_01Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_01Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_01Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala index 9c30363..597f53a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_02 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_02Record extends TableRecordImpl[PaymentP2007_02Record](PaymentP2007_02.PAYMENT_P2007_02) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_02Record extends TableRecordImpl[PaymentP2007_02Record](PaymentP2007_02.PAYMENT_P2007_02) { /** * Setter for public.payment_p2007_02.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_02Record extends TableRecordImpl[PaymentP2007_02Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.STAFF_ID - override def field4: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_02.PAYMENT_P2007_02.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_02Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_02Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_02Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_02Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_02Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_02Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_02Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_02Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala index e1f16d3..29be5a1 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_03 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_03Record extends TableRecordImpl[PaymentP2007_03Record](PaymentP2007_03.PAYMENT_P2007_03) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_03Record extends TableRecordImpl[PaymentP2007_03Record](PaymentP2007_03.PAYMENT_P2007_03) { /** * Setter for public.payment_p2007_03.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_03Record extends TableRecordImpl[PaymentP2007_03Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.STAFF_ID - override def field4: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_03.PAYMENT_P2007_03.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_03Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_03Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_03Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_03Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_03Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_03Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_03Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_03Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala index 5f3ae04..17f4407 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_04 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_04Record extends TableRecordImpl[PaymentP2007_04Record](PaymentP2007_04.PAYMENT_P2007_04) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_04Record extends TableRecordImpl[PaymentP2007_04Record](PaymentP2007_04.PAYMENT_P2007_04) { /** * Setter for public.payment_p2007_04.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_04Record extends TableRecordImpl[PaymentP2007_04Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.STAFF_ID - override def field4: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_04.PAYMENT_P2007_04.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_04Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_04Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_04Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_04Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_04Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_04Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_04Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_04Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala index d9231fd..48c35a0 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_05 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_05Record extends TableRecordImpl[PaymentP2007_05Record](PaymentP2007_05.PAYMENT_P2007_05) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_05Record extends TableRecordImpl[PaymentP2007_05Record](PaymentP2007_05.PAYMENT_P2007_05) { /** * Setter for public.payment_p2007_05.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_05Record extends TableRecordImpl[PaymentP2007_05Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.STAFF_ID - override def field4: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_05.PAYMENT_P2007_05.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_05Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_05Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_05Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_05Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_05Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_05Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_05Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_05Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala index 8cfbaff..eec6993 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_06 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_06Record extends TableRecordImpl[PaymentP2007_06Record](PaymentP2007_06.PAYMENT_P2007_06) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_06Record extends TableRecordImpl[PaymentP2007_06Record](PaymentP2007_06.PAYMENT_P2007_06) { /** * Setter for public.payment_p2007_06.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_06Record extends TableRecordImpl[PaymentP2007_06Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.STAFF_ID - override def field4: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_06.PAYMENT_P2007_06.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_06Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_06Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_06Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_06Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_06Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_06Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_06Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_06Record */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala index 2d40d10..15ee713 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.Payment import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentRecord extends UpdatableRecordImpl[PaymentRecord](Payment.PAYMENT) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentRecord extends UpdatableRecordImpl[PaymentRecord](Payment.PAYMENT) { /** * Setter for public.payment.payment_id. @@ -99,72 +96,6 @@ class PaymentRecord extends UpdatableRecordImpl[PaymentRecord](Payment.PAYMENT) override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = Payment.PAYMENT.PAYMENT_ID - override def field2: Field[Long] = Payment.PAYMENT.CUSTOMER_ID - override def field3: Field[Long] = Payment.PAYMENT.STAFF_ID - override def field4: Field[Long] = Payment.PAYMENT.RENTAL_ID - override def field5: Field[BigDecimal] = Payment.PAYMENT.AMOUNT - override def field6: Field[LocalDateTime] = Payment.PAYMENT.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentRecord = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentRecord = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentRecord = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentRecord = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentRecord = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentRecord = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala index aebe550..9f7bb73 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record7 -import org.jooq.Row7 import org.jooq.demo.skala.db.tables.Rental import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class RentalRecord extends UpdatableRecordImpl[RentalRecord](Rental.RENTAL) with Record7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] { +class RentalRecord extends UpdatableRecordImpl[RentalRecord](Rental.RENTAL) { /** * Setter for public.rental.rental_id. @@ -110,81 +107,6 @@ class RentalRecord extends UpdatableRecordImpl[RentalRecord](Rental.RENTAL) with override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] ] - - override def valuesRow: Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] ] - override def field1: Field[Long] = Rental.RENTAL.RENTAL_ID - override def field2: Field[LocalDateTime] = Rental.RENTAL.RENTAL_DATE - override def field3: Field[Long] = Rental.RENTAL.INVENTORY_ID - override def field4: Field[Long] = Rental.RENTAL.CUSTOMER_ID - override def field5: Field[LocalDateTime] = Rental.RENTAL.RETURN_DATE - override def field6: Field[Long] = Rental.RENTAL.STAFF_ID - override def field7: Field[LocalDateTime] = Rental.RENTAL.LAST_UPDATE - override def component1: Long = getRentalId - override def component2: LocalDateTime = getRentalDate - override def component3: Long = getInventoryId - override def component4: Long = getCustomerId - override def component5: LocalDateTime = getReturnDate - override def component6: Long = getStaffId - override def component7: LocalDateTime = getLastUpdate - override def value1: Long = getRentalId - override def value2: LocalDateTime = getRentalDate - override def value3: Long = getInventoryId - override def value4: Long = getCustomerId - override def value5: LocalDateTime = getReturnDate - override def value6: Long = getStaffId - override def value7: LocalDateTime = getLastUpdate - - override def value1(value: Long): RentalRecord = { - setRentalId(value) - this - } - - override def value2(value: LocalDateTime): RentalRecord = { - setRentalDate(value) - this - } - - override def value3(value: Long): RentalRecord = { - setInventoryId(value) - this - } - - override def value4(value: Long): RentalRecord = { - setCustomerId(value) - this - } - - override def value5(value: LocalDateTime): RentalRecord = { - setReturnDate(value) - this - } - - override def value6(value: Long): RentalRecord = { - setStaffId(value) - this - } - - override def value7(value: LocalDateTime): RentalRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : LocalDateTime, value3 : Long, value4 : Long, value5 : LocalDateTime, value6 : Long, value7 : LocalDateTime): RentalRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this - } - /** * Create a detached, initialised RentalRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala index 98e2adc..b3a1547 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record2 -import org.jooq.Row2 import org.jooq.demo.skala.db.tables.SalesByFilmCategory import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class SalesByFilmCategoryRecord extends TableRecordImpl[SalesByFilmCategoryRecord](SalesByFilmCategory.SALES_BY_FILM_CATEGORY) with Record2[String, BigDecimal] { +class SalesByFilmCategoryRecord extends TableRecordImpl[SalesByFilmCategoryRecord](SalesByFilmCategory.SALES_BY_FILM_CATEGORY) { /** * Setter for public.sales_by_film_category.category. @@ -43,36 +40,6 @@ class SalesByFilmCategoryRecord extends TableRecordImpl[SalesByFilmCategoryRecor */ def getTotalSales: BigDecimal = get(1).asInstanceOf[BigDecimal] - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row2[String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row2[String, BigDecimal] ] - - override def valuesRow: Row2[String, BigDecimal] = super.valuesRow.asInstanceOf[ Row2[String, BigDecimal] ] - override def field1: Field[String] = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.CATEGORY - override def field2: Field[BigDecimal] = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.TOTAL_SALES - override def component1: String = getCategory - override def component2: BigDecimal = getTotalSales - override def value1: String = getCategory - override def value2: BigDecimal = getTotalSales - - override def value1(value: String): SalesByFilmCategoryRecord = { - setCategory(value) - this - } - - override def value2(value: BigDecimal): SalesByFilmCategoryRecord = { - setTotalSales(value) - this - } - - override def values(value1 : String, value2 : BigDecimal): SalesByFilmCategoryRecord = { - this.value1(value1) - this.value2(value2) - this - } - /** * Create a detached, initialised SalesByFilmCategoryRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala index a0d47b3..0c7019a 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.SalesByStore import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class SalesByStoreRecord extends TableRecordImpl[SalesByStoreRecord](SalesByStore.SALES_BY_STORE) with Record3[String, String, BigDecimal] { +class SalesByStoreRecord extends TableRecordImpl[SalesByStoreRecord](SalesByStore.SALES_BY_STORE) { /** * Setter for public.sales_by_store.store. @@ -55,45 +52,6 @@ class SalesByStoreRecord extends TableRecordImpl[SalesByStoreRecord](SalesByStor */ def getTotalSales: BigDecimal = get(2).asInstanceOf[BigDecimal] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[String, String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row3[String, String, BigDecimal] ] - - override def valuesRow: Row3[String, String, BigDecimal] = super.valuesRow.asInstanceOf[ Row3[String, String, BigDecimal] ] - override def field1: Field[String] = SalesByStore.SALES_BY_STORE.STORE - override def field2: Field[String] = SalesByStore.SALES_BY_STORE.MANAGER - override def field3: Field[BigDecimal] = SalesByStore.SALES_BY_STORE.TOTAL_SALES - override def component1: String = getStore - override def component2: String = getManager - override def component3: BigDecimal = getTotalSales - override def value1: String = getStore - override def value2: String = getManager - override def value3: BigDecimal = getTotalSales - - override def value1(value: String): SalesByStoreRecord = { - setStore(value) - this - } - - override def value2(value: String): SalesByStoreRecord = { - setManager(value) - this - } - - override def value3(value: BigDecimal): SalesByStoreRecord = { - setTotalSales(value) - this - } - - override def values(value1 : String, value2 : String, value3 : BigDecimal): SalesByStoreRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised SalesByStoreRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala index 526bc20..16546a9 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.lang.String -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.tables.StaffList import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class StaffListRecord extends TableRecordImpl[StaffListRecord](StaffList.STAFF_LIST) with Record8[Long, String, String, String, String, String, String, Long] { +class StaffListRecord extends TableRecordImpl[StaffListRecord](StaffList.STAFF_LIST) { /** * Setter for public.staff_list.id. @@ -115,90 +112,6 @@ class StaffListRecord extends TableRecordImpl[StaffListRecord](StaffList.STAFF_L */ def getSid: Long = get(7).asInstanceOf[Long] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, String, String, String, Long] ] - - override def valuesRow: Row8[Long, String, String, String, String, String, String, Long] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, String, String, String, Long] ] - override def field1: Field[Long] = StaffList.STAFF_LIST.ID - override def field2: Field[String] = StaffList.STAFF_LIST.NAME - override def field3: Field[String] = StaffList.STAFF_LIST.ADDRESS - override def field4: Field[String] = StaffList.STAFF_LIST.ZIP_CODE - override def field5: Field[String] = StaffList.STAFF_LIST.PHONE - override def field6: Field[String] = StaffList.STAFF_LIST.CITY - override def field7: Field[String] = StaffList.STAFF_LIST.COUNTRY - override def field8: Field[Long] = StaffList.STAFF_LIST.SID - override def component1: Long = getId - override def component2: String = getName - override def component3: String = getAddress - override def component4: String = getZipCode - override def component5: String = getPhone - override def component6: String = getCity - override def component7: String = getCountry - override def component8: Long = getSid - override def value1: Long = getId - override def value2: String = getName - override def value3: String = getAddress - override def value4: String = getZipCode - override def value5: String = getPhone - override def value6: String = getCity - override def value7: String = getCountry - override def value8: Long = getSid - - override def value1(value: Long): StaffListRecord = { - setId(value) - this - } - - override def value2(value: String): StaffListRecord = { - setName(value) - this - } - - override def value3(value: String): StaffListRecord = { - setAddress(value) - this - } - - override def value4(value: String): StaffListRecord = { - setZipCode(value) - this - } - - override def value5(value: String): StaffListRecord = { - setPhone(value) - this - } - - override def value6(value: String): StaffListRecord = { - setCity(value) - this - } - - override def value7(value: String): StaffListRecord = { - setCountry(value) - this - } - - override def value8(value: Long): StaffListRecord = { - setSid(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : String, value6 : String, value7 : String, value8 : Long): StaffListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised StaffListRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala index 2187f11..cc5dd38 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala @@ -9,10 +9,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record11 -import org.jooq.Row11 import org.jooq.demo.skala.db.tables.Staff import org.jooq.impl.UpdatableRecordImpl @@ -23,7 +20,7 @@ import scala.Byte /** * This class is generated by jOOQ. */ -class StaffRecord extends UpdatableRecordImpl[StaffRecord](Staff.STAFF) with Record11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] { +class StaffRecord extends UpdatableRecordImpl[StaffRecord](Staff.STAFF) { /** * Setter for public.staff.staff_id. @@ -163,117 +160,6 @@ class StaffRecord extends UpdatableRecordImpl[StaffRecord](Staff.STAFF) with Rec override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record11 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] = super.fieldsRow.asInstanceOf[ Row11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] ] - - override def valuesRow: Row11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] = super.valuesRow.asInstanceOf[ Row11[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte]] ] - override def field1: Field[Long] = Staff.STAFF.STAFF_ID - override def field2: Field[String] = Staff.STAFF.FIRST_NAME - override def field3: Field[String] = Staff.STAFF.LAST_NAME - override def field4: Field[Long] = Staff.STAFF.ADDRESS_ID - override def field5: Field[String] = Staff.STAFF.EMAIL - override def field6: Field[Long] = Staff.STAFF.STORE_ID - override def field7: Field[Boolean] = Staff.STAFF.ACTIVE - override def field8: Field[String] = Staff.STAFF.USERNAME - override def field9: Field[String] = Staff.STAFF.PASSWORD - override def field10: Field[LocalDateTime] = Staff.STAFF.LAST_UPDATE - override def field11: Field[Array[Byte]] = Staff.STAFF.PICTURE - override def component1: Long = getStaffId - override def component2: String = getFirstName - override def component3: String = getLastName - override def component4: Long = getAddressId - override def component5: String = getEmail - override def component6: Long = getStoreId - override def component7: Boolean = getActive - override def component8: String = getUsername - override def component9: String = getPassword - override def component10: LocalDateTime = getLastUpdate - override def component11: Array[Byte] = getPicture - override def value1: Long = getStaffId - override def value2: String = getFirstName - override def value3: String = getLastName - override def value4: Long = getAddressId - override def value5: String = getEmail - override def value6: Long = getStoreId - override def value7: Boolean = getActive - override def value8: String = getUsername - override def value9: String = getPassword - override def value10: LocalDateTime = getLastUpdate - override def value11: Array[Byte] = getPicture - - override def value1(value: Long): StaffRecord = { - setStaffId(value) - this - } - - override def value2(value: String): StaffRecord = { - setFirstName(value) - this - } - - override def value3(value: String): StaffRecord = { - setLastName(value) - this - } - - override def value4(value: Long): StaffRecord = { - setAddressId(value) - this - } - - override def value5(value: String): StaffRecord = { - setEmail(value) - this - } - - override def value6(value: Long): StaffRecord = { - setStoreId(value) - this - } - - override def value7(value: Boolean): StaffRecord = { - setActive(value) - this - } - - override def value8(value: String): StaffRecord = { - setUsername(value) - this - } - - override def value9(value: String): StaffRecord = { - setPassword(value) - this - } - - override def value10(value: LocalDateTime): StaffRecord = { - setLastUpdate(value) - this - } - - override def value11(value: Array[Byte]): StaffRecord = { - setPicture(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : Long, value5 : String, value6 : Long, value7 : Boolean, value8 : String, value9 : String, value10 : LocalDateTime, value11 : Array[Byte]): StaffRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this - } - /** * Create a detached, initialised StaffRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala index 3570bbb..08be97b 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.Store import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class StoreRecord extends UpdatableRecordImpl[StoreRecord](Store.STORE) with Record4[Long, Long, Long, LocalDateTime] { +class StoreRecord extends UpdatableRecordImpl[StoreRecord](Store.STORE) { /** * Setter for public.store.store_id. @@ -74,54 +71,6 @@ class StoreRecord extends UpdatableRecordImpl[StoreRecord](Store.STORE) with Rec override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] - - override def valuesRow: Row4[Long, Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] - override def field1: Field[Long] = Store.STORE.STORE_ID - override def field2: Field[Long] = Store.STORE.MANAGER_STAFF_ID - override def field3: Field[Long] = Store.STORE.ADDRESS_ID - override def field4: Field[LocalDateTime] = Store.STORE.LAST_UPDATE - override def component1: Long = getStoreId - override def component2: Long = getManagerStaffId - override def component3: Long = getAddressId - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getStoreId - override def value2: Long = getManagerStaffId - override def value3: Long = getAddressId - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): StoreRecord = { - setStoreId(value) - this - } - - override def value2(value: Long): StoreRecord = { - setManagerStaffId(value) - this - } - - override def value3(value: Long): StoreRecord = { - setAddressId(value) - this - } - - override def value4(value: LocalDateTime): StoreRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : LocalDateTime): StoreRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised StoreRecord */ diff --git a/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala b/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala index 3f4ce5f..8212699 100644 --- a/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala +++ b/jOOQ-demo-oss/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala @@ -27,7 +27,10 @@ class Demo14Mocking extends AbstractDemo { // A MockDataProvider is a database simulation that can intercept all database calls at the JDBC level val p: MockDataProvider = c => Array[MockResult]( if (c.sql.contains("select")) - new MockResult(ctx.newRecord(ACTOR).values(1L, "A", "A", null)) + new MockResult(ctx.newRecord(ACTOR) + .`with`(ACTOR.ACTOR_ID, java.lang.Long.valueOf(1L)) + .`with`(ACTOR.FIRST_NAME, "A") + .`with`(ACTOR.LAST_NAME, "A")) else new MockResult(0) ) diff --git a/jOOQ-demo-oss/jOOQ-demo-utils/pom.xml b/jOOQ-demo-oss/jOOQ-demo-utils/pom.xml index a536f15..815ec59 100644 --- a/jOOQ-demo-oss/jOOQ-demo-utils/pom.xml +++ b/jOOQ-demo-oss/jOOQ-demo-utils/pom.xml @@ -6,7 +6,7 @@ org.jooq jooq-demo - 3.18.7 + 3.19.1 jooq-demo-utils diff --git a/jOOQ-demo-oss/pom.xml b/jOOQ-demo-oss/pom.xml index 5e19dc1..7fd404b 100644 --- a/jOOQ-demo-oss/pom.xml +++ b/jOOQ-demo-oss/pom.xml @@ -5,7 +5,7 @@ org.jooq jooq-demo - 3.18.7 + 3.19.1 jOOQ Demo (Open Source Edition) pom @@ -20,7 +20,7 @@ UTF-8 - 3.18.7 + 3.19.1 8.5.11 42.4.3 2.17.1 diff --git a/jOOQ-demo-pro/jOOQ-demo-java/pom.xml b/jOOQ-demo-pro/jOOQ-demo-java/pom.xml index 5c6a2a3..352f6de 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/pom.xml +++ b/jOOQ-demo-pro/jOOQ-demo-java/pom.xml @@ -6,7 +6,7 @@ org.jooq.trial jooq-demo - 3.18.7 + 3.19.1 jooq-demo-java diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java index 4aebebe..ed66269 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/DefaultCatalog.java @@ -15,7 +15,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class DefaultCatalog extends CatalogImpl { private static final long serialVersionUID = 1L; @@ -45,10 +45,10 @@ public final List getSchemas() { } /** - * A reference to the 3.18 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.18. You can turn off the generation of this reference + * release, namely: 3.19. You can turn off the generation of this reference * by specifying /configuration/generator/generate/jooqVersionReference */ - private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18; + private static final String REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19; } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Domains.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Domains.java index 104398d..8e39698 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Domains.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Domains.java @@ -15,7 +15,7 @@ /** * Convenience access to all Domains in public. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Domains { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Indexes.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Indexes.java index 1f90555..942e509 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Indexes.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Indexes.java @@ -29,7 +29,7 @@ /** * A class modelling indexes of tables in public. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Indexes { // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Keys.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Keys.java index eac2d20..b025cfb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Keys.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Keys.java @@ -57,7 +57,7 @@ * A class modelling foreign key relationships and constraints of tables in * public. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Keys { // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Public.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Public.java index c649e94..3f93100 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Public.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Public.java @@ -14,6 +14,7 @@ import org.jooq.Field; import org.jooq.Result; import org.jooq.Table; +import org.jooq.Trigger; import org.jooq.demo.java.db.tables.Actor; import org.jooq.demo.java.db.tables.ActorInfo; import org.jooq.demo.java.db.tables.Address; @@ -54,10 +55,9 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Public extends SchemaImpl { - // Test (should be removed) private static final long serialVersionUID = 1L; /** @@ -360,6 +360,14 @@ public final List> getDomains() { ); } + @Override + public final List getTriggers() { + return Arrays.asList( + Triggers.FILM_FULLTEXT_TRIGGER, + Triggers.LAST_UPDATED + ); + } + @Override public final List> getTables() { return Arrays.asList( diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Routines.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Routines.java index 916a94e..6a63de4 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Routines.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Routines.java @@ -29,7 +29,7 @@ /** * Convenience access to all stored procedures and functions in public. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Routines { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Tables.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Tables.java index c2a3657..42840fe 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Tables.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Tables.java @@ -48,7 +48,7 @@ /** * Convenience access to all tables in public. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Tables { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Triggers.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Triggers.java new file mode 100644 index 0000000..26de58c --- /dev/null +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/Triggers.java @@ -0,0 +1,35 @@ +/* + * This file is generated by jOOQ. + */ +package org.jooq.demo.java.db; + + +import java.util.Arrays; +import java.util.EnumSet; + +import org.jooq.Trigger; +import org.jooq.TriggerEvent; +import org.jooq.TriggerExecution; +import org.jooq.TriggerTime; +import org.jooq.demo.java.db.tables.Actor; +import org.jooq.demo.java.db.tables.Film; +import org.jooq.impl.DSL; +import org.jooq.impl.Internal; + + +/** + * Convenience access to all triggers in public. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class Triggers { + + /** + * The trigger public.film_fulltext_trigger + */ + public static final Trigger FILM_FULLTEXT_TRIGGER = Internal.createTrigger(Public.PUBLIC, Film.FILM, Arrays.asList(), DSL.name("film_fulltext_trigger"), DSL.comment(""), TriggerTime.BEFORE, EnumSet.of(TriggerEvent.INSERT, TriggerEvent.UPDATE), TriggerExecution.FOR_EACH_ROW, null, 1, DSL.statement("EXECUTE FUNCTION tsvector_update_trigger('fulltext', 'pg_catalog.english', 'title', 'description')")); + + /** + * The trigger public.last_updated + */ + public static final Trigger LAST_UPDATED = Internal.createTrigger(Public.PUBLIC, Actor.ACTOR, Arrays.asList(), DSL.name("last_updated"), DSL.comment(""), TriggerTime.BEFORE, EnumSet.of(TriggerEvent.UPDATE), TriggerExecution.FOR_EACH_ROW, null, 1, DSL.statement("EXECUTE FUNCTION last_updated()")); +} diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java index 0e9aa1c..68e6551 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/enums/MpaaRating.java @@ -13,7 +13,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public enum MpaaRating implements EnumType { G("G"), @@ -53,7 +53,9 @@ public String getLiteral() { } /** - * Lookup a value of this EnumType by its literal + * Lookup a value of this EnumType by its literal. Returns + * null, if no such value could be found, see {@link + * EnumType#lookupLiteral(Class, String)}. */ public static MpaaRating lookupLiteral(String literal) { return EnumType.lookupLiteral(MpaaRating.class, literal); diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GetCustomerBalance.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GetCustomerBalance.java index f3ab1fc..536e620 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GetCustomerBalance.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GetCustomerBalance.java @@ -18,7 +18,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class GetCustomerBalance extends AbstractRoutine { private static final long serialVersionUID = 1L; diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GroupConcat.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GroupConcat.java index 322d133..a245704 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GroupConcat.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/GroupConcat.java @@ -15,7 +15,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class GroupConcat extends AbstractRoutine { private static final long serialVersionUID = 1L; diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryHeldByCustomer.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryHeldByCustomer.java index f3bc8c7..2b90c63 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryHeldByCustomer.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryHeldByCustomer.java @@ -15,7 +15,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class InventoryHeldByCustomer extends AbstractRoutine { private static final long serialVersionUID = 1L; diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryInStock.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryInStock.java index 92dc9ed..be361e2 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryInStock.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/InventoryInStock.java @@ -15,7 +15,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class InventoryInStock extends AbstractRoutine { private static final long serialVersionUID = 1L; diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/LastDay.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/LastDay.java index 9ad7599..29b3907 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/LastDay.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/LastDay.java @@ -18,7 +18,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class LastDay extends AbstractRoutine { private static final long serialVersionUID = 1L; diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/_GroupConcat.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/_GroupConcat.java index 28cfa72..9a39c7a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/_GroupConcat.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/routines/_GroupConcat.java @@ -15,7 +15,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class _GroupConcat extends AbstractRoutine { private static final long serialVersionUID = 1L; diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java index bba2f2b..667f9e9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Actor.java @@ -6,27 +6,35 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; +import org.jooq.Trigger; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.Triggers; +import org.jooq.demo.java.db.tables.Film.FilmPath; +import org.jooq.demo.java.db.tables.FilmActor.FilmActorPath; import org.jooq.demo.java.db.tables.records.ActorRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -36,7 +44,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Actor extends TableImpl { private static final long serialVersionUID = 1L; @@ -75,11 +83,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Actor(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Actor(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Actor(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +111,35 @@ public Actor() { this(DSL.name("actor"), null); } - public Actor(Table child, ForeignKey key) { - super(child, key, ACTOR); + public Actor(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, ACTOR); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class ActorPath extends Actor implements Path { + public ActorPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private ActorPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public ActorPath as(String alias) { + return new ActorPath(DSL.name(alias), this); + } + + @Override + public ActorPath as(Name alias) { + return new ActorPath(alias, this); + } + + @Override + public ActorPath as(Table alias) { + return new ActorPath(alias.getQualifiedName(), this); + } } @Override @@ -127,6 +162,32 @@ public UniqueKey getPrimaryKey() { return Keys.ACTOR_PKEY; } + private transient FilmActorPath _filmActor; + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + public FilmActorPath filmActor() { + if (_filmActor == null) + _filmActor = new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY.getInverseKey()); + + return _filmActor; + } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + public FilmPath film() { + return filmActor().film(); + } + + @Override + public List getTriggers() { + return Arrays.asList(Triggers.LAST_UPDATED); + } + @Override public Actor as(String alias) { return new Actor(DSL.name(alias), this); @@ -166,27 +227,87 @@ public Actor rename(Table name) { return new Actor(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Actor where(Condition condition) { + return new Actor(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + public Actor where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public Actor where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Actor where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Actor where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Actor where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Actor where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Actor where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Actor whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Actor whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java index 9456478..21799dc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/ActorInfo.java @@ -4,17 +4,17 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function4; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,7 +28,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class ActorInfo extends TableImpl { private static final long serialVersionUID = 1L; @@ -67,10 +67,10 @@ public Class getRecordType() { public final TableField FILM_INFO = createField(DSL.name("film_info"), SQLDataType.CLOB, this, ""); private ActorInfo(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private ActorInfo(Name alias, Table aliased, Field[] parameters) { + private ActorInfo(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "actor_info" as SELECT a.actor_id, a.first_name, @@ -86,7 +86,7 @@ LEFT JOIN film_actor fa ON ((a.actor_id = fa.actor_id))) LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name; - """)); + """), where); } /** @@ -110,10 +110,6 @@ public ActorInfo() { this(DSL.name("actor_info"), null); } - public ActorInfo(Table child, ForeignKey key) { - super(child, key, ACTOR_INFO); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -158,27 +154,87 @@ public ActorInfo rename(Table name) { return new ActorInfo(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Condition condition) { + return new ActorInfo(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public ActorInfo where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ActorInfo where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ActorInfo where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public ActorInfo where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + @PlainSQL + public ActorInfo where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public ActorInfo whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public ActorInfo whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java index 799f797..e29550e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Address.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function8; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,10 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.City.CityPath; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.AddressRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -36,7 +44,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Address extends TableImpl { private static final long serialVersionUID = 1L; @@ -95,11 +103,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Address(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Address(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Address(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -123,8 +131,35 @@ public Address() { this(DSL.name("address"), null); } - public Address(Table child, ForeignKey key) { - super(child, key, ADDRESS); + public Address(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, ADDRESS); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class AddressPath extends Address implements Path { + public AddressPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private AddressPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public AddressPath as(String alias) { + return new AddressPath(DSL.name(alias), this); + } + + @Override + public AddressPath as(Name alias) { + return new AddressPath(alias, this); + } + + @Override + public AddressPath as(Table alias) { + return new AddressPath(alias.getQualifiedName(), this); + } } @Override @@ -152,18 +187,55 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.ADDRESS__ADDRESS_CITY_ID_FKEY); } - private transient City _city; + private transient CityPath _city; /** * Get the implicit join path to the public.city table. */ - public City city() { + public CityPath city() { if (_city == null) - _city = new City(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY); + _city = new CityPath(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY, null); return _city; } + private transient CustomerPath _customer; + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + public CustomerPath customer() { + if (_customer == null) + _customer = new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY.getInverseKey()); + + return _customer; + } + + private transient StaffPath _staff; + + /** + * Get the implicit to-many join path to the public.staff table + */ + public StaffPath staff() { + if (_staff == null) + _staff = new StaffPath(this, null, Keys.STAFF__STAFF_ADDRESS_ID_FKEY.getInverseKey()); + + return _staff; + } + + private transient StorePath _store; + + /** + * Get the implicit to-many join path to the public.store table + */ + public StorePath store() { + if (_store == null) + _store = new StorePath(this, null, Keys.STORE__STORE_ADDRESS_ID_FKEY.getInverseKey()); + + return _store; + } + @Override public Address as(String alias) { return new Address(DSL.name(alias), this); @@ -203,27 +275,87 @@ public Address rename(Table name) { return new Address(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Condition condition) { + return new Address(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Address where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Address where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public Address where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Address where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Address whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Address whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java index 03f773f..c9a141c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Category.java @@ -5,24 +5,30 @@ import java.time.LocalDateTime; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; +import org.jooq.demo.java.db.tables.FilmCategory.FilmCategoryPath; import org.jooq.demo.java.db.tables.records.CategoryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -32,7 +38,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Category extends TableImpl { private static final long serialVersionUID = 1L; @@ -66,11 +72,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Category(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Category(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Category(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -94,8 +100,35 @@ public Category() { this(DSL.name("category"), null); } - public Category(Table child, ForeignKey key) { - super(child, key, CATEGORY); + public Category(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, CATEGORY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CategoryPath extends Category implements Path { + public CategoryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CategoryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CategoryPath as(String alias) { + return new CategoryPath(DSL.name(alias), this); + } + + @Override + public CategoryPath as(Name alias) { + return new CategoryPath(alias, this); + } + + @Override + public CategoryPath as(Table alias) { + return new CategoryPath(alias.getQualifiedName(), this); + } } @Override @@ -113,6 +146,27 @@ public UniqueKey getPrimaryKey() { return Keys.CATEGORY_PKEY; } + private transient FilmCategoryPath _filmCategory; + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + public FilmCategoryPath filmCategory() { + if (_filmCategory == null) + _filmCategory = new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY.getInverseKey()); + + return _filmCategory; + } + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + public FilmPath film() { + return filmCategory().film(); + } + @Override public Category as(String alias) { return new Category(DSL.name(alias), this); @@ -152,27 +206,87 @@ public Category rename(Table name) { return new Category(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Category where(Condition condition) { + return new Category(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Category where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public Category where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Category where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Category where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Category whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Category whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java index 86271dc..a9faf6c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/City.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,8 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Country.CountryPath; import org.jooq.demo.java.db.tables.records.CityRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -36,7 +42,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class City extends TableImpl { private static final long serialVersionUID = 1L; @@ -75,11 +81,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private City(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private City(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private City(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +109,35 @@ public City() { this(DSL.name("city"), null); } - public City(Table child, ForeignKey key) { - super(child, key, CITY); + public City(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, CITY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CityPath extends City implements Path { + public CityPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CityPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CityPath as(String alias) { + return new CityPath(DSL.name(alias), this); + } + + @Override + public CityPath as(Name alias) { + return new CityPath(alias, this); + } + + @Override + public CityPath as(Table alias) { + return new CityPath(alias.getQualifiedName(), this); + } } @Override @@ -132,18 +165,31 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.CITY__CITY_COUNTRY_ID_FKEY); } - private transient Country _country; + private transient CountryPath _country; /** * Get the implicit join path to the public.country table. */ - public Country country() { + public CountryPath country() { if (_country == null) - _country = new Country(this, Keys.CITY__CITY_COUNTRY_ID_FKEY); + _country = new CountryPath(this, Keys.CITY__CITY_COUNTRY_ID_FKEY, null); return _country; } + private transient AddressPath _address; + + /** + * Get the implicit to-many join path to the public.address + * table + */ + public AddressPath address() { + if (_address == null) + _address = new AddressPath(this, null, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY.getInverseKey()); + + return _address; + } + @Override public City as(String alias) { return new City(DSL.name(alias), this); @@ -183,27 +229,87 @@ public City rename(Table name) { return new City(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public City where(Condition condition) { + return new City(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public City where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public City where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public City where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public City where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public City where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public City where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + @PlainSQL + public City where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public City whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public City whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java index 108513f..5db3a27 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Country.java @@ -5,24 +5,29 @@ import java.time.LocalDateTime; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.City.CityPath; import org.jooq.demo.java.db.tables.records.CountryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -32,7 +37,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Country extends TableImpl { private static final long serialVersionUID = 1L; @@ -66,11 +71,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Country(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Country(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Country(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -94,8 +99,35 @@ public Country() { this(DSL.name("country"), null); } - public Country(Table child, ForeignKey key) { - super(child, key, COUNTRY); + public Country(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, COUNTRY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CountryPath extends Country implements Path { + public CountryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CountryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CountryPath as(String alias) { + return new CountryPath(DSL.name(alias), this); + } + + @Override + public CountryPath as(Name alias) { + return new CountryPath(alias, this); + } + + @Override + public CountryPath as(Table alias) { + return new CountryPath(alias.getQualifiedName(), this); + } } @Override @@ -113,6 +145,18 @@ public UniqueKey getPrimaryKey() { return Keys.COUNTRY_PKEY; } + private transient CityPath _city; + + /** + * Get the implicit to-many join path to the public.city table + */ + public CityPath city() { + if (_city == null) + _city = new CityPath(this, null, Keys.CITY__CITY_COUNTRY_ID_FKEY.getInverseKey()); + + return _city; + } + @Override public Country as(String alias) { return new Country(DSL.name(alias), this); @@ -152,27 +196,87 @@ public Country rename(Table name) { return new Country(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Country where(Condition condition) { + return new Country(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Country where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public Country where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Country where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Country where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Country whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Country whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java index 2f6bd77..f3a3993 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Customer.java @@ -7,20 +7,24 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function10; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row10; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,6 +32,16 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Payment.PaymentPath; +import org.jooq.demo.java.db.tables.PaymentP2007_01.PaymentP2007_01Path; +import org.jooq.demo.java.db.tables.PaymentP2007_02.PaymentP2007_02Path; +import org.jooq.demo.java.db.tables.PaymentP2007_03.PaymentP2007_03Path; +import org.jooq.demo.java.db.tables.PaymentP2007_04.PaymentP2007_04Path; +import org.jooq.demo.java.db.tables.PaymentP2007_05.PaymentP2007_05Path; +import org.jooq.demo.java.db.tables.PaymentP2007_06.PaymentP2007_06Path; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.CustomerRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -37,7 +51,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Customer extends TableImpl { private static final long serialVersionUID = 1L; @@ -106,11 +120,11 @@ public Class getRecordType() { public final TableField ACTIVE = createField(DSL.name("active"), SQLDataType.INTEGER, this, ""); private Customer(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Customer(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Customer(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -134,8 +148,35 @@ public Customer() { this(DSL.name("customer"), null); } - public Customer(Table child, ForeignKey key) { - super(child, key, CUSTOMER); + public Customer(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, CUSTOMER); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class CustomerPath extends Customer implements Path { + public CustomerPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private CustomerPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public CustomerPath as(String alias) { + return new CustomerPath(DSL.name(alias), this); + } + + @Override + public CustomerPath as(Name alias) { + return new CustomerPath(alias, this); + } + + @Override + public CustomerPath as(Table alias) { + return new CustomerPath(alias.getQualifiedName(), this); + } } @Override @@ -163,29 +204,134 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY); } - private transient Store _store; - private transient Address _address; + private transient StorePath _store; /** * Get the implicit join path to the public.store table. */ - public Store store() { + public StorePath store() { if (_store == null) - _store = new Store(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY); + _store = new StorePath(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY, null); return _store; } + private transient AddressPath _address; + /** * Get the implicit join path to the public.address table. */ - public Address address() { + public AddressPath address() { if (_address == null) - _address = new Address(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY); + _address = new AddressPath(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null); return _address; } + private transient PaymentPath _payment; + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + public PaymentPath payment() { + if (_payment == null) + _payment = new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY.getInverseKey()); + + return _payment; + } + + private transient PaymentP2007_01Path _paymentP2007_01; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + public PaymentP2007_01Path paymentP2007_01() { + if (_paymentP2007_01 == null) + _paymentP2007_01 = new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_01; + } + + private transient PaymentP2007_02Path _paymentP2007_02; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + public PaymentP2007_02Path paymentP2007_02() { + if (_paymentP2007_02 == null) + _paymentP2007_02 = new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_02; + } + + private transient PaymentP2007_03Path _paymentP2007_03; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + public PaymentP2007_03Path paymentP2007_03() { + if (_paymentP2007_03 == null) + _paymentP2007_03 = new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_03; + } + + private transient PaymentP2007_04Path _paymentP2007_04; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + public PaymentP2007_04Path paymentP2007_04() { + if (_paymentP2007_04 == null) + _paymentP2007_04 = new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_04; + } + + private transient PaymentP2007_05Path _paymentP2007_05; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + public PaymentP2007_05Path paymentP2007_05() { + if (_paymentP2007_05 == null) + _paymentP2007_05 = new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_05; + } + + private transient PaymentP2007_06Path _paymentP2007_06; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + public PaymentP2007_06Path paymentP2007_06() { + if (_paymentP2007_06 == null) + _paymentP2007_06 = new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY.getInverseKey()); + + return _paymentP2007_06; + } + + private transient RentalPath _rental; + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + public RentalPath rental() { + if (_rental == null) + _rental = new RentalPath(this, null, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY.getInverseKey()); + + return _rental; + } + @Override public Customer as(String alias) { return new Customer(DSL.name(alias), this); @@ -225,27 +371,87 @@ public Customer rename(Table name) { return new Customer(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Customer where(Condition condition) { + return new Customer(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); + public Customer where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function10 from) { - return convertFrom(Records.mapping(from)); + @Override + public Customer where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function10 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Customer where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Customer where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Customer whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Customer whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java index 01bf60a..7bbc685 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/CustomerList.java @@ -4,17 +4,17 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function9; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row9; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,7 +28,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class CustomerList extends TableImpl { private static final long serialVersionUID = 1L; @@ -92,10 +92,10 @@ public Class getRecordType() { public final TableField SID = createField(DSL.name("sid"), SQLDataType.BIGINT, this, ""); private CustomerList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private CustomerList(Name alias, Table aliased, Field[] parameters) { + private CustomerList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "customer_list" as SELECT cu.customer_id AS id, (((cu.first_name)::text || ' '::text) || (cu.last_name)::text) AS name, @@ -113,7 +113,7 @@ private CustomerList(Name alias, Table aliased, Field[] p JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """)); + """), where); } /** @@ -137,10 +137,6 @@ public CustomerList() { this(DSL.name("customer_list"), null); } - public CustomerList(Table child, ForeignKey key) { - super(child, key, CUSTOMER_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -185,27 +181,87 @@ public CustomerList rename(Table name) { return new CustomerList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Condition condition) { + return new CustomerList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public CustomerList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public CustomerList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public CustomerList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public CustomerList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); + @PlainSQL + public CustomerList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function9 from) { - return convertFrom(Records.mapping(from)); + @Override + public CustomerList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function9 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public CustomerList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java index 321cc97..a0d1174 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Film.java @@ -7,30 +7,44 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function14; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row14; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; +import org.jooq.Trigger; import org.jooq.UniqueKey; +import org.jooq.demo.java.db.Domains; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.Triggers; import org.jooq.demo.java.db.enums.MpaaRating; +import org.jooq.demo.java.db.tables.Actor.ActorPath; +import org.jooq.demo.java.db.tables.Category.CategoryPath; +import org.jooq.demo.java.db.tables.FilmActor.FilmActorPath; +import org.jooq.demo.java.db.tables.FilmCategory.FilmCategoryPath; +import org.jooq.demo.java.db.tables.Inventory.InventoryPath; +import org.jooq.demo.java.db.tables.Language.LanguagePath; import org.jooq.demo.java.db.tables.records.FilmRecord; import org.jooq.impl.DSL; +import org.jooq.impl.DefaultDataType; import org.jooq.impl.SQLDataType; import org.jooq.impl.TableImpl; @@ -38,7 +52,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Film extends TableImpl { private static final long serialVersionUID = 1L; @@ -74,7 +88,7 @@ public Class getRecordType() { /** * The column public.film.release_year. */ - public final TableField RELEASE_YEAR = createField(DSL.name("release_year"), org.jooq.demo.java.db.Domains.YEAR.getDataType(), this, ""); + public final TableField RELEASE_YEAR = createField(DSL.name("release_year"), Domains.YEAR.getDataType(), this, ""); /** * The column public.film.language_id. @@ -109,7 +123,7 @@ public Class getRecordType() { /** * The column public.film.rating. */ - public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(org.jooq.demo.java.db.enums.MpaaRating.class), this, ""); + public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(MpaaRating.class), this, ""); /** * The column public.film.last_update. @@ -130,14 +144,14 @@ public Class getRecordType() { * configuration. */ @Deprecated - public final TableField FULLTEXT = createField(DSL.name("fulltext"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, ""); + public final TableField FULLTEXT = createField(DSL.name("fulltext"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, ""); private Film(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Film(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Film(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -161,8 +175,35 @@ public Film() { this(DSL.name("film"), null); } - public Film(Table child, ForeignKey key) { - super(child, key, FILM); + public Film(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, FILM); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class FilmPath extends Film implements Path { + public FilmPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private FilmPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public FilmPath as(String alias) { + return new FilmPath(DSL.name(alias), this); + } + + @Override + public FilmPath as(Name alias) { + return new FilmPath(alias, this); + } + + @Override + public FilmPath as(Table alias) { + return new FilmPath(alias.getQualifiedName(), this); + } } @Override @@ -190,31 +231,92 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.FILM__FILM_LANGUAGE_ID_FKEY, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY); } - private transient Language _filmLanguageIdFkey; - private transient Language _filmOriginalLanguageIdFkey; + private transient LanguagePath _filmLanguageIdFkey; /** * Get the implicit join path to the public.language table, via * the film_language_id_fkey key. */ - public Language filmLanguageIdFkey() { + public LanguagePath filmLanguageIdFkey() { if (_filmLanguageIdFkey == null) - _filmLanguageIdFkey = new Language(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY); + _filmLanguageIdFkey = new LanguagePath(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY, null); return _filmLanguageIdFkey; } + private transient LanguagePath _filmOriginalLanguageIdFkey; + /** * Get the implicit join path to the public.language table, via * the film_original_language_id_fkey key. */ - public Language filmOriginalLanguageIdFkey() { + public LanguagePath filmOriginalLanguageIdFkey() { if (_filmOriginalLanguageIdFkey == null) - _filmOriginalLanguageIdFkey = new Language(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY); + _filmOriginalLanguageIdFkey = new LanguagePath(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null); return _filmOriginalLanguageIdFkey; } + private transient FilmActorPath _filmActor; + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + public FilmActorPath filmActor() { + if (_filmActor == null) + _filmActor = new FilmActorPath(this, null, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY.getInverseKey()); + + return _filmActor; + } + + private transient FilmCategoryPath _filmCategory; + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + public FilmCategoryPath filmCategory() { + if (_filmCategory == null) + _filmCategory = new FilmCategoryPath(this, null, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY.getInverseKey()); + + return _filmCategory; + } + + private transient InventoryPath _inventory; + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + public InventoryPath inventory() { + if (_inventory == null) + _inventory = new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY.getInverseKey()); + + return _inventory; + } + + /** + * Get the implicit many-to-many join path to the public.actor + * table + */ + public ActorPath actor() { + return filmActor().actor(); + } + + /** + * Get the implicit many-to-many join path to the + * public.category table + */ + public CategoryPath category() { + return filmCategory().category(); + } + + @Override + public List getTriggers() { + return Arrays.asList(Triggers.FILM_FULLTEXT_TRIGGER); + } + @Override public Film as(String alias) { return new Film(DSL.name(alias), this); @@ -254,27 +356,87 @@ public Film rename(Table name) { return new Film(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row14 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Condition condition) { + return new Film(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Film where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Film where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row14 fieldsRow() { - return (Row14) super.fieldsRow(); + @PlainSQL + public Film where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function14 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Film where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function14 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Film whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Film whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java index 0e653d9..33602aa 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmActor.java @@ -6,19 +6,23 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Index; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -26,6 +30,8 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Actor.ActorPath; +import org.jooq.demo.java.db.tables.Film.FilmPath; import org.jooq.demo.java.db.tables.records.FilmActorRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -35,7 +41,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmActor extends TableImpl { private static final long serialVersionUID = 1L; @@ -69,11 +75,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private FilmActor(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private FilmActor(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private FilmActor(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -97,8 +103,35 @@ public FilmActor() { this(DSL.name("film_actor"), null); } - public FilmActor(Table child, ForeignKey key) { - super(child, key, FILM_ACTOR); + public FilmActor(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, FILM_ACTOR); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class FilmActorPath extends FilmActor implements Path { + public FilmActorPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private FilmActorPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public FilmActorPath as(String alias) { + return new FilmActorPath(DSL.name(alias), this); + } + + @Override + public FilmActorPath as(Name alias) { + return new FilmActorPath(alias, this); + } + + @Override + public FilmActorPath as(Table alias) { + return new FilmActorPath(alias.getQualifiedName(), this); + } } @Override @@ -121,25 +154,26 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY); } - private transient Actor _actor; - private transient Film _film; + private transient ActorPath _actor; /** * Get the implicit join path to the public.actor table. */ - public Actor actor() { + public ActorPath actor() { if (_actor == null) - _actor = new Actor(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY); + _actor = new ActorPath(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, null); return _actor; } + private transient FilmPath _film; + /** * Get the implicit join path to the public.film table. */ - public Film film() { + public FilmPath film() { if (_film == null) - _film = new Film(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY); + _film = new FilmPath(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY, null); return _film; } @@ -183,27 +217,87 @@ public FilmActor rename(Table name) { return new FilmActor(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor where(Condition condition) { + return new FilmActor(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor where(Condition... conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public FilmActor where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public FilmActor where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public FilmActor where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmActor where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmActor where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmActor whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java index d9f550a..82b8d12 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmCategory.java @@ -6,24 +6,30 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Category.CategoryPath; +import org.jooq.demo.java.db.tables.Film.FilmPath; import org.jooq.demo.java.db.tables.records.FilmCategoryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -33,7 +39,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmCategory extends TableImpl { private static final long serialVersionUID = 1L; @@ -67,11 +73,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private FilmCategory(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private FilmCategory(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private FilmCategory(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -95,8 +101,35 @@ public FilmCategory() { this(DSL.name("film_category"), null); } - public FilmCategory(Table child, ForeignKey key) { - super(child, key, FILM_CATEGORY); + public FilmCategory(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, FILM_CATEGORY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class FilmCategoryPath extends FilmCategory implements Path { + public FilmCategoryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private FilmCategoryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public FilmCategoryPath as(String alias) { + return new FilmCategoryPath(DSL.name(alias), this); + } + + @Override + public FilmCategoryPath as(Name alias) { + return new FilmCategoryPath(alias, this); + } + + @Override + public FilmCategoryPath as(Table alias) { + return new FilmCategoryPath(alias.getQualifiedName(), this); + } } @Override @@ -114,25 +147,26 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY); } - private transient Film _film; - private transient Category _category; + private transient FilmPath _film; /** * Get the implicit join path to the public.film table. */ - public Film film() { + public FilmPath film() { if (_film == null) - _film = new Film(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY); + _film = new FilmPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, null); return _film; } + private transient CategoryPath _category; + /** * Get the implicit join path to the public.category table. */ - public Category category() { + public CategoryPath category() { if (_category == null) - _category = new Category(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY); + _category = new CategoryPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY, null); return _category; } @@ -176,27 +210,87 @@ public FilmCategory rename(Table name) { return new FilmCategory(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory where(Condition condition) { + return new FilmCategory(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory where(Condition... conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public FilmCategory where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public FilmCategory where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public FilmCategory where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmCategory where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmCategory where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmCategory whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java index 0f112c6..d26e4f0 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmInStock.java @@ -4,15 +4,10 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; - +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.Function1; import org.jooq.Name; -import org.jooq.Records; -import org.jooq.Row1; import org.jooq.Schema; -import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -26,7 +21,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmInStock extends TableImpl { private static final long serialVersionUID = 1L; @@ -57,7 +52,11 @@ private FilmInStock(Name alias, Table aliased) { } private FilmInStock(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + this(alias, aliased, parameters, null); + } + + private FilmInStock(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); } /** @@ -125,15 +124,6 @@ public FilmInStock rename(Table name) { return new FilmInStock(name.getQualifiedName(), null, parameters); } - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - /** * Call this table-valued function */ @@ -163,19 +153,4 @@ public FilmInStock call( return aliased() ? result.as(getUnqualifiedName()) : result; } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - public SelectField mapping(Function1 from) { - return convertFrom(Records.mapping(from)); - } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - public SelectField mapping(Class toType, Function1 from) { - return convertFrom(toType, Records.mapping(from)); - } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java index a1515aa..d6721c4 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmList.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function8; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -30,7 +30,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmList extends TableImpl { private static final long serialVersionUID = 1L; @@ -81,7 +81,7 @@ public Class getRecordType() { /** * The column public.film_list.rating. */ - public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.java.db.enums.MpaaRating.class), this, ""); + public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating.class), this, ""); /** * The column public.film_list.actors. @@ -89,10 +89,10 @@ public Class getRecordType() { public final TableField ACTORS = createField(DSL.name("actors"), SQLDataType.CLOB, this, ""); private FilmList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private FilmList(Name alias, Table aliased, Field[] parameters) { + private FilmList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "film_list" as SELECT film.film_id AS fid, film.title, @@ -108,7 +108,7 @@ LEFT JOIN film ON ((film_category.film_id = film.film_id))) JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """)); + """), where); } /** @@ -132,10 +132,6 @@ public FilmList() { this(DSL.name("film_list"), null); } - public FilmList(Table child, ForeignKey key) { - super(child, key, FILM_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -180,27 +176,87 @@ public FilmList rename(Table name) { return new FilmList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Condition condition) { + return new FilmList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public FilmList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public FilmList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public FilmList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + public FilmList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public FilmList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java index 03c7b87..c10e519 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/FilmNotInStock.java @@ -4,15 +4,10 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; - +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.Function1; import org.jooq.Name; -import org.jooq.Records; -import org.jooq.Row1; import org.jooq.Schema; -import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -26,7 +21,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmNotInStock extends TableImpl { private static final long serialVersionUID = 1L; @@ -57,7 +52,11 @@ private FilmNotInStock(Name alias, Table aliased) { } private FilmNotInStock(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + this(alias, aliased, parameters, null); + } + + private FilmNotInStock(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); } /** @@ -125,15 +124,6 @@ public FilmNotInStock rename(Table name) { return new FilmNotInStock(name.getQualifiedName(), null, parameters); } - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - /** * Call this table-valued function */ @@ -163,19 +153,4 @@ public FilmNotInStock call( return aliased() ? result.as(getUnqualifiedName()) : result; } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - public SelectField mapping(Function1 from) { - return convertFrom(Records.mapping(from)); - } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - public SelectField mapping(Class toType, Function1 from) { - return convertFrom(toType, Records.mapping(from)); - } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java index 7026b06..beae44b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Inventory.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function4; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row4; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,9 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.InventoryRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -36,7 +43,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Inventory extends TableImpl { private static final long serialVersionUID = 1L; @@ -75,11 +82,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Inventory(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Inventory(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Inventory(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -103,8 +110,35 @@ public Inventory() { this(DSL.name("inventory"), null); } - public Inventory(Table child, ForeignKey key) { - super(child, key, INVENTORY); + public Inventory(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, INVENTORY); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class InventoryPath extends Inventory implements Path { + public InventoryPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private InventoryPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public InventoryPath as(String alias) { + return new InventoryPath(DSL.name(alias), this); + } + + @Override + public InventoryPath as(Name alias) { + return new InventoryPath(alias, this); + } + + @Override + public InventoryPath as(Table alias) { + return new InventoryPath(alias.getQualifiedName(), this); + } } @Override @@ -132,29 +166,43 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.INVENTORY__INVENTORY_FILM_ID_FKEY, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY); } - private transient Film _film; - private transient Store _store; + private transient FilmPath _film; /** * Get the implicit join path to the public.film table. */ - public Film film() { + public FilmPath film() { if (_film == null) - _film = new Film(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY); + _film = new FilmPath(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY, null); return _film; } + private transient StorePath _store; + /** * Get the implicit join path to the public.store table. */ - public Store store() { + public StorePath store() { if (_store == null) - _store = new Store(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY); + _store = new StorePath(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY, null); return _store; } + private transient RentalPath _rental; + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + public RentalPath rental() { + if (_rental == null) + _rental = new RentalPath(this, null, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY.getInverseKey()); + + return _rental; + } + @Override public Inventory as(String alias) { return new Inventory(DSL.name(alias), this); @@ -194,27 +242,87 @@ public Inventory rename(Table name) { return new Inventory(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Inventory where(Condition condition) { + return new Inventory(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Inventory where(Collection conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); + public Inventory where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function4 from) { - return convertFrom(Records.mapping(from)); + @Override + public Inventory where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function4 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public Inventory where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Inventory where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Inventory where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Inventory where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Inventory whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Inventory whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java index ceda3ee..a101dc5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Language.java @@ -5,24 +5,29 @@ import java.time.LocalDateTime; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Film.FilmPath; import org.jooq.demo.java.db.tables.records.LanguageRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -32,7 +37,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Language extends TableImpl { private static final long serialVersionUID = 1L; @@ -66,11 +71,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Language(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Language(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Language(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -94,8 +99,35 @@ public Language() { this(DSL.name("language"), null); } - public Language(Table child, ForeignKey key) { - super(child, key, LANGUAGE); + public Language(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, LANGUAGE); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class LanguagePath extends Language implements Path { + public LanguagePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private LanguagePath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public LanguagePath as(String alias) { + return new LanguagePath(DSL.name(alias), this); + } + + @Override + public LanguagePath as(Name alias) { + return new LanguagePath(alias, this); + } + + @Override + public LanguagePath as(Table alias) { + return new LanguagePath(alias.getQualifiedName(), this); + } } @Override @@ -113,6 +145,32 @@ public UniqueKey getPrimaryKey() { return Keys.LANGUAGE_PKEY; } + private transient FilmPath _filmLanguageIdFkey; + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_language_id_fkey key + */ + public FilmPath filmLanguageIdFkey() { + if (_filmLanguageIdFkey == null) + _filmLanguageIdFkey = new FilmPath(this, null, Keys.FILM__FILM_LANGUAGE_ID_FKEY.getInverseKey()); + + return _filmLanguageIdFkey; + } + + private transient FilmPath _filmOriginalLanguageIdFkey; + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_original_language_id_fkey key + */ + public FilmPath filmOriginalLanguageIdFkey() { + if (_filmOriginalLanguageIdFkey == null) + _filmOriginalLanguageIdFkey = new FilmPath(this, null, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY.getInverseKey()); + + return _filmOriginalLanguageIdFkey; + } + @Override public Language as(String alias) { return new Language(DSL.name(alias), this); @@ -152,27 +210,87 @@ public Language rename(Table name) { return new Language(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Language where(Condition condition) { + return new Language(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + public Language where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public Language where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Language where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Language where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Language whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Language whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java index f907732..fd9b865 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/NicerButSlowerFilmList.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function8; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -30,7 +30,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class NicerButSlowerFilmList extends TableImpl { private static final long serialVersionUID = 1L; @@ -81,7 +81,7 @@ public Class getRecordType() { /** * The column public.nicer_but_slower_film_list.rating. */ - public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.java.db.enums.MpaaRating.class), this, ""); + public final TableField RATING = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating.class), this, ""); /** * The column public.nicer_but_slower_film_list.actors. @@ -89,10 +89,10 @@ public Class getRecordType() { public final TableField ACTORS = createField(DSL.name("actors"), SQLDataType.CLOB, this, ""); private NicerButSlowerFilmList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private NicerButSlowerFilmList(Name alias, Table aliased, Field[] parameters) { + private NicerButSlowerFilmList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "nicer_but_slower_film_list" as SELECT film.film_id AS fid, film.title, @@ -108,7 +108,7 @@ LEFT JOIN film ON ((film_category.film_id = film.film_id))) JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """)); + """), where); } /** @@ -134,10 +134,6 @@ public NicerButSlowerFilmList() { this(DSL.name("nicer_but_slower_film_list"), null); } - public NicerButSlowerFilmList(Table child, ForeignKey key) { - super(child, key, NICER_BUT_SLOWER_FILM_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -182,27 +178,87 @@ public NicerButSlowerFilmList rename(Table name) { return new NicerButSlowerFilmList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Condition condition) { + return new NicerButSlowerFilmList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public NicerButSlowerFilmList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public NicerButSlowerFilmList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public NicerButSlowerFilmList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public NicerButSlowerFilmList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public NicerButSlowerFilmList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + public NicerButSlowerFilmList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public NicerButSlowerFilmList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java index ade203e..5b53284 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Payment.java @@ -7,20 +7,24 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,6 +32,9 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -37,7 +44,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Payment extends TableImpl { private static final long serialVersionUID = 1L; @@ -86,11 +93,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private Payment(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Payment(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Payment(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -114,8 +121,35 @@ public Payment() { this(DSL.name("payment"), null); } - public Payment(Table child, ForeignKey key) { - super(child, key, PAYMENT); + public Payment(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentPath extends Payment implements Path { + public PaymentPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentPath as(String alias) { + return new PaymentPath(DSL.name(alias), this); + } + + @Override + public PaymentPath as(Name alias) { + return new PaymentPath(alias, this); + } + + @Override + public PaymentPath as(Table alias) { + return new PaymentPath(alias.getQualifiedName(), this); + } } @Override @@ -143,36 +177,38 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY, null); return _rental; } @@ -216,27 +252,87 @@ public Payment rename(Table name) { return new Payment(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Condition condition) { + return new Payment(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Payment where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Payment where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Payment where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Payment where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public Payment where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public Payment whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Payment whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java index abfc9e4..f671637 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_01.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_01Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -38,7 +45,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentP2007_01 extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_01(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_01(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_01(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_01() { this(DSL.name("payment_p2007_01"), null); } - public PaymentP2007_01(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_01); + public PaymentP2007_01(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_01); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_01Path extends PaymentP2007_01 implements Path { + public PaymentP2007_01Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_01Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_01Path as(String alias) { + return new PaymentP2007_01Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_01Path as(Name alias) { + return new PaymentP2007_01Path(alias, this); + } + + @Override + public PaymentP2007_01Path as(Table alias) { + return new PaymentP2007_01Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_01 rename(Table name) { return new PaymentP2007_01(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Condition condition) { + return new PaymentP2007_01(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_01 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_01 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_01 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_01 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_01 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_01 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_01 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java index 8b895ee..f68f11f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_02.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_02Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -38,7 +45,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentP2007_02 extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_02(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_02(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_02(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_02() { this(DSL.name("payment_p2007_02"), null); } - public PaymentP2007_02(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_02); + public PaymentP2007_02(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_02); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_02Path extends PaymentP2007_02 implements Path { + public PaymentP2007_02Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_02Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_02Path as(String alias) { + return new PaymentP2007_02Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_02Path as(Name alias) { + return new PaymentP2007_02Path(alias, this); + } + + @Override + public PaymentP2007_02Path as(Table alias) { + return new PaymentP2007_02Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_02 rename(Table name) { return new PaymentP2007_02(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Condition condition) { + return new PaymentP2007_02(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_02 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_02 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_02 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_02 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_02 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_02 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_02 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java index 6db368b..2c3e0dc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_03.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_03Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -38,7 +45,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentP2007_03 extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_03(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_03(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_03(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_03() { this(DSL.name("payment_p2007_03"), null); } - public PaymentP2007_03(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_03); + public PaymentP2007_03(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_03); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_03Path extends PaymentP2007_03 implements Path { + public PaymentP2007_03Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_03Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_03Path as(String alias) { + return new PaymentP2007_03Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_03Path as(Name alias) { + return new PaymentP2007_03Path(alias, this); + } + + @Override + public PaymentP2007_03Path as(Table alias) { + return new PaymentP2007_03Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_03 rename(Table name) { return new PaymentP2007_03(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Condition condition) { + return new PaymentP2007_03(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_03 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_03 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_03 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_03 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_03 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_03 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_03 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java index 76e18f8..068c6cb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_04.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_04Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -38,7 +45,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentP2007_04 extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_04(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_04(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_04(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_04() { this(DSL.name("payment_p2007_04"), null); } - public PaymentP2007_04(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_04); + public PaymentP2007_04(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_04); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_04Path extends PaymentP2007_04 implements Path { + public PaymentP2007_04Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_04Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_04Path as(String alias) { + return new PaymentP2007_04Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_04Path as(Name alias) { + return new PaymentP2007_04Path(alias, this); + } + + @Override + public PaymentP2007_04Path as(Table alias) { + return new PaymentP2007_04Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_04 rename(Table name) { return new PaymentP2007_04(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Condition condition) { + return new PaymentP2007_04(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_04 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_04 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_04 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_04 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_04 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_04 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_04 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java index c0edacd..09fb199 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_05.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_05Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -38,7 +45,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentP2007_05 extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_05(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_05(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_05(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_05() { this(DSL.name("payment_p2007_05"), null); } - public PaymentP2007_05(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_05); + public PaymentP2007_05(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_05); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_05Path extends PaymentP2007_05 implements Path { + public PaymentP2007_05Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_05Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_05Path as(String alias) { + return new PaymentP2007_05Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_05Path as(Name alias) { + return new PaymentP2007_05Path(alias, this); + } + + @Override + public PaymentP2007_05Path as(Table alias) { + return new PaymentP2007_05Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_05 rename(Table name) { return new PaymentP2007_05(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Condition condition) { + return new PaymentP2007_05(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_05 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_05 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_05 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_05 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_05 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_05 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_05 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java index 512dcdd..7c9b51c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/PaymentP2007_06.java @@ -7,27 +7,34 @@ import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; import org.jooq.Check; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function6; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row6; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.PaymentP2007_06Record; import org.jooq.impl.DSL; import org.jooq.impl.Internal; @@ -38,7 +45,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentP2007_06 extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,11 +94,11 @@ public Class getRecordType() { public final TableField PAYMENT_DATE = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, ""); private PaymentP2007_06(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private PaymentP2007_06(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private PaymentP2007_06(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -115,8 +122,35 @@ public PaymentP2007_06() { this(DSL.name("payment_p2007_06"), null); } - public PaymentP2007_06(Table child, ForeignKey key) { - super(child, key, PAYMENT_P2007_06); + public PaymentP2007_06(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, PAYMENT_P2007_06); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class PaymentP2007_06Path extends PaymentP2007_06 implements Path { + public PaymentP2007_06Path(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private PaymentP2007_06Path(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public PaymentP2007_06Path as(String alias) { + return new PaymentP2007_06Path(DSL.name(alias), this); + } + + @Override + public PaymentP2007_06Path as(Name alias) { + return new PaymentP2007_06Path(alias, this); + } + + @Override + public PaymentP2007_06Path as(Table alias) { + return new PaymentP2007_06Path(alias.getQualifiedName(), this); + } } @Override @@ -139,36 +173,38 @@ public Identity getIdentity() { return Arrays.asList(Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY); } - private transient Customer _customer; - private transient Staff _staff; - private transient Rental _rental; + private transient CustomerPath _customer; /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, null); return _staff; } + private transient RentalPath _rental; + /** * Get the implicit join path to the public.rental table. */ - public Rental rental() { + public RentalPath rental() { if (_rental == null) - _rental = new Rental(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY); + _rental = new RentalPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY, null); return _rental; } @@ -219,27 +255,87 @@ public PaymentP2007_06 rename(Table name) { return new PaymentP2007_06(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Condition condition) { + return new PaymentP2007_06(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public PaymentP2007_06 where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_06 where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_06 where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public PaymentP2007_06 where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); + @PlainSQL + public PaymentP2007_06 where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function6 from) { - return convertFrom(Records.mapping(from)); + @Override + public PaymentP2007_06 whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function6 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public PaymentP2007_06 whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java index cc5386f..3c7fdbd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Rental.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function7; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row7; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,16 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Inventory.InventoryPath; +import org.jooq.demo.java.db.tables.Payment.PaymentPath; +import org.jooq.demo.java.db.tables.PaymentP2007_01.PaymentP2007_01Path; +import org.jooq.demo.java.db.tables.PaymentP2007_02.PaymentP2007_02Path; +import org.jooq.demo.java.db.tables.PaymentP2007_03.PaymentP2007_03Path; +import org.jooq.demo.java.db.tables.PaymentP2007_04.PaymentP2007_04Path; +import org.jooq.demo.java.db.tables.PaymentP2007_05.PaymentP2007_05Path; +import org.jooq.demo.java.db.tables.PaymentP2007_06.PaymentP2007_06Path; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.RentalRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -36,7 +50,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Rental extends TableImpl { private static final long serialVersionUID = 1L; @@ -90,11 +104,11 @@ public Class getRecordType() { public final TableField LAST_UPDATE = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, ""); private Rental(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Rental(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Rental(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -118,8 +132,35 @@ public Rental() { this(DSL.name("rental"), null); } - public Rental(Table child, ForeignKey key) { - super(child, key, RENTAL); + public Rental(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, RENTAL); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class RentalPath extends Rental implements Path { + public RentalPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private RentalPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public RentalPath as(String alias) { + return new RentalPath(DSL.name(alias), this); + } + + @Override + public RentalPath as(Name alias) { + return new RentalPath(alias, this); + } + + @Override + public RentalPath as(Table alias) { + return new RentalPath(alias.getQualifiedName(), this); + } } @Override @@ -147,40 +188,133 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY, Keys.RENTAL__RENTAL_STAFF_ID_FKEY); } - private transient Inventory _inventory; - private transient Customer _customer; - private transient Staff _staff; + private transient InventoryPath _inventory; /** * Get the implicit join path to the public.inventory table. */ - public Inventory inventory() { + public InventoryPath inventory() { if (_inventory == null) - _inventory = new Inventory(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY); + _inventory = new InventoryPath(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY, null); return _inventory; } + private transient CustomerPath _customer; + /** * Get the implicit join path to the public.customer table. */ - public Customer customer() { + public CustomerPath customer() { if (_customer == null) - _customer = new Customer(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY); + _customer = new CustomerPath(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY, null); return _customer; } + private transient StaffPath _staff; + /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY, null); return _staff; } + private transient PaymentPath _payment; + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + public PaymentPath payment() { + if (_payment == null) + _payment = new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY.getInverseKey()); + + return _payment; + } + + private transient PaymentP2007_01Path _paymentP2007_01; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + public PaymentP2007_01Path paymentP2007_01() { + if (_paymentP2007_01 == null) + _paymentP2007_01 = new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_01; + } + + private transient PaymentP2007_02Path _paymentP2007_02; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + public PaymentP2007_02Path paymentP2007_02() { + if (_paymentP2007_02 == null) + _paymentP2007_02 = new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_02; + } + + private transient PaymentP2007_03Path _paymentP2007_03; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + public PaymentP2007_03Path paymentP2007_03() { + if (_paymentP2007_03 == null) + _paymentP2007_03 = new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_03; + } + + private transient PaymentP2007_04Path _paymentP2007_04; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + public PaymentP2007_04Path paymentP2007_04() { + if (_paymentP2007_04 == null) + _paymentP2007_04 = new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_04; + } + + private transient PaymentP2007_05Path _paymentP2007_05; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + public PaymentP2007_05Path paymentP2007_05() { + if (_paymentP2007_05 == null) + _paymentP2007_05 = new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_05; + } + + private transient PaymentP2007_06Path _paymentP2007_06; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + public PaymentP2007_06Path paymentP2007_06() { + if (_paymentP2007_06 == null) + _paymentP2007_06 = new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY.getInverseKey()); + + return _paymentP2007_06; + } + @Override public Rental as(String alias) { return new Rental(DSL.name(alias), this); @@ -220,27 +354,87 @@ public Rental rename(Table name) { return new Rental(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Rental where(Condition condition) { + return new Rental(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental where(Condition... conditions) { + return where(DSL.and(conditions)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); + public Rental where(Field condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function7 from) { - return convertFrom(Records.mapping(from)); + @Override + @PlainSQL + public Rental where(SQL condition) { + return where(DSL.condition(condition)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function7 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + @PlainSQL + public Rental where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Rental where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Rental where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Rental whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java index a79fd23..352b696 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/RewardsReport.java @@ -7,16 +7,12 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.Function10; import org.jooq.Identity; import org.jooq.Name; -import org.jooq.Records; -import org.jooq.Row10; import org.jooq.Schema; -import org.jooq.SelectField; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -30,7 +26,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class RewardsReport extends TableImpl { private static final long serialVersionUID = 1L; @@ -106,7 +102,11 @@ private RewardsReport(Name alias, Table aliased) { } private RewardsReport(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function()); + this(alias, aliased, parameters, null); + } + + private RewardsReport(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.function(), where); } /** @@ -179,15 +179,6 @@ public RewardsReport rename(Table name) { return new RewardsReport(name.getQualifiedName(), null, parameters); } - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - - @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); - } - /** * Call this table-valued function */ @@ -217,19 +208,4 @@ public RewardsReport call( return aliased() ? result.as(getUnqualifiedName()) : result; } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - public SelectField mapping(Function10 from) { - return convertFrom(Records.mapping(from)); - } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - public SelectField mapping(Class toType, Function10 from) { - return convertFrom(toType, Records.mapping(from)); - } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java index 23c796b..4943404 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByFilmCategory.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function2; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row2; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -29,7 +29,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class SalesByFilmCategory extends TableImpl { private static final long serialVersionUID = 1L; @@ -58,10 +58,10 @@ public Class getRecordType() { public final TableField TOTAL_SALES = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, ""); private SalesByFilmCategory(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private SalesByFilmCategory(Name alias, Table aliased, Field[] parameters) { + private SalesByFilmCategory(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "sales_by_film_category" as SELECT c.name AS category, sum(p.amount) AS total_sales @@ -73,7 +73,7 @@ JOIN film_category fc ON ((f.film_id = fc.film_id))) JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY (sum(p.amount)) DESC; - """)); + """), where); } /** @@ -99,10 +99,6 @@ public SalesByFilmCategory() { this(DSL.name("sales_by_film_category"), null); } - public SalesByFilmCategory(Table child, ForeignKey key) { - super(child, key, SALES_BY_FILM_CATEGORY); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -147,27 +143,87 @@ public SalesByFilmCategory rename(Table name) { return new SalesByFilmCategory(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Condition condition) { + return new SalesByFilmCategory(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByFilmCategory where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByFilmCategory where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByFilmCategory where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByFilmCategory where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); + @PlainSQL + public SalesByFilmCategory where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function2 from) { - return convertFrom(Records.mapping(from)); + @Override + public SalesByFilmCategory whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function2 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public SalesByFilmCategory whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java index 096a1a9..e986a34 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/SalesByStore.java @@ -5,17 +5,17 @@ import java.math.BigDecimal; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function3; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row3; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -29,7 +29,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class SalesByStore extends TableImpl { private static final long serialVersionUID = 1L; @@ -63,10 +63,10 @@ public Class getRecordType() { public final TableField TOTAL_SALES = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, ""); private SalesByStore(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private SalesByStore(Name alias, Table aliased, Field[] parameters) { + private SalesByStore(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "sales_by_store" as SELECT (((c.city)::text || ','::text) || (cy.country)::text) AS store, (((m.first_name)::text || ' '::text) || (m.last_name)::text) AS manager, @@ -81,7 +81,7 @@ JOIN country cy ON ((c.country_id = cy.country_id))) JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city; - """)); + """), where); } /** @@ -105,10 +105,6 @@ public SalesByStore() { this(DSL.name("sales_by_store"), null); } - public SalesByStore(Table child, ForeignKey key) { - super(child, key, SALES_BY_STORE); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -153,27 +149,87 @@ public SalesByStore rename(Table name) { return new SalesByStore(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Condition condition) { + return new SalesByStore(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public SalesByStore where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByStore where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByStore where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public SalesByStore where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); + @PlainSQL + public SalesByStore where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function3 from) { - return convertFrom(Records.mapping(from)); + @Override + public SalesByStore whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function3 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public SalesByStore whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java index c9d77db..b274d13 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Staff.java @@ -6,25 +6,39 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function13; import org.jooq.Identity; +import org.jooq.InverseForeignKey; import org.jooq.Name; +import org.jooq.Path; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row13; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; import org.jooq.UniqueKey; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Payment.PaymentPath; +import org.jooq.demo.java.db.tables.PaymentP2007_01.PaymentP2007_01Path; +import org.jooq.demo.java.db.tables.PaymentP2007_02.PaymentP2007_02Path; +import org.jooq.demo.java.db.tables.PaymentP2007_03.PaymentP2007_03Path; +import org.jooq.demo.java.db.tables.PaymentP2007_04.PaymentP2007_04Path; +import org.jooq.demo.java.db.tables.PaymentP2007_05.PaymentP2007_05Path; +import org.jooq.demo.java.db.tables.PaymentP2007_06.PaymentP2007_06Path; +import org.jooq.demo.java.db.tables.Rental.RentalPath; +import org.jooq.demo.java.db.tables.Store.StorePath; import org.jooq.demo.java.db.tables.records.StaffRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -34,7 +48,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Staff extends TableImpl { private static final long serialVersionUID = 1L; @@ -118,11 +132,11 @@ public Class getRecordType() { public final TableField FULL_NAME = createField(DSL.name("full_name"), SQLDataType.CLOB.virtual(), this, "", ctx -> DSL.concat(FIRST_NAME, DSL.inline(" "), LAST_NAME)); private Staff(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Staff(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Staff(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -146,8 +160,35 @@ public Staff() { this(DSL.name("staff"), null); } - public Staff(Table child, ForeignKey key) { - super(child, key, STAFF); + public Staff(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, STAFF); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class StaffPath extends Staff implements Path { + public StaffPath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private StaffPath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public StaffPath as(String alias) { + return new StaffPath(DSL.name(alias), this); + } + + @Override + public StaffPath as(Name alias) { + return new StaffPath(alias, this); + } + + @Override + public StaffPath as(Table alias) { + return new StaffPath(alias.getQualifiedName(), this); + } } @Override @@ -170,29 +211,134 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.STAFF__STAFF_ADDRESS_ID_FKEY, Keys.STAFF__STAFF_STORE_ID_FKEY); } - private transient Address _address; - private transient Store _store; + private transient AddressPath _address; /** * Get the implicit join path to the public.address table. */ - public Address address() { + public AddressPath address() { if (_address == null) - _address = new Address(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY); + _address = new AddressPath(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY, null); return _address; } + private transient StorePath _store; + /** * Get the implicit join path to the public.store table. */ - public Store store() { + public StorePath store() { if (_store == null) - _store = new Store(this, Keys.STAFF__STAFF_STORE_ID_FKEY); + _store = new StorePath(this, Keys.STAFF__STAFF_STORE_ID_FKEY, null); return _store; } + private transient PaymentPath _payment; + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + public PaymentPath payment() { + if (_payment == null) + _payment = new PaymentPath(this, null, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY.getInverseKey()); + + return _payment; + } + + private transient PaymentP2007_01Path _paymentP2007_01; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + public PaymentP2007_01Path paymentP2007_01() { + if (_paymentP2007_01 == null) + _paymentP2007_01 = new PaymentP2007_01Path(this, null, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_01; + } + + private transient PaymentP2007_02Path _paymentP2007_02; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + public PaymentP2007_02Path paymentP2007_02() { + if (_paymentP2007_02 == null) + _paymentP2007_02 = new PaymentP2007_02Path(this, null, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_02; + } + + private transient PaymentP2007_03Path _paymentP2007_03; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + public PaymentP2007_03Path paymentP2007_03() { + if (_paymentP2007_03 == null) + _paymentP2007_03 = new PaymentP2007_03Path(this, null, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_03; + } + + private transient PaymentP2007_04Path _paymentP2007_04; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + public PaymentP2007_04Path paymentP2007_04() { + if (_paymentP2007_04 == null) + _paymentP2007_04 = new PaymentP2007_04Path(this, null, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_04; + } + + private transient PaymentP2007_05Path _paymentP2007_05; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + public PaymentP2007_05Path paymentP2007_05() { + if (_paymentP2007_05 == null) + _paymentP2007_05 = new PaymentP2007_05Path(this, null, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_05; + } + + private transient PaymentP2007_06Path _paymentP2007_06; + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + public PaymentP2007_06Path paymentP2007_06() { + if (_paymentP2007_06 == null) + _paymentP2007_06 = new PaymentP2007_06Path(this, null, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY.getInverseKey()); + + return _paymentP2007_06; + } + + private transient RentalPath _rental; + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + public RentalPath rental() { + if (_rental == null) + _rental = new RentalPath(this, null, Keys.RENTAL__RENTAL_STAFF_ID_FKEY.getInverseKey()); + + return _rental; + } + @Override public Staff as(String alias) { return new Staff(DSL.name(alias), this); @@ -232,27 +378,87 @@ public Staff rename(Table name) { return new Staff(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row13 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Staff where(Condition condition) { + return new Staff(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row13 fieldsRow() { - return (Row13) super.fieldsRow(); + public Staff where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function13 from) { - return convertFrom(Records.mapping(from)); + @Override + public Staff where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function13 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Staff where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Staff where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Staff whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Staff whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java index 5ac0c80..88e16fb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/StaffList.java @@ -4,17 +4,17 @@ package org.jooq.demo.java.db.tables; -import java.util.function.Function; +import java.util.Collection; +import org.jooq.Condition; import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Function8; import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row8; +import org.jooq.PlainSQL; +import org.jooq.QueryPart; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -28,7 +28,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class StaffList extends TableImpl { private static final long serialVersionUID = 1L; @@ -87,10 +87,10 @@ public Class getRecordType() { public final TableField SID = createField(DSL.name("sid"), SQLDataType.BIGINT, this, ""); private StaffList(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private StaffList(Name alias, Table aliased, Field[] parameters) { + private StaffList(Name alias, Table aliased, Field[] parameters, Condition where) { super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view(""" create view "staff_list" as SELECT s.staff_id AS id, (((s.first_name)::text || ' '::text) || (s.last_name)::text) AS name, @@ -104,7 +104,7 @@ private StaffList(Name alias, Table aliased, Field[] paramet JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """)); + """), where); } /** @@ -128,10 +128,6 @@ public StaffList() { this(DSL.name("staff_list"), null); } - public StaffList(Table child, ForeignKey key) { - super(child, key, STAFF_LIST); - } - @Override public Schema getSchema() { return aliased() ? null : Public.PUBLIC; @@ -176,27 +172,87 @@ public StaffList rename(Table name) { return new StaffList(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Condition condition) { + return new StaffList(getQualifiedName(), aliased() ? this : null, null, condition); + } + + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Collection conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Condition... conditions) { + return where(DSL.and(conditions)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public StaffList where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public StaffList where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public StaffList where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public StaffList where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + /** + * Create an inline derived table from this table + */ @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + @PlainSQL + public StaffList where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function8 from) { - return convertFrom(Records.mapping(from)); + @Override + public StaffList whereExists(Select select) { + return where(DSL.exists(select)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function8 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public StaffList whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java index b12e4c0..76cb9c1 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/Store.java @@ -6,20 +6,24 @@ import java.time.LocalDateTime; import java.util.Arrays; +import java.util.Collection; import java.util.List; -import java.util.function.Function; +import org.jooq.Condition; import org.jooq.Field; import org.jooq.ForeignKey; -import org.jooq.Function5; 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.QueryPart; import org.jooq.Record; -import org.jooq.Records; -import org.jooq.Row5; +import org.jooq.SQL; import org.jooq.Schema; -import org.jooq.SelectField; +import org.jooq.Select; +import org.jooq.Stringly; import org.jooq.Table; import org.jooq.TableField; import org.jooq.TableOptions; @@ -27,6 +31,10 @@ import org.jooq.demo.java.db.Indexes; import org.jooq.demo.java.db.Keys; import org.jooq.demo.java.db.Public; +import org.jooq.demo.java.db.tables.Address.AddressPath; +import org.jooq.demo.java.db.tables.Customer.CustomerPath; +import org.jooq.demo.java.db.tables.Inventory.InventoryPath; +import org.jooq.demo.java.db.tables.Staff.StaffPath; import org.jooq.demo.java.db.tables.records.StoreRecord; import org.jooq.impl.DSL; import org.jooq.impl.SQLDataType; @@ -36,7 +44,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class Store extends TableImpl { private static final long serialVersionUID = 1L; @@ -80,11 +88,11 @@ public Class getRecordType() { public final TableField FULL_ADDRESS = createField(DSL.name("full_address"), SQLDataType.CLOB.virtual(), this, "", ctx -> DSL.concat(address().ADDRESS_, DSL.inline(", "), address().POSTAL_CODE, DSL.inline(", "), address().city().CITY_, DSL.inline(", "), address().city().country().COUNTRY_)); private Store(Name alias, Table aliased) { - this(alias, aliased, null); + this(alias, aliased, (Field[]) null, null); } - private Store(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + private Store(Name alias, Table aliased, Field[] parameters, Condition where) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where); } /** @@ -108,8 +116,35 @@ public Store() { this(DSL.name("store"), null); } - public Store(Table child, ForeignKey key) { - super(child, key, STORE); + public Store(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath, STORE); + } + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + public static class StorePath extends Store implements Path { + public StorePath(Table path, ForeignKey childPath, InverseForeignKey parentPath) { + super(path, childPath, parentPath); + } + private StorePath(Name alias, Table aliased) { + super(alias, aliased); + } + + @Override + public StorePath as(String alias) { + return new StorePath(DSL.name(alias), this); + } + + @Override + public StorePath as(Name alias) { + return new StorePath(alias, this); + } + + @Override + public StorePath as(Table alias) { + return new StorePath(alias.getQualifiedName(), this); + } } @Override @@ -137,29 +172,56 @@ public UniqueKey getPrimaryKey() { return Arrays.asList(Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY, Keys.STORE__STORE_ADDRESS_ID_FKEY); } - private transient Staff _staff; - private transient Address _address; + private transient StaffPath _staff; /** * Get the implicit join path to the public.staff table. */ - public Staff staff() { + public StaffPath staff() { if (_staff == null) - _staff = new Staff(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY); + _staff = new StaffPath(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY, null); return _staff; } + private transient AddressPath _address; + /** * Get the implicit join path to the public.address table. */ - public Address address() { + public AddressPath address() { if (_address == null) - _address = new Address(this, Keys.STORE__STORE_ADDRESS_ID_FKEY); + _address = new AddressPath(this, Keys.STORE__STORE_ADDRESS_ID_FKEY, null); return _address; } + private transient CustomerPath _customer; + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + public CustomerPath customer() { + if (_customer == null) + _customer = new CustomerPath(this, null, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY.getInverseKey()); + + return _customer; + } + + private transient InventoryPath _inventory; + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + public InventoryPath inventory() { + if (_inventory == null) + _inventory = new InventoryPath(this, null, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY.getInverseKey()); + + return _inventory; + } + @Override public Store as(String alias) { return new Store(DSL.name(alias), this); @@ -199,27 +261,87 @@ public Store rename(Table name) { return new Store(name.getQualifiedName(), null); } - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- + /** + * Create an inline derived table from this table + */ + @Override + public Store where(Condition condition) { + return new Store(getQualifiedName(), aliased() ? this : null, null, condition); + } + /** + * Create an inline derived table from this table + */ @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); + public Store where(Collection conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Function5 from) { - return convertFrom(Records.mapping(from)); + @Override + public Store where(Condition... conditions) { + return where(DSL.and(conditions)); } /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - public SelectField mapping(Class toType, Function5 from) { - return convertFrom(toType, Records.mapping(from)); + @Override + public Store where(Field condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(SQL condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(@Stringly.SQL String condition) { + return where(DSL.condition(condition)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(@Stringly.SQL String condition, Object... binds) { + return where(DSL.condition(condition, binds)); + } + + /** + * Create an inline derived table from this table + */ + @Override + @PlainSQL + public Store where(@Stringly.SQL String condition, QueryPart... parts) { + return where(DSL.condition(condition, parts)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Store whereExists(Select select) { + return where(DSL.exists(select)); + } + + /** + * Create an inline derived table from this table + */ + @Override + public Store whereNotExists(Select select) { + return where(DSL.notExists(select)); } } diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/ActorDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/ActorDao.java index 89e01e6..fee374f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/ActorDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/ActorDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class ActorDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/AddressDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/AddressDao.java index 24c6e90..85d8c32 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/AddressDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/AddressDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class AddressDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CategoryDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CategoryDao.java index 15c6a0b..e9becd2 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CategoryDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CategoryDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class CategoryDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CityDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CityDao.java index b7afd55..d1af12f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CityDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CityDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class CityDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CountryDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CountryDao.java index c8e2526..b164461 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CountryDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CountryDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class CountryDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CustomerDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CustomerDao.java index 2cfcd7c..2236029 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CustomerDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/CustomerDao.java @@ -18,7 +18,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class CustomerDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmActorDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmActorDao.java index bb27bb6..71bfcb5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmActorDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmActorDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmActorDao extends DAOImpl> { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmCategoryDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmCategoryDao.java index 4dc2981..9887d47 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmCategoryDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmCategoryDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmCategoryDao extends DAOImpl> { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmDao.java index 93bc6bb..1665480 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/FilmDao.java @@ -19,7 +19,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class FilmDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/InventoryDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/InventoryDao.java index 8101d33..e6b9258 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/InventoryDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/InventoryDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class InventoryDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/LanguageDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/LanguageDao.java index 07faca8..3a685b3 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/LanguageDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/LanguageDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class LanguageDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/PaymentDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/PaymentDao.java index fc3940d..ded8eab 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/PaymentDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/PaymentDao.java @@ -18,7 +18,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class PaymentDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/RentalDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/RentalDao.java index c4e0e1d..0773b51 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/RentalDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/RentalDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class RentalDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StaffDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StaffDao.java index 8d98fe9..c7402ac 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StaffDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StaffDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class StaffDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StoreDao.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StoreDao.java index d2d71b5..d265a01 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StoreDao.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/daos/StoreDao.java @@ -17,7 +17,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public class StoreDao extends DAOImpl { /** diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Actor.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Actor.java index 71f5ab2..3b5491c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Actor.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Actor.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Actor( Long actorId, String firstName, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/ActorInfo.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/ActorInfo.java index e476bf5..fea1118 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/ActorInfo.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/ActorInfo.java @@ -10,7 +10,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record ActorInfo( Long actorId, String firstName, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Address.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Address.java index 4cd5ee3..449daef 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Address.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Address.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Address( Long addressId, String address, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Category.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Category.java index 03e9fb7..9829725 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Category.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Category.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Category( Long categoryId, String name, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/City.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/City.java index afe3f14..2fa07fc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/City.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/City.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record City( Long cityId, String city, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Country.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Country.java index 2cb1df2..6fedbca 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Country.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Country.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Country( Long countryId, String country, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Customer.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Customer.java index 567642e..146fc62 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Customer.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Customer.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Customer( Long customerId, Long storeId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/CustomerList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/CustomerList.java index 69cea41..78644cc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/CustomerList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/CustomerList.java @@ -10,7 +10,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record CustomerList( Long id, String name, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Film.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Film.java index 227e651..f3dcef2 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Film.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Film.java @@ -14,7 +14,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Film( Long filmId, String title, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmActor.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmActor.java index 27d5d80..8c750b5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmActor.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmActor.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record FilmActor( Long actorId, Long filmId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmCategory.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmCategory.java index 71eb7eb..560bc66 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmCategory.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmCategory.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record FilmCategory( Long filmId, Long categoryId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmInStock.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmInStock.java index 9ae4262..222b8fe 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmInStock.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmInStock.java @@ -10,7 +10,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record FilmInStock( Integer pFilmCount ) implements Serializable { diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmList.java index 11ba5c5..91586e8 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmList.java @@ -13,7 +13,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record FilmList( Long fid, String title, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmNotInStock.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmNotInStock.java index e624767..8b505df 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmNotInStock.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/FilmNotInStock.java @@ -10,7 +10,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record FilmNotInStock( Integer pFilmCount ) implements Serializable { diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Inventory.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Inventory.java index 80c696d..e4df7fe 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Inventory.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Inventory.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Inventory( Long inventoryId, Long filmId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Language.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Language.java index ebe7ac6..598fbfe 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Language.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Language.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Language( Long languageId, String name, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/NicerButSlowerFilmList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/NicerButSlowerFilmList.java index 73ef9f1..303c4e9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/NicerButSlowerFilmList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/NicerButSlowerFilmList.java @@ -13,7 +13,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record NicerButSlowerFilmList( Long fid, String title, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Payment.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Payment.java index 2f58a2e..45bcce9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Payment.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Payment.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Payment( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_01.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_01.java index 6a45a8f..adf4328 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_01.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_01.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record PaymentP2007_01( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_02.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_02.java index af8de52..16b5e4e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_02.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_02.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record PaymentP2007_02( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_03.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_03.java index 65538ac..2d8b2dc 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_03.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_03.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record PaymentP2007_03( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_04.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_04.java index 93d510d..417dfea 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_04.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_04.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record PaymentP2007_04( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_05.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_05.java index 10c6e40..b696d1e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_05.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_05.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record PaymentP2007_05( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_06.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_06.java index 4879ce8..9d1f8a5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_06.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/PaymentP2007_06.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record PaymentP2007_06( Long paymentId, Long customerId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Rental.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Rental.java index 22c51fc..996c75e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Rental.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Rental.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Rental( Long rentalId, LocalDateTime rentalDate, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/RewardsReport.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/RewardsReport.java index bb6956f..72dad05 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/RewardsReport.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/RewardsReport.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record RewardsReport( Long customerId, Long storeId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByFilmCategory.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByFilmCategory.java index a34b6a0..6fc4173 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByFilmCategory.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByFilmCategory.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record SalesByFilmCategory( String category, BigDecimal totalSales diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByStore.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByStore.java index 925b29b..3cda280 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByStore.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/SalesByStore.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record SalesByStore( String store, String manager, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Staff.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Staff.java index cd8bc38..2a9e3ec 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Staff.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Staff.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Staff( Long staffId, String firstName, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/StaffList.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/StaffList.java index 6c32e23..4859d7e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/StaffList.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/StaffList.java @@ -10,7 +10,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record StaffList( Long id, String name, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Store.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Store.java index c102d60..e60c025 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Store.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/pojos/Store.java @@ -11,7 +11,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public record Store( Long storeId, Long managerStaffId, diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java index 70a4cde..7740837 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorInfoRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.ActorInfo; import org.jooq.impl.TableRecordImpl; @@ -14,8 +11,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class ActorInfoRecord extends TableRecordImpl implements Record4 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ActorInfoRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -75,113 +72,6 @@ public String getFilmInfo() { return (String) get(3); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return ActorInfo.ACTOR_INFO.ACTOR_ID; - } - - @Override - public Field field2() { - return ActorInfo.ACTOR_INFO.FIRST_NAME; - } - - @Override - public Field field3() { - return ActorInfo.ACTOR_INFO.LAST_NAME; - } - - @Override - public Field field4() { - return ActorInfo.ACTOR_INFO.FILM_INFO; - } - - @Override - public Long component1() { - return getActorId(); - } - - @Override - public String component2() { - return getFirstName(); - } - - @Override - public String component3() { - return getLastName(); - } - - @Override - public String component4() { - return getFilmInfo(); - } - - @Override - public Long value1() { - return getActorId(); - } - - @Override - public String value2() { - return getFirstName(); - } - - @Override - public String value3() { - return getLastName(); - } - - @Override - public String value4() { - return getFilmInfo(); - } - - @Override - public ActorInfoRecord value1(Long value) { - setActorId(value); - return this; - } - - @Override - public ActorInfoRecord value2(String value) { - setFirstName(value); - return this; - } - - @Override - public ActorInfoRecord value3(String value) { - setLastName(value); - return this; - } - - @Override - public ActorInfoRecord value4(String value) { - setFilmInfo(value); - return this; - } - - @Override - public ActorInfoRecord values(Long value1, String value2, String value3, String value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java index 0db494b..8aa3f49 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/ActorRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.Actor; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class ActorRecord extends UpdatableRecordImpl implements Record4 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class ActorRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return Actor.ACTOR.ACTOR_ID; - } - - @Override - public Field field2() { - return Actor.ACTOR.FIRST_NAME; - } - - @Override - public Field field3() { - return Actor.ACTOR.LAST_NAME; - } - - @Override - public Field field4() { - return Actor.ACTOR.LAST_UPDATE; - } - - @Override - public Long component1() { - return getActorId(); - } - - @Override - public String component2() { - return getFirstName(); - } - - @Override - public String component3() { - return getLastName(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getActorId(); - } - - @Override - public String value2() { - return getFirstName(); - } - - @Override - public String value3() { - return getLastName(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public ActorRecord value1(Long value) { - setActorId(value); - return this; - } - - @Override - public ActorRecord value2(String value) { - setFirstName(value); - return this; - } - - @Override - public ActorRecord value3(String value) { - setLastName(value); - return this; - } - - @Override - public ActorRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public ActorRecord values(Long value1, String value2, String value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java index cfced0f..bff4f03 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/AddressRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.tables.Address; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class AddressRecord extends UpdatableRecordImpl implements Record8 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class AddressRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -143,201 +140,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return Address.ADDRESS.ADDRESS_ID; - } - - @Override - public Field field2() { - return Address.ADDRESS.ADDRESS_; - } - - @Override - public Field field3() { - return Address.ADDRESS.ADDRESS2; - } - - @Override - public Field field4() { - return Address.ADDRESS.DISTRICT; - } - - @Override - public Field field5() { - return Address.ADDRESS.CITY_ID; - } - - @Override - public Field field6() { - return Address.ADDRESS.POSTAL_CODE; - } - - @Override - public Field field7() { - return Address.ADDRESS.PHONE; - } - - @Override - public Field field8() { - return Address.ADDRESS.LAST_UPDATE; - } - - @Override - public Long component1() { - return getAddressId(); - } - - @Override - public String component2() { - return getAddress(); - } - - @Override - public String component3() { - return getAddress2(); - } - - @Override - public String component4() { - return getDistrict(); - } - - @Override - public Long component5() { - return getCityId(); - } - - @Override - public String component6() { - return getPostalCode(); - } - - @Override - public String component7() { - return getPhone(); - } - - @Override - public LocalDateTime component8() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getAddressId(); - } - - @Override - public String value2() { - return getAddress(); - } - - @Override - public String value3() { - return getAddress2(); - } - - @Override - public String value4() { - return getDistrict(); - } - - @Override - public Long value5() { - return getCityId(); - } - - @Override - public String value6() { - return getPostalCode(); - } - - @Override - public String value7() { - return getPhone(); - } - - @Override - public LocalDateTime value8() { - return getLastUpdate(); - } - - @Override - public AddressRecord value1(Long value) { - setAddressId(value); - return this; - } - - @Override - public AddressRecord value2(String value) { - setAddress(value); - return this; - } - - @Override - public AddressRecord value3(String value) { - setAddress2(value); - return this; - } - - @Override - public AddressRecord value4(String value) { - setDistrict(value); - return this; - } - - @Override - public AddressRecord value5(Long value) { - setCityId(value); - return this; - } - - @Override - public AddressRecord value6(String value) { - setPostalCode(value); - return this; - } - - @Override - public AddressRecord value7(String value) { - setPhone(value); - return this; - } - - @Override - public AddressRecord value8(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public AddressRecord values(Long value1, String value2, String value3, String value4, Long value5, String value6, String value7, LocalDateTime value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java index 63930c1..169682d 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CategoryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.Category; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CategoryRecord extends UpdatableRecordImpl implements Record3 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class CategoryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return Category.CATEGORY.CATEGORY_ID; - } - - @Override - public Field field2() { - return Category.CATEGORY.NAME; - } - - @Override - public Field field3() { - return Category.CATEGORY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getCategoryId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getCategoryId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public CategoryRecord value1(Long value) { - setCategoryId(value); - return this; - } - - @Override - public CategoryRecord value2(String value) { - setName(value); - return this; - } - - @Override - public CategoryRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CategoryRecord values(Long value1, String value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java index 86b5878..26eb52c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CityRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.City; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CityRecord extends UpdatableRecordImpl implements Record4 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class CityRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return City.CITY.CITY_ID; - } - - @Override - public Field field2() { - return City.CITY.CITY_; - } - - @Override - public Field field3() { - return City.CITY.COUNTRY_ID; - } - - @Override - public Field field4() { - return City.CITY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getCityId(); - } - - @Override - public String component2() { - return getCity(); - } - - @Override - public Long component3() { - return getCountryId(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getCityId(); - } - - @Override - public String value2() { - return getCity(); - } - - @Override - public Long value3() { - return getCountryId(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public CityRecord value1(Long value) { - setCityId(value); - return this; - } - - @Override - public CityRecord value2(String value) { - setCity(value); - return this; - } - - @Override - public CityRecord value3(Long value) { - setCountryId(value); - return this; - } - - @Override - public CityRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CityRecord values(Long value1, String value2, Long value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java index 4af3343..61dd6e9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CountryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.Country; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CountryRecord extends UpdatableRecordImpl implements Record3 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class CountryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return Country.COUNTRY.COUNTRY_ID; - } - - @Override - public Field field2() { - return Country.COUNTRY.COUNTRY_; - } - - @Override - public Field field3() { - return Country.COUNTRY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getCountryId(); - } - - @Override - public String component2() { - return getCountry(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getCountryId(); - } - - @Override - public String value2() { - return getCountry(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public CountryRecord value1(Long value) { - setCountryId(value); - return this; - } - - @Override - public CountryRecord value2(String value) { - setCountry(value); - return this; - } - - @Override - public CountryRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CountryRecord values(Long value1, String value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java index 04f5e44..67f72f2 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerListRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record9; -import org.jooq.Row9; import org.jooq.demo.java.db.tables.CustomerList; import org.jooq.impl.TableRecordImpl; @@ -14,8 +11,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CustomerListRecord extends TableRecordImpl implements Record9 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class CustomerListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -145,223 +142,6 @@ public Long getSid() { return (Long) get(8); } - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row9 fieldsRow() { - return (Row9) super.fieldsRow(); - } - - @Override - public Row9 valuesRow() { - return (Row9) super.valuesRow(); - } - - @Override - public Field field1() { - return CustomerList.CUSTOMER_LIST.ID; - } - - @Override - public Field field2() { - return CustomerList.CUSTOMER_LIST.NAME; - } - - @Override - public Field field3() { - return CustomerList.CUSTOMER_LIST.ADDRESS; - } - - @Override - public Field field4() { - return CustomerList.CUSTOMER_LIST.ZIP_CODE; - } - - @Override - public Field field5() { - return CustomerList.CUSTOMER_LIST.PHONE; - } - - @Override - public Field field6() { - return CustomerList.CUSTOMER_LIST.CITY; - } - - @Override - public Field field7() { - return CustomerList.CUSTOMER_LIST.COUNTRY; - } - - @Override - public Field field8() { - return CustomerList.CUSTOMER_LIST.NOTES; - } - - @Override - public Field field9() { - return CustomerList.CUSTOMER_LIST.SID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getAddress(); - } - - @Override - public String component4() { - return getZipCode(); - } - - @Override - public String component5() { - return getPhone(); - } - - @Override - public String component6() { - return getCity(); - } - - @Override - public String component7() { - return getCountry(); - } - - @Override - public String component8() { - return getNotes(); - } - - @Override - public Long component9() { - return getSid(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getAddress(); - } - - @Override - public String value4() { - return getZipCode(); - } - - @Override - public String value5() { - return getPhone(); - } - - @Override - public String value6() { - return getCity(); - } - - @Override - public String value7() { - return getCountry(); - } - - @Override - public String value8() { - return getNotes(); - } - - @Override - public Long value9() { - return getSid(); - } - - @Override - public CustomerListRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public CustomerListRecord value2(String value) { - setName(value); - return this; - } - - @Override - public CustomerListRecord value3(String value) { - setAddress(value); - return this; - } - - @Override - public CustomerListRecord value4(String value) { - setZipCode(value); - return this; - } - - @Override - public CustomerListRecord value5(String value) { - setPhone(value); - return this; - } - - @Override - public CustomerListRecord value6(String value) { - setCity(value); - return this; - } - - @Override - public CustomerListRecord value7(String value) { - setCountry(value); - return this; - } - - @Override - public CustomerListRecord value8(String value) { - setNotes(value); - return this; - } - - @Override - public CustomerListRecord value9(Long value) { - setSid(value); - return this; - } - - @Override - public CustomerListRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, String value8, Long value9) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java index 9674666..54a298c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/CustomerRecord.java @@ -7,10 +7,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record10; -import org.jooq.Row10; import org.jooq.demo.java.db.tables.Customer; import org.jooq.impl.UpdatableRecordImpl; @@ -18,8 +15,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class CustomerRecord extends UpdatableRecordImpl implements Record10 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class CustomerRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -172,245 +169,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row10 fieldsRow() { - return (Row10) super.fieldsRow(); - } - - @Override - public Row10 valuesRow() { - return (Row10) super.valuesRow(); - } - - @Override - public Field field1() { - return Customer.CUSTOMER.CUSTOMER_ID; - } - - @Override - public Field field2() { - return Customer.CUSTOMER.STORE_ID; - } - - @Override - public Field field3() { - return Customer.CUSTOMER.FIRST_NAME; - } - - @Override - public Field field4() { - return Customer.CUSTOMER.LAST_NAME; - } - - @Override - public Field field5() { - return Customer.CUSTOMER.EMAIL; - } - - @Override - public Field field6() { - return Customer.CUSTOMER.ADDRESS_ID; - } - - @Override - public Field field7() { - return Customer.CUSTOMER.ACTIVEBOOL; - } - - @Override - public Field field8() { - return Customer.CUSTOMER.CREATE_DATE; - } - - @Override - public Field field9() { - return Customer.CUSTOMER.LAST_UPDATE; - } - - @Override - public Field field10() { - return Customer.CUSTOMER.ACTIVE; - } - - @Override - public Long component1() { - return getCustomerId(); - } - - @Override - public Long component2() { - return getStoreId(); - } - - @Override - public String component3() { - return getFirstName(); - } - - @Override - public String component4() { - return getLastName(); - } - - @Override - public String component5() { - return getEmail(); - } - - @Override - public Long component6() { - return getAddressId(); - } - - @Override - public Boolean component7() { - return getActivebool(); - } - - @Override - public LocalDate component8() { - return getCreateDate(); - } - - @Override - public LocalDateTime component9() { - return getLastUpdate(); - } - - @Override - public Integer component10() { - return getActive(); - } - - @Override - public Long value1() { - return getCustomerId(); - } - - @Override - public Long value2() { - return getStoreId(); - } - - @Override - public String value3() { - return getFirstName(); - } - - @Override - public String value4() { - return getLastName(); - } - - @Override - public String value5() { - return getEmail(); - } - - @Override - public Long value6() { - return getAddressId(); - } - - @Override - public Boolean value7() { - return getActivebool(); - } - - @Override - public LocalDate value8() { - return getCreateDate(); - } - - @Override - public LocalDateTime value9() { - return getLastUpdate(); - } - - @Override - public Integer value10() { - return getActive(); - } - - @Override - public CustomerRecord value1(Long value) { - setCustomerId(value); - return this; - } - - @Override - public CustomerRecord value2(Long value) { - setStoreId(value); - return this; - } - - @Override - public CustomerRecord value3(String value) { - setFirstName(value); - return this; - } - - @Override - public CustomerRecord value4(String value) { - setLastName(value); - return this; - } - - @Override - public CustomerRecord value5(String value) { - setEmail(value); - return this; - } - - @Override - public CustomerRecord value6(Long value) { - setAddressId(value); - return this; - } - - @Override - public CustomerRecord value7(Boolean value) { - setActivebool(value); - return this; - } - - @Override - public CustomerRecord value8(LocalDate value) { - setCreateDate(value); - return this; - } - - @Override - public CustomerRecord value9(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public CustomerRecord value10(Integer value) { - setActive(value); - return this; - } - - @Override - public CustomerRecord values(Long value1, Long value2, String value3, String value4, String value5, Long value6, Boolean value7, LocalDate value8, LocalDateTime value9, Integer value10) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java index af3881a..6037bae 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmActorRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record2; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.FilmActor; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FilmActorRecord extends UpdatableRecordImpl implements Record3 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class FilmActorRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record2 key() { return (Record2) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmActor.FILM_ACTOR.ACTOR_ID; - } - - @Override - public Field field2() { - return FilmActor.FILM_ACTOR.FILM_ID; - } - - @Override - public Field field3() { - return FilmActor.FILM_ACTOR.LAST_UPDATE; - } - - @Override - public Long component1() { - return getActorId(); - } - - @Override - public Long component2() { - return getFilmId(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getActorId(); - } - - @Override - public Long value2() { - return getFilmId(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public FilmActorRecord value1(Long value) { - setActorId(value); - return this; - } - - @Override - public FilmActorRecord value2(Long value) { - setFilmId(value); - return this; - } - - @Override - public FilmActorRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public FilmActorRecord values(Long value1, Long value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java index 7145b1d..4915489 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmCategoryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record2; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.FilmCategory; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FilmCategoryRecord extends UpdatableRecordImpl implements Record3 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class FilmCategoryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record2 key() { return (Record2) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmCategory.FILM_CATEGORY.FILM_ID; - } - - @Override - public Field field2() { - return FilmCategory.FILM_CATEGORY.CATEGORY_ID; - } - - @Override - public Field field3() { - return FilmCategory.FILM_CATEGORY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getFilmId(); - } - - @Override - public Long component2() { - return getCategoryId(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getFilmId(); - } - - @Override - public Long value2() { - return getCategoryId(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public FilmCategoryRecord value1(Long value) { - setFilmId(value); - return this; - } - - @Override - public FilmCategoryRecord value2(Long value) { - setCategoryId(value); - return this; - } - - @Override - public FilmCategoryRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public FilmCategoryRecord values(Long value1, Long value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java index 07f6819..be5d185 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmInStockRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Row1; import org.jooq.demo.java.db.tables.FilmInStock; import org.jooq.impl.TableRecordImpl; @@ -14,8 +11,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FilmInStockRecord extends TableRecordImpl implements Record1 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class FilmInStockRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -33,47 +30,6 @@ public Integer getPFilmCount() { return (Integer) get(0); } - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - - @Override - public Row1 valuesRow() { - return (Row1) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmInStock.FILM_IN_STOCK.P_FILM_COUNT; - } - - @Override - public Integer component1() { - return getPFilmCount(); - } - - @Override - public Integer value1() { - return getPFilmCount(); - } - - @Override - public FilmInStockRecord value1(Integer value) { - setPFilmCount(value); - return this; - } - - @Override - public FilmInStockRecord values(Integer value1) { - value1(value1); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java index 78a7632..337a9bb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmListRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.enums.MpaaRating; import org.jooq.demo.java.db.tables.FilmList; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FilmListRecord extends TableRecordImpl implements Record8 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class FilmListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -134,201 +131,6 @@ public String getActors() { return (String) get(7); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmList.FILM_LIST.FID; - } - - @Override - public Field field2() { - return FilmList.FILM_LIST.TITLE; - } - - @Override - public Field field3() { - return FilmList.FILM_LIST.DESCRIPTION; - } - - @Override - public Field field4() { - return FilmList.FILM_LIST.CATEGORY; - } - - @Override - public Field field5() { - return FilmList.FILM_LIST.PRICE; - } - - @Override - public Field field6() { - return FilmList.FILM_LIST.LENGTH; - } - - @Override - public Field field7() { - return FilmList.FILM_LIST.RATING; - } - - @Override - public Field field8() { - return FilmList.FILM_LIST.ACTORS; - } - - @Override - public Long component1() { - return getFid(); - } - - @Override - public String component2() { - return getTitle(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public String component4() { - return getCategory(); - } - - @Override - public BigDecimal component5() { - return getPrice(); - } - - @Override - public Short component6() { - return getLength(); - } - - @Override - public MpaaRating component7() { - return getRating(); - } - - @Override - public String component8() { - return getActors(); - } - - @Override - public Long value1() { - return getFid(); - } - - @Override - public String value2() { - return getTitle(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public String value4() { - return getCategory(); - } - - @Override - public BigDecimal value5() { - return getPrice(); - } - - @Override - public Short value6() { - return getLength(); - } - - @Override - public MpaaRating value7() { - return getRating(); - } - - @Override - public String value8() { - return getActors(); - } - - @Override - public FilmListRecord value1(Long value) { - setFid(value); - return this; - } - - @Override - public FilmListRecord value2(String value) { - setTitle(value); - return this; - } - - @Override - public FilmListRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public FilmListRecord value4(String value) { - setCategory(value); - return this; - } - - @Override - public FilmListRecord value5(BigDecimal value) { - setPrice(value); - return this; - } - - @Override - public FilmListRecord value6(Short value) { - setLength(value); - return this; - } - - @Override - public FilmListRecord value7(MpaaRating value) { - setRating(value); - return this; - } - - @Override - public FilmListRecord value8(String value) { - setActors(value); - return this; - } - - @Override - public FilmListRecord values(Long value1, String value2, String value3, String value4, BigDecimal value5, Short value6, MpaaRating value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java index 2ed78bc..a1fe811 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmNotInStockRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record1; -import org.jooq.Row1; import org.jooq.demo.java.db.tables.FilmNotInStock; import org.jooq.impl.TableRecordImpl; @@ -14,8 +11,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FilmNotInStockRecord extends TableRecordImpl implements Record1 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class FilmNotInStockRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -33,47 +30,6 @@ public Integer getPFilmCount() { return (Integer) get(0); } - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row1 fieldsRow() { - return (Row1) super.fieldsRow(); - } - - @Override - public Row1 valuesRow() { - return (Row1) super.valuesRow(); - } - - @Override - public Field field1() { - return FilmNotInStock.FILM_NOT_IN_STOCK.P_FILM_COUNT; - } - - @Override - public Integer component1() { - return getPFilmCount(); - } - - @Override - public Integer value1() { - return getPFilmCount(); - } - - @Override - public FilmNotInStockRecord value1(Integer value) { - setPFilmCount(value); - return this; - } - - @Override - public FilmNotInStockRecord values(Integer value1) { - value1(value1); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java index f489be4..efb5791 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/FilmRecord.java @@ -7,10 +7,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record14; -import org.jooq.Row14; import org.jooq.demo.java.db.enums.MpaaRating; import org.jooq.demo.java.db.tables.Film; import org.jooq.impl.UpdatableRecordImpl; @@ -19,8 +16,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class FilmRecord extends UpdatableRecordImpl implements Record14 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class FilmRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -241,369 +238,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row14 fieldsRow() { - return (Row14) super.fieldsRow(); - } - - @Override - public Row14 valuesRow() { - return (Row14) super.valuesRow(); - } - - @Override - public Field field1() { - return Film.FILM.FILM_ID; - } - - @Override - public Field field2() { - return Film.FILM.TITLE; - } - - @Override - public Field field3() { - return Film.FILM.DESCRIPTION; - } - - @Override - public Field field4() { - return Film.FILM.RELEASE_YEAR; - } - - @Override - public Field field5() { - return Film.FILM.LANGUAGE_ID; - } - - @Override - public Field field6() { - return Film.FILM.ORIGINAL_LANGUAGE_ID; - } - - @Override - public Field field7() { - return Film.FILM.RENTAL_DURATION; - } - - @Override - public Field field8() { - return Film.FILM.RENTAL_RATE; - } - - @Override - public Field field9() { - return Film.FILM.LENGTH; - } - - @Override - public Field field10() { - return Film.FILM.REPLACEMENT_COST; - } - - @Override - public Field field11() { - return Film.FILM.RATING; - } - - @Override - public Field field12() { - return Film.FILM.LAST_UPDATE; - } - - @Override - public Field field13() { - return Film.FILM.SPECIAL_FEATURES; - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public Field field14() { - return Film.FILM.FULLTEXT; - } - - @Override - public Long component1() { - return getFilmId(); - } - - @Override - public String component2() { - return getTitle(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public Integer component4() { - return getReleaseYear(); - } - - @Override - public Long component5() { - return getLanguageId(); - } - - @Override - public Long component6() { - return getOriginalLanguageId(); - } - - @Override - public Short component7() { - return getRentalDuration(); - } - - @Override - public BigDecimal component8() { - return getRentalRate(); - } - - @Override - public Short component9() { - return getLength(); - } - - @Override - public BigDecimal component10() { - return getReplacementCost(); - } - - @Override - public MpaaRating component11() { - return getRating(); - } - - @Override - public LocalDateTime component12() { - return getLastUpdate(); - } - - @Override - public String[] component13() { - return getSpecialFeatures(); - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public Object component14() { - return getFulltext(); - } - - @Override - public Long value1() { - return getFilmId(); - } - - @Override - public String value2() { - return getTitle(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public Integer value4() { - return getReleaseYear(); - } - - @Override - public Long value5() { - return getLanguageId(); - } - - @Override - public Long value6() { - return getOriginalLanguageId(); - } - - @Override - public Short value7() { - return getRentalDuration(); - } - - @Override - public BigDecimal value8() { - return getRentalRate(); - } - - @Override - public Short value9() { - return getLength(); - } - - @Override - public BigDecimal value10() { - return getReplacementCost(); - } - - @Override - public MpaaRating value11() { - return getRating(); - } - - @Override - public LocalDateTime value12() { - return getLastUpdate(); - } - - @Override - public String[] value13() { - return getSpecialFeatures(); - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public Object value14() { - return getFulltext(); - } - - @Override - public FilmRecord value1(Long value) { - setFilmId(value); - return this; - } - - @Override - public FilmRecord value2(String value) { - setTitle(value); - return this; - } - - @Override - public FilmRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public FilmRecord value4(Integer value) { - setReleaseYear(value); - return this; - } - - @Override - public FilmRecord value5(Long value) { - setLanguageId(value); - return this; - } - - @Override - public FilmRecord value6(Long value) { - setOriginalLanguageId(value); - return this; - } - - @Override - public FilmRecord value7(Short value) { - setRentalDuration(value); - return this; - } - - @Override - public FilmRecord value8(BigDecimal value) { - setRentalRate(value); - return this; - } - - @Override - public FilmRecord value9(Short value) { - setLength(value); - return this; - } - - @Override - public FilmRecord value10(BigDecimal value) { - setReplacementCost(value); - return this; - } - - @Override - public FilmRecord value11(MpaaRating value) { - setRating(value); - return this; - } - - @Override - public FilmRecord value12(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public FilmRecord value13(String[] value) { - setSpecialFeatures(value); - return this; - } - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in - * type, you can define an explicit {@link org.jooq.Binding} to specify how - * this type should be handled. Deprecation can be turned off using - * {@literal } in your code generator - * configuration. - */ - @Deprecated - @Override - public FilmRecord value14(Object value) { - setFulltext(value); - return this; - } - - @Override - public FilmRecord values(Long value1, String value2, String value3, Integer value4, Long value5, Long value6, Short value7, BigDecimal value8, Short value9, BigDecimal value10, MpaaRating value11, LocalDateTime value12, String[] value13, Object value14) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - value14(value14); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java index d3a576b..49c909b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/InventoryRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record4; -import org.jooq.Row4; import org.jooq.demo.java.db.tables.Inventory; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class InventoryRecord extends UpdatableRecordImpl implements Record4 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class InventoryRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -87,113 +84,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row4 fieldsRow() { - return (Row4) super.fieldsRow(); - } - - @Override - public Row4 valuesRow() { - return (Row4) super.valuesRow(); - } - - @Override - public Field field1() { - return Inventory.INVENTORY.INVENTORY_ID; - } - - @Override - public Field field2() { - return Inventory.INVENTORY.FILM_ID; - } - - @Override - public Field field3() { - return Inventory.INVENTORY.STORE_ID; - } - - @Override - public Field field4() { - return Inventory.INVENTORY.LAST_UPDATE; - } - - @Override - public Long component1() { - return getInventoryId(); - } - - @Override - public Long component2() { - return getFilmId(); - } - - @Override - public Long component3() { - return getStoreId(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getInventoryId(); - } - - @Override - public Long value2() { - return getFilmId(); - } - - @Override - public Long value3() { - return getStoreId(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public InventoryRecord value1(Long value) { - setInventoryId(value); - return this; - } - - @Override - public InventoryRecord value2(Long value) { - setFilmId(value); - return this; - } - - @Override - public InventoryRecord value3(Long value) { - setStoreId(value); - return this; - } - - @Override - public InventoryRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public InventoryRecord values(Long value1, Long value2, Long value3, LocalDateTime value4) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java index 7723ab3..3b53d75 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/LanguageRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.Language; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class LanguageRecord extends UpdatableRecordImpl implements Record3 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class LanguageRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -73,91 +70,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return Language.LANGUAGE.LANGUAGE_ID; - } - - @Override - public Field field2() { - return Language.LANGUAGE.NAME; - } - - @Override - public Field field3() { - return Language.LANGUAGE.LAST_UPDATE; - } - - @Override - public Long component1() { - return getLanguageId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public LocalDateTime component3() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getLanguageId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public LocalDateTime value3() { - return getLastUpdate(); - } - - @Override - public LanguageRecord value1(Long value) { - setLanguageId(value); - return this; - } - - @Override - public LanguageRecord value2(String value) { - setName(value); - return this; - } - - @Override - public LanguageRecord value3(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public LanguageRecord values(Long value1, String value2, LocalDateTime value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java index d522fa5..0795ed9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/NicerButSlowerFilmListRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.enums.MpaaRating; import org.jooq.demo.java.db.tables.NicerButSlowerFilmList; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class NicerButSlowerFilmListRecord extends TableRecordImpl implements Record8 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class NicerButSlowerFilmListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -134,201 +131,6 @@ public String getActors() { return (String) get(7); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.FID; - } - - @Override - public Field field2() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.TITLE; - } - - @Override - public Field field3() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.DESCRIPTION; - } - - @Override - public Field field4() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.CATEGORY; - } - - @Override - public Field field5() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.PRICE; - } - - @Override - public Field field6() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.LENGTH; - } - - @Override - public Field field7() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.RATING; - } - - @Override - public Field field8() { - return NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.ACTORS; - } - - @Override - public Long component1() { - return getFid(); - } - - @Override - public String component2() { - return getTitle(); - } - - @Override - public String component3() { - return getDescription(); - } - - @Override - public String component4() { - return getCategory(); - } - - @Override - public BigDecimal component5() { - return getPrice(); - } - - @Override - public Short component6() { - return getLength(); - } - - @Override - public MpaaRating component7() { - return getRating(); - } - - @Override - public String component8() { - return getActors(); - } - - @Override - public Long value1() { - return getFid(); - } - - @Override - public String value2() { - return getTitle(); - } - - @Override - public String value3() { - return getDescription(); - } - - @Override - public String value4() { - return getCategory(); - } - - @Override - public BigDecimal value5() { - return getPrice(); - } - - @Override - public Short value6() { - return getLength(); - } - - @Override - public MpaaRating value7() { - return getRating(); - } - - @Override - public String value8() { - return getActors(); - } - - @Override - public NicerButSlowerFilmListRecord value1(Long value) { - setFid(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value2(String value) { - setTitle(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value3(String value) { - setDescription(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value4(String value) { - setCategory(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value5(BigDecimal value) { - setPrice(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value6(Short value) { - setLength(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value7(MpaaRating value) { - setRating(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord value8(String value) { - setActors(value); - return this; - } - - @Override - public NicerButSlowerFilmListRecord values(Long value1, String value2, String value3, String value4, BigDecimal value5, Short value6, MpaaRating value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java index af58ac9..7752fd9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_01Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_01; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentP2007_01Record extends TableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentP2007_01Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_01.PAYMENT_P2007_01.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_01.PAYMENT_P2007_01.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_01.PAYMENT_P2007_01.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_01.PAYMENT_P2007_01.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_01Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_01Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_01Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_01Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_01Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_01Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_01Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java index cdd8baa..6d3e26d 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_02Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_02; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentP2007_02Record extends TableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentP2007_02Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_02.PAYMENT_P2007_02.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_02.PAYMENT_P2007_02.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_02.PAYMENT_P2007_02.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_02.PAYMENT_P2007_02.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_02Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_02Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_02Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_02Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_02Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_02Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_02Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java index 2c88b0e..f15c9af 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_03Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_03; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentP2007_03Record extends TableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentP2007_03Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_03.PAYMENT_P2007_03.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_03.PAYMENT_P2007_03.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_03.PAYMENT_P2007_03.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_03.PAYMENT_P2007_03.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_03Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_03Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_03Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_03Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_03Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_03Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_03Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java index 2b72303..df3ac07 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_04Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_04; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentP2007_04Record extends TableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentP2007_04Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_04.PAYMENT_P2007_04.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_04.PAYMENT_P2007_04.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_04.PAYMENT_P2007_04.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_04.PAYMENT_P2007_04.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_04Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_04Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_04Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_04Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_04Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_04Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_04Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java index 4f27b92..c5abe79 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_05Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_05; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentP2007_05Record extends TableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentP2007_05Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_05.PAYMENT_P2007_05.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_05.PAYMENT_P2007_05.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_05.PAYMENT_P2007_05.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_05.PAYMENT_P2007_05.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_05Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_05Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_05Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_05Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_05Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_05Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_05Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java index 5e01898..7a8acfa 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentP2007_06Record.java @@ -7,9 +7,6 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.PaymentP2007_06; import org.jooq.impl.TableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentP2007_06Record extends TableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentP2007_06Record extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -106,157 +103,6 @@ public LocalDateTime getPaymentDate() { return (LocalDateTime) get(5); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_ID; - } - - @Override - public Field field2() { - return PaymentP2007_06.PAYMENT_P2007_06.CUSTOMER_ID; - } - - @Override - public Field field3() { - return PaymentP2007_06.PAYMENT_P2007_06.STAFF_ID; - } - - @Override - public Field field4() { - return PaymentP2007_06.PAYMENT_P2007_06.RENTAL_ID; - } - - @Override - public Field field5() { - return PaymentP2007_06.PAYMENT_P2007_06.AMOUNT; - } - - @Override - public Field field6() { - return PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentP2007_06Record value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentP2007_06Record value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentP2007_06Record value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentP2007_06Record value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentP2007_06Record value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentP2007_06Record value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentP2007_06Record values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java index 7ea6f4a..ffab446 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/PaymentRecord.java @@ -7,10 +7,7 @@ import java.math.BigDecimal; import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record6; -import org.jooq.Row6; import org.jooq.demo.java.db.tables.Payment; import org.jooq.impl.UpdatableRecordImpl; @@ -18,8 +15,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class PaymentRecord extends UpdatableRecordImpl implements Record6 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class PaymentRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -116,157 +113,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row6 fieldsRow() { - return (Row6) super.fieldsRow(); - } - - @Override - public Row6 valuesRow() { - return (Row6) super.valuesRow(); - } - - @Override - public Field field1() { - return Payment.PAYMENT.PAYMENT_ID; - } - - @Override - public Field field2() { - return Payment.PAYMENT.CUSTOMER_ID; - } - - @Override - public Field field3() { - return Payment.PAYMENT.STAFF_ID; - } - - @Override - public Field field4() { - return Payment.PAYMENT.RENTAL_ID; - } - - @Override - public Field field5() { - return Payment.PAYMENT.AMOUNT; - } - - @Override - public Field field6() { - return Payment.PAYMENT.PAYMENT_DATE; - } - - @Override - public Long component1() { - return getPaymentId(); - } - - @Override - public Long component2() { - return getCustomerId(); - } - - @Override - public Long component3() { - return getStaffId(); - } - - @Override - public Long component4() { - return getRentalId(); - } - - @Override - public BigDecimal component5() { - return getAmount(); - } - - @Override - public LocalDateTime component6() { - return getPaymentDate(); - } - - @Override - public Long value1() { - return getPaymentId(); - } - - @Override - public Long value2() { - return getCustomerId(); - } - - @Override - public Long value3() { - return getStaffId(); - } - - @Override - public Long value4() { - return getRentalId(); - } - - @Override - public BigDecimal value5() { - return getAmount(); - } - - @Override - public LocalDateTime value6() { - return getPaymentDate(); - } - - @Override - public PaymentRecord value1(Long value) { - setPaymentId(value); - return this; - } - - @Override - public PaymentRecord value2(Long value) { - setCustomerId(value); - return this; - } - - @Override - public PaymentRecord value3(Long value) { - setStaffId(value); - return this; - } - - @Override - public PaymentRecord value4(Long value) { - setRentalId(value); - return this; - } - - @Override - public PaymentRecord value5(BigDecimal value) { - setAmount(value); - return this; - } - - @Override - public PaymentRecord value6(LocalDateTime value) { - setPaymentDate(value); - return this; - } - - @Override - public PaymentRecord values(Long value1, Long value2, Long value3, Long value4, BigDecimal value5, LocalDateTime value6) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java index a5c0192..c3169d9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/RentalRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record7; -import org.jooq.Row7; import org.jooq.demo.java.db.tables.Rental; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class RentalRecord extends UpdatableRecordImpl implements Record7 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class RentalRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -129,179 +126,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row7 fieldsRow() { - return (Row7) super.fieldsRow(); - } - - @Override - public Row7 valuesRow() { - return (Row7) super.valuesRow(); - } - - @Override - public Field field1() { - return Rental.RENTAL.RENTAL_ID; - } - - @Override - public Field field2() { - return Rental.RENTAL.RENTAL_DATE; - } - - @Override - public Field field3() { - return Rental.RENTAL.INVENTORY_ID; - } - - @Override - public Field field4() { - return Rental.RENTAL.CUSTOMER_ID; - } - - @Override - public Field field5() { - return Rental.RENTAL.RETURN_DATE; - } - - @Override - public Field field6() { - return Rental.RENTAL.STAFF_ID; - } - - @Override - public Field field7() { - return Rental.RENTAL.LAST_UPDATE; - } - - @Override - public Long component1() { - return getRentalId(); - } - - @Override - public LocalDateTime component2() { - return getRentalDate(); - } - - @Override - public Long component3() { - return getInventoryId(); - } - - @Override - public Long component4() { - return getCustomerId(); - } - - @Override - public LocalDateTime component5() { - return getReturnDate(); - } - - @Override - public Long component6() { - return getStaffId(); - } - - @Override - public LocalDateTime component7() { - return getLastUpdate(); - } - - @Override - public Long value1() { - return getRentalId(); - } - - @Override - public LocalDateTime value2() { - return getRentalDate(); - } - - @Override - public Long value3() { - return getInventoryId(); - } - - @Override - public Long value4() { - return getCustomerId(); - } - - @Override - public LocalDateTime value5() { - return getReturnDate(); - } - - @Override - public Long value6() { - return getStaffId(); - } - - @Override - public LocalDateTime value7() { - return getLastUpdate(); - } - - @Override - public RentalRecord value1(Long value) { - setRentalId(value); - return this; - } - - @Override - public RentalRecord value2(LocalDateTime value) { - setRentalDate(value); - return this; - } - - @Override - public RentalRecord value3(Long value) { - setInventoryId(value); - return this; - } - - @Override - public RentalRecord value4(Long value) { - setCustomerId(value); - return this; - } - - @Override - public RentalRecord value5(LocalDateTime value) { - setReturnDate(value); - return this; - } - - @Override - public RentalRecord value6(Long value) { - setStaffId(value); - return this; - } - - @Override - public RentalRecord value7(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public RentalRecord values(Long value1, LocalDateTime value2, Long value3, Long value4, LocalDateTime value5, Long value6, LocalDateTime value7) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java index 1bea8c8..8dea2ed 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByFilmCategoryRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record2; -import org.jooq.Row2; import org.jooq.demo.java.db.tables.SalesByFilmCategory; import org.jooq.impl.TableRecordImpl; @@ -16,8 +13,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class SalesByFilmCategoryRecord extends TableRecordImpl implements Record2 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class SalesByFilmCategoryRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -49,69 +46,6 @@ public BigDecimal getTotalSales() { return (BigDecimal) get(1); } - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row2 fieldsRow() { - return (Row2) super.fieldsRow(); - } - - @Override - public Row2 valuesRow() { - return (Row2) super.valuesRow(); - } - - @Override - public Field field1() { - return SalesByFilmCategory.SALES_BY_FILM_CATEGORY.CATEGORY; - } - - @Override - public Field field2() { - return SalesByFilmCategory.SALES_BY_FILM_CATEGORY.TOTAL_SALES; - } - - @Override - public String component1() { - return getCategory(); - } - - @Override - public BigDecimal component2() { - return getTotalSales(); - } - - @Override - public String value1() { - return getCategory(); - } - - @Override - public BigDecimal value2() { - return getTotalSales(); - } - - @Override - public SalesByFilmCategoryRecord value1(String value) { - setCategory(value); - return this; - } - - @Override - public SalesByFilmCategoryRecord value2(BigDecimal value) { - setTotalSales(value); - return this; - } - - @Override - public SalesByFilmCategoryRecord values(String value1, BigDecimal value2) { - value1(value1); - value2(value2); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java index 94a0867..1dbf5a2 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/SalesByStoreRecord.java @@ -6,9 +6,6 @@ import java.math.BigDecimal; -import org.jooq.Field; -import org.jooq.Record3; -import org.jooq.Row3; import org.jooq.demo.java.db.tables.SalesByStore; import org.jooq.impl.TableRecordImpl; @@ -16,8 +13,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class SalesByStoreRecord extends TableRecordImpl implements Record3 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class SalesByStoreRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -63,91 +60,6 @@ public BigDecimal getTotalSales() { return (BigDecimal) get(2); } - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row3 fieldsRow() { - return (Row3) super.fieldsRow(); - } - - @Override - public Row3 valuesRow() { - return (Row3) super.valuesRow(); - } - - @Override - public Field field1() { - return SalesByStore.SALES_BY_STORE.STORE; - } - - @Override - public Field field2() { - return SalesByStore.SALES_BY_STORE.MANAGER; - } - - @Override - public Field field3() { - return SalesByStore.SALES_BY_STORE.TOTAL_SALES; - } - - @Override - public String component1() { - return getStore(); - } - - @Override - public String component2() { - return getManager(); - } - - @Override - public BigDecimal component3() { - return getTotalSales(); - } - - @Override - public String value1() { - return getStore(); - } - - @Override - public String value2() { - return getManager(); - } - - @Override - public BigDecimal value3() { - return getTotalSales(); - } - - @Override - public SalesByStoreRecord value1(String value) { - setStore(value); - return this; - } - - @Override - public SalesByStoreRecord value2(String value) { - setManager(value); - return this; - } - - @Override - public SalesByStoreRecord value3(BigDecimal value) { - setTotalSales(value); - return this; - } - - @Override - public SalesByStoreRecord values(String value1, String value2, BigDecimal value3) { - value1(value1); - value2(value2); - value3(value3); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java index 5a34f6c..8beffcf 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffListRecord.java @@ -4,9 +4,6 @@ package org.jooq.demo.java.db.tables.records; -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; import org.jooq.demo.java.db.tables.StaffList; import org.jooq.impl.TableRecordImpl; @@ -14,8 +11,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class StaffListRecord extends TableRecordImpl implements Record8 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class StaffListRecord extends TableRecordImpl { private static final long serialVersionUID = 1L; @@ -131,201 +128,6 @@ public Long getSid() { return (Long) get(7); } - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return StaffList.STAFF_LIST.ID; - } - - @Override - public Field field2() { - return StaffList.STAFF_LIST.NAME; - } - - @Override - public Field field3() { - return StaffList.STAFF_LIST.ADDRESS; - } - - @Override - public Field field4() { - return StaffList.STAFF_LIST.ZIP_CODE; - } - - @Override - public Field field5() { - return StaffList.STAFF_LIST.PHONE; - } - - @Override - public Field field6() { - return StaffList.STAFF_LIST.CITY; - } - - @Override - public Field field7() { - return StaffList.STAFF_LIST.COUNTRY; - } - - @Override - public Field field8() { - return StaffList.STAFF_LIST.SID; - } - - @Override - public Long component1() { - return getId(); - } - - @Override - public String component2() { - return getName(); - } - - @Override - public String component3() { - return getAddress(); - } - - @Override - public String component4() { - return getZipCode(); - } - - @Override - public String component5() { - return getPhone(); - } - - @Override - public String component6() { - return getCity(); - } - - @Override - public String component7() { - return getCountry(); - } - - @Override - public Long component8() { - return getSid(); - } - - @Override - public Long value1() { - return getId(); - } - - @Override - public String value2() { - return getName(); - } - - @Override - public String value3() { - return getAddress(); - } - - @Override - public String value4() { - return getZipCode(); - } - - @Override - public String value5() { - return getPhone(); - } - - @Override - public String value6() { - return getCity(); - } - - @Override - public String value7() { - return getCountry(); - } - - @Override - public Long value8() { - return getSid(); - } - - @Override - public StaffListRecord value1(Long value) { - setId(value); - return this; - } - - @Override - public StaffListRecord value2(String value) { - setName(value); - return this; - } - - @Override - public StaffListRecord value3(String value) { - setAddress(value); - return this; - } - - @Override - public StaffListRecord value4(String value) { - setZipCode(value); - return this; - } - - @Override - public StaffListRecord value5(String value) { - setPhone(value); - return this; - } - - @Override - public StaffListRecord value6(String value) { - setCity(value); - return this; - } - - @Override - public StaffListRecord value7(String value) { - setCountry(value); - return this; - } - - @Override - public StaffListRecord value8(Long value) { - setSid(value); - return this; - } - - @Override - public StaffListRecord values(Long value1, String value2, String value3, String value4, String value5, String value6, String value7, Long value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java index 49dd665..7ca350e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StaffRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record13; -import org.jooq.Row13; import org.jooq.demo.java.db.tables.Staff; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class StaffRecord extends UpdatableRecordImpl implements Record13 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class StaffRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -213,311 +210,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record13 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row13 fieldsRow() { - return (Row13) super.fieldsRow(); - } - - @Override - public Row13 valuesRow() { - return (Row13) super.valuesRow(); - } - - @Override - public Field field1() { - return Staff.STAFF.STAFF_ID; - } - - @Override - public Field field2() { - return Staff.STAFF.FIRST_NAME; - } - - @Override - public Field field3() { - return Staff.STAFF.LAST_NAME; - } - - @Override - public Field field4() { - return Staff.STAFF.ADDRESS_ID; - } - - @Override - public Field field5() { - return Staff.STAFF.EMAIL; - } - - @Override - public Field field6() { - return Staff.STAFF.STORE_ID; - } - - @Override - public Field field7() { - return Staff.STAFF.ACTIVE; - } - - @Override - public Field field8() { - return Staff.STAFF.USERNAME; - } - - @Override - public Field field9() { - return Staff.STAFF.PASSWORD; - } - - @Override - public Field field10() { - return Staff.STAFF.LAST_UPDATE; - } - - @Override - public Field field11() { - return Staff.STAFF.PICTURE; - } - - @Override - public Field field12() { - return Staff.STAFF.FULL_ADDRESS; - } - - @Override - public Field field13() { - return Staff.STAFF.FULL_NAME; - } - - @Override - public Long component1() { - return getStaffId(); - } - - @Override - public String component2() { - return getFirstName(); - } - - @Override - public String component3() { - return getLastName(); - } - - @Override - public Long component4() { - return getAddressId(); - } - - @Override - public String component5() { - return getEmail(); - } - - @Override - public Long component6() { - return getStoreId(); - } - - @Override - public Boolean component7() { - return getActive(); - } - - @Override - public String component8() { - return getUsername(); - } - - @Override - public String component9() { - return getPassword(); - } - - @Override - public LocalDateTime component10() { - return getLastUpdate(); - } - - @Override - public byte[] component11() { - return getPicture(); - } - - @Override - public String component12() { - return getFullAddress(); - } - - @Override - public String component13() { - return getFullName(); - } - - @Override - public Long value1() { - return getStaffId(); - } - - @Override - public String value2() { - return getFirstName(); - } - - @Override - public String value3() { - return getLastName(); - } - - @Override - public Long value4() { - return getAddressId(); - } - - @Override - public String value5() { - return getEmail(); - } - - @Override - public Long value6() { - return getStoreId(); - } - - @Override - public Boolean value7() { - return getActive(); - } - - @Override - public String value8() { - return getUsername(); - } - - @Override - public String value9() { - return getPassword(); - } - - @Override - public LocalDateTime value10() { - return getLastUpdate(); - } - - @Override - public byte[] value11() { - return getPicture(); - } - - @Override - public String value12() { - return getFullAddress(); - } - - @Override - public String value13() { - return getFullName(); - } - - @Override - public StaffRecord value1(Long value) { - setStaffId(value); - return this; - } - - @Override - public StaffRecord value2(String value) { - setFirstName(value); - return this; - } - - @Override - public StaffRecord value3(String value) { - setLastName(value); - return this; - } - - @Override - public StaffRecord value4(Long value) { - setAddressId(value); - return this; - } - - @Override - public StaffRecord value5(String value) { - setEmail(value); - return this; - } - - @Override - public StaffRecord value6(Long value) { - setStoreId(value); - return this; - } - - @Override - public StaffRecord value7(Boolean value) { - setActive(value); - return this; - } - - @Override - public StaffRecord value8(String value) { - setUsername(value); - return this; - } - - @Override - public StaffRecord value9(String value) { - setPassword(value); - return this; - } - - @Override - public StaffRecord value10(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public StaffRecord value11(byte[] value) { - setPicture(value); - return this; - } - - @Override - public StaffRecord value12(String value) { - setFullAddress(value); - return this; - } - - @Override - public StaffRecord value13(String value) { - setFullName(value); - return this; - } - - @Override - public StaffRecord values(Long value1, String value2, String value3, Long value4, String value5, Long value6, Boolean value7, String value8, String value9, LocalDateTime value10, byte[] value11, String value12, String value13) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - value9(value9); - value10(value10); - value11(value11); - value12(value12); - value13(value13); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java index f8f0c10..0a7103a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/main/java/org/jooq/demo/java/db/tables/records/StoreRecord.java @@ -6,10 +6,7 @@ import java.time.LocalDateTime; -import org.jooq.Field; import org.jooq.Record1; -import org.jooq.Record5; -import org.jooq.Row5; import org.jooq.demo.java.db.tables.Store; import org.jooq.impl.UpdatableRecordImpl; @@ -17,8 +14,8 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class StoreRecord extends UpdatableRecordImpl implements Record5 { +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) +public class StoreRecord extends UpdatableRecordImpl { private static final long serialVersionUID = 1L; @@ -101,135 +98,6 @@ public Record1 key() { return (Record1) super.key(); } - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row5 fieldsRow() { - return (Row5) super.fieldsRow(); - } - - @Override - public Row5 valuesRow() { - return (Row5) super.valuesRow(); - } - - @Override - public Field field1() { - return Store.STORE.STORE_ID; - } - - @Override - public Field field2() { - return Store.STORE.MANAGER_STAFF_ID; - } - - @Override - public Field field3() { - return Store.STORE.ADDRESS_ID; - } - - @Override - public Field field4() { - return Store.STORE.LAST_UPDATE; - } - - @Override - public Field field5() { - return Store.STORE.FULL_ADDRESS; - } - - @Override - public Long component1() { - return getStoreId(); - } - - @Override - public Long component2() { - return getManagerStaffId(); - } - - @Override - public Long component3() { - return getAddressId(); - } - - @Override - public LocalDateTime component4() { - return getLastUpdate(); - } - - @Override - public String component5() { - return getFullAddress(); - } - - @Override - public Long value1() { - return getStoreId(); - } - - @Override - public Long value2() { - return getManagerStaffId(); - } - - @Override - public Long value3() { - return getAddressId(); - } - - @Override - public LocalDateTime value4() { - return getLastUpdate(); - } - - @Override - public String value5() { - return getFullAddress(); - } - - @Override - public StoreRecord value1(Long value) { - setStoreId(value); - return this; - } - - @Override - public StoreRecord value2(Long value) { - setManagerStaffId(value); - return this; - } - - @Override - public StoreRecord value3(Long value) { - setAddressId(value); - return this; - } - - @Override - public StoreRecord value4(LocalDateTime value) { - setLastUpdate(value); - return this; - } - - @Override - public StoreRecord value5(String value) { - setFullAddress(value); - return this; - } - - @Override - public StoreRecord values(Long value1, Long value2, Long value3, LocalDateTime value4, String value5) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - return this; - } - // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- diff --git a/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java b/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java index 071ee2c..f914814 100644 --- a/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java +++ b/jOOQ-demo-pro/jOOQ-demo-java/src/test/java/org/jooq/demo/java/Demo14Mocking.java @@ -34,7 +34,10 @@ public void mockingJDBCProgrammatically() throws SQLException { // A MockDataProvider is a database simulation that can intercept all database calls at the JDBC level MockDataProvider p = c -> new MockResult[] { c.sql().contains("select") - ? new MockResult(ctx.newRecord(ACTOR).values(1L, "A", "A", null)) + ? new MockResult(ctx.newRecord(ACTOR) + .with(ACTOR.ACTOR_ID, 1L) + .with(ACTOR.FIRST_NAME, "A") + .with(ACTOR.LAST_NAME, "A")) : new MockResult(0) }; diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/pom.xml b/jOOQ-demo-pro/jOOQ-demo-kotlin/pom.xml index 1317dac..f1bb63e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/pom.xml +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/pom.xml @@ -6,7 +6,7 @@ org.jooq.trial jooq-demo - 3.18.7 + 3.19.1 jooq-demo-kotlin diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt index 99d51de..e45347a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/DefaultCatalog.kt @@ -34,10 +34,10 @@ open class DefaultCatalog : CatalogImpl("") { ) /** - * A reference to the 3.18 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.18. You can turn off the generation of this reference + * release, namely: 3.19. You can turn off the generation of this reference * by specifying /configuration/generator/generate/jooqVersionReference */ - private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18 + private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19 } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/Public.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/Public.kt index 5faedba..e22cc0d 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/Public.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/Public.kt @@ -14,6 +14,7 @@ import org.jooq.Domain import org.jooq.Field import org.jooq.Result import org.jooq.Table +import org.jooq.Trigger import org.jooq.demo.kotlin.db.domains.YEAR import org.jooq.demo.kotlin.db.tables.Actor import org.jooq.demo.kotlin.db.tables.ActorInfo @@ -49,6 +50,8 @@ import org.jooq.demo.kotlin.db.tables.Store import org.jooq.demo.kotlin.db.tables.records.CustomerRecord import org.jooq.demo.kotlin.db.tables.records.FilmInStockRecord import org.jooq.demo.kotlin.db.tables.records.FilmNotInStockRecord +import org.jooq.demo.kotlin.db.triggers.FILM_FULLTEXT_TRIGGER +import org.jooq.demo.kotlin.db.triggers.LAST_UPDATED import org.jooq.impl.SchemaImpl @@ -328,6 +331,11 @@ open class Public : SchemaImpl("public", DefaultCatalog.DEFAULT_CATALOG) { YEAR ) + override fun getTriggers(): List = listOf( + FILM_FULLTEXT_TRIGGER, + LAST_UPDATED + ) + override fun getTables(): List> = listOf( Actor.ACTOR, ActorInfo.ACTOR_INFO, 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 01943e4..87f90e8 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 @@ -5,28 +5,38 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions +import org.jooq.Trigger import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_ACTOR_LAST_NAME import org.jooq.demo.kotlin.db.keys.ACTOR_PKEY +import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath +import org.jooq.demo.kotlin.db.tables.FilmActor.FilmActorPath import org.jooq.demo.kotlin.db.tables.records.ActorRecord +import org.jooq.demo.kotlin.db.triggers.LAST_UPDATED import org.jooq.impl.DSL import org.jooq.impl.Internal import org.jooq.impl.SQLDataType @@ -39,19 +49,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Actor( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -86,8 +100,9 @@ open class Actor( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.actor table reference @@ -104,14 +119,49 @@ open class Actor( */ constructor(): this(DSL.name("actor"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, ACTOR, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, ACTOR, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class ActorPath : Actor, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): ActorPath = ActorPath(DSL.name(alias), this) + override fun `as`(alias: Name): ActorPath = ActorPath(alias, this) + override fun `as`(alias: Table<*>): ActorPath = ActorPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_ACTOR_LAST_NAME) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = ACTOR_PKEY + + private lateinit var _filmActor: FilmActorPath + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + fun filmActor(): FilmActorPath { + if (!this::_filmActor.isInitialized) + _filmActor = FilmActorPath(this, null, FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY.inverseKey) + + return _filmActor; + } + + val filmActor: FilmActorPath + get(): FilmActorPath = filmActor() + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + val film: FilmPath + get(): FilmPath = filmActor().film() + override fun getTriggers(): List = listOf(LAST_UPDATED) override fun `as`(alias: String): Actor = Actor(DSL.name(alias), this) override fun `as`(alias: Name): Actor = Actor(alias, this) - override fun `as`(alias: Table<*>): Actor = Actor(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Actor = Actor(alias.qualifiedName, this) /** * Rename this table @@ -126,21 +176,55 @@ open class Actor( /** * Rename this table */ - override fun rename(name: Table<*>): Actor = Actor(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Actor = Actor(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Actor = Actor(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Actor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Actor = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Actor = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Actor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Actor = where(DSL.notExists(select)) } 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 38b1182..947eaee 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 @@ -4,23 +4,26 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function +import kotlin.collections.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.ActorInfoRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -31,15 +34,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class ActorInfo( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -58,7 +64,8 @@ open class ActorInfo( LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name; - """) + """), + where, ) { companion object { @@ -93,8 +100,9 @@ open class ActorInfo( */ val FILM_INFO: TableField = createField(DSL.name("film_info"), SQLDataType.CLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.actor_info table reference @@ -110,12 +118,10 @@ open class ActorInfo( * Create a public.actor_info table reference */ constructor(): this(DSL.name("actor_info"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, ACTOR_INFO, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): ActorInfo = ActorInfo(DSL.name(alias), this) override fun `as`(alias: Name): ActorInfo = ActorInfo(alias, this) - override fun `as`(alias: Table<*>): ActorInfo = ActorInfo(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): ActorInfo = ActorInfo(alias.qualifiedName, this) /** * Rename this table @@ -130,21 +136,55 @@ open class ActorInfo( /** * Rename this table */ - override fun rename(name: Table<*>): ActorInfo = ActorInfo(name.getQualifiedName(), null) + override fun rename(name: Table<*>): ActorInfo = ActorInfo(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): ActorInfo = ActorInfo(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): ActorInfo = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): ActorInfo = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): ActorInfo = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): ActorInfo = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): ActorInfo = where(DSL.notExists(select)) } 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 1343bdb..0c50e63 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 @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -27,6 +32,13 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_FK_CITY_ID import org.jooq.demo.kotlin.db.keys.ADDRESS_PKEY import org.jooq.demo.kotlin.db.keys.ADDRESS__ADDRESS_CITY_ID_FKEY +import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY +import org.jooq.demo.kotlin.db.keys.STAFF__STAFF_ADDRESS_ID_FKEY +import org.jooq.demo.kotlin.db.keys.STORE__STORE_ADDRESS_ID_FKEY +import org.jooq.demo.kotlin.db.tables.City.CityPath +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.AddressRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -40,19 +52,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Address( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -107,8 +123,9 @@ open class Address( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.address table reference @@ -125,30 +142,87 @@ open class Address( */ constructor(): this(DSL.name("address"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, ADDRESS, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, ADDRESS, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class AddressPath : Address, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): AddressPath = AddressPath(DSL.name(alias), this) + override fun `as`(alias: Name): AddressPath = AddressPath(alias, this) + override fun `as`(alias: Table<*>): AddressPath = AddressPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_CITY_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = ADDRESS_PKEY override fun getReferences(): List> = listOf(ADDRESS__ADDRESS_CITY_ID_FKEY) - private lateinit var _city: City + private lateinit var _city: CityPath /** * Get the implicit join path to the public.city table. */ - fun city(): City { + fun city(): CityPath { if (!this::_city.isInitialized) - _city = City(this, ADDRESS__ADDRESS_CITY_ID_FKEY) + _city = CityPath(this, ADDRESS__ADDRESS_CITY_ID_FKEY, null) return _city; } - val city: City - get(): City = city() + val city: CityPath + get(): CityPath = city() + + private lateinit var _customer: CustomerPath + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + fun customer(): CustomerPath { + if (!this::_customer.isInitialized) + _customer = CustomerPath(this, null, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY.inverseKey) + + return _customer; + } + + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath + + /** + * Get the implicit to-many join path to the public.staff table + */ + fun staff(): StaffPath { + if (!this::_staff.isInitialized) + _staff = StaffPath(this, null, STAFF__STAFF_ADDRESS_ID_FKEY.inverseKey) + + return _staff; + } + + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _store: StorePath + + /** + * Get the implicit to-many join path to the public.store table + */ + fun store(): StorePath { + if (!this::_store.isInitialized) + _store = StorePath(this, null, STORE__STORE_ADDRESS_ID_FKEY.inverseKey) + + return _store; + } + + val store: StorePath + get(): StorePath = store() override fun `as`(alias: String): Address = Address(DSL.name(alias), this) override fun `as`(alias: Name): Address = Address(alias, this) - override fun `as`(alias: Table<*>): Address = Address(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Address = Address(alias.qualifiedName, this) /** * Rename this table @@ -163,21 +237,55 @@ open class Address( /** * Rename this table */ - override fun rename(name: Table<*>): Address = Address(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Address = Address(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Address = Address(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Address = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Address = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Address = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Address = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, Long?, String?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Address = where(DSL.notExists(select)) } 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 b56f3c1..c8777c7 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 @@ -5,23 +5,32 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.keys.CATEGORY_PKEY +import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath +import org.jooq.demo.kotlin.db.tables.FilmCategory.FilmCategoryPath import org.jooq.demo.kotlin.db.tables.records.CategoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -35,19 +44,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Category( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -77,8 +90,9 @@ open class Category( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.category table reference @@ -95,13 +109,47 @@ open class Category( */ constructor(): this(DSL.name("category"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CATEGORY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, CATEGORY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CategoryPath : Category, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CategoryPath = CategoryPath(DSL.name(alias), this) + override fun `as`(alias: Name): CategoryPath = CategoryPath(alias, this) + override fun `as`(alias: Table<*>): CategoryPath = CategoryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = CATEGORY_PKEY + + private lateinit var _filmCategory: FilmCategoryPath + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + fun filmCategory(): FilmCategoryPath { + if (!this::_filmCategory.isInitialized) + _filmCategory = FilmCategoryPath(this, null, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY.inverseKey) + + return _filmCategory; + } + + val filmCategory: FilmCategoryPath + get(): FilmCategoryPath = filmCategory() + + /** + * Get the implicit many-to-many join path to the public.film + * table + */ + val film: FilmPath + get(): FilmPath = filmCategory().film() override fun `as`(alias: String): Category = Category(DSL.name(alias), this) override fun `as`(alias: Name): Category = Category(alias, this) - override fun `as`(alias: Table<*>): Category = Category(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Category = Category(alias.qualifiedName, this) /** * Rename this table @@ -116,21 +164,55 @@ open class Category( /** * Rename this table */ - override fun rename(name: Table<*>): Category = Category(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Category = Category(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Category = Category(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Category = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): Category = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Category = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Category = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Category = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Category = where(DSL.notExists(select)) } 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 d00aa43..47a4982 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 @@ -5,28 +5,36 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_FK_COUNTRY_ID +import org.jooq.demo.kotlin.db.keys.ADDRESS__ADDRESS_CITY_ID_FKEY import org.jooq.demo.kotlin.db.keys.CITY_PKEY import org.jooq.demo.kotlin.db.keys.CITY__CITY_COUNTRY_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Country.CountryPath import org.jooq.demo.kotlin.db.tables.records.CityRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -40,19 +48,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class City( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -87,8 +99,9 @@ open class City( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.city table reference @@ -105,30 +118,57 @@ open class City( */ constructor(): this(DSL.name("city"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CITY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, CITY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CityPath : City, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CityPath = CityPath(DSL.name(alias), this) + override fun `as`(alias: Name): CityPath = CityPath(alias, this) + override fun `as`(alias: Table<*>): CityPath = CityPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_COUNTRY_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = CITY_PKEY override fun getReferences(): List> = listOf(CITY__CITY_COUNTRY_ID_FKEY) - private lateinit var _country: Country + private lateinit var _country: CountryPath /** * Get the implicit join path to the public.country table. */ - fun country(): Country { + fun country(): CountryPath { if (!this::_country.isInitialized) - _country = Country(this, CITY__CITY_COUNTRY_ID_FKEY) + _country = CountryPath(this, CITY__CITY_COUNTRY_ID_FKEY, null) return _country; } - val country: Country - get(): Country = country() + val country: CountryPath + get(): CountryPath = country() + + private lateinit var _address: AddressPath + + /** + * Get the implicit to-many join path to the public.address + * table + */ + fun address(): AddressPath { + if (!this::_address.isInitialized) + _address = AddressPath(this, null, ADDRESS__ADDRESS_CITY_ID_FKEY.inverseKey) + + return _address; + } + + val address: AddressPath + get(): AddressPath = address() override fun `as`(alias: String): City = City(DSL.name(alias), this) override fun `as`(alias: Name): City = City(alias, this) - override fun `as`(alias: Table<*>): City = City(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): City = City(alias.qualifiedName, this) /** * Rename this table @@ -143,21 +183,55 @@ open class City( /** * Rename this table */ - override fun rename(name: Table<*>): City = City(name.getQualifiedName(), null) + override fun rename(name: Table<*>): City = City(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): City = City(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): City = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): City = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): City = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): City = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): City = where(DSL.notExists(select)) } 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 5d1792c..70696ff 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 @@ -5,23 +5,31 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.keys.CITY__CITY_COUNTRY_ID_FKEY import org.jooq.demo.kotlin.db.keys.COUNTRY_PKEY +import org.jooq.demo.kotlin.db.tables.City.CityPath import org.jooq.demo.kotlin.db.tables.records.CountryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -35,19 +43,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Country( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -77,8 +89,9 @@ open class Country( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.country table reference @@ -95,13 +108,39 @@ open class Country( */ constructor(): this(DSL.name("country"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, COUNTRY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, COUNTRY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CountryPath : Country, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CountryPath = CountryPath(DSL.name(alias), this) + override fun `as`(alias: Name): CountryPath = CountryPath(alias, this) + override fun `as`(alias: Table<*>): CountryPath = CountryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = COUNTRY_PKEY + + private lateinit var _city: CityPath + + /** + * Get the implicit to-many join path to the public.city table + */ + fun city(): CityPath { + if (!this::_city.isInitialized) + _city = CityPath(this, null, CITY__CITY_COUNTRY_ID_FKEY.inverseKey) + + return _city; + } + + val city: CityPath + get(): CityPath = city() override fun `as`(alias: String): Country = Country(DSL.name(alias), this) override fun `as`(alias: Name): Country = Country(alias, this) - override fun `as`(alias: Table<*>): Country = Country(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Country = Country(alias.qualifiedName, this) /** * Rename this table @@ -116,21 +155,55 @@ open class Country( /** * Rename this table */ - override fun rename(name: Table<*>): Country = Country(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Country = Country(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Country = Country(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Country = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Country = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Country = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Country = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Country = where(DSL.notExists(select)) } 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 0be5998..53a521f 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 @@ -6,20 +6,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDate import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row10 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -31,6 +36,24 @@ import org.jooq.demo.kotlin.db.indexes.IDX_LAST_NAME import org.jooq.demo.kotlin.db.keys.CUSTOMER_PKEY import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Payment.PaymentPath +import org.jooq.demo.kotlin.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.CustomerRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -44,19 +67,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Customer( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -121,8 +148,9 @@ open class Customer( */ val ACTIVE: TableField = createField(DSL.name("active"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.customer table reference @@ -139,44 +167,184 @@ open class Customer( */ constructor(): this(DSL.name("customer"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CUSTOMER, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, CUSTOMER, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class CustomerPath : Customer, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): CustomerPath = CustomerPath(DSL.name(alias), this) + override fun `as`(alias: Name): CustomerPath = CustomerPath(alias, this) + override fun `as`(alias: Table<*>): CustomerPath = CustomerPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_ADDRESS_ID, IDX_FK_STORE_ID, IDX_LAST_NAME) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = CUSTOMER_PKEY override fun getReferences(): List> = listOf(CUSTOMER__CUSTOMER_STORE_ID_FKEY, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY) - private lateinit var _store: Store - private lateinit var _address: Address + private lateinit var _store: StorePath /** * Get the implicit join path to the public.store table. */ - fun store(): Store { + fun store(): StorePath { if (!this::_store.isInitialized) - _store = Store(this, CUSTOMER__CUSTOMER_STORE_ID_FKEY) + _store = StorePath(this, CUSTOMER__CUSTOMER_STORE_ID_FKEY, null) return _store; } - val store: Store - get(): Store = store() + val store: StorePath + get(): StorePath = store() + + private lateinit var _address: AddressPath /** * Get the implicit join path to the public.address table. */ - fun address(): Address { + fun address(): AddressPath { if (!this::_address.isInitialized) - _address = Address(this, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY) + _address = AddressPath(this, CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null) return _address; } - val address: Address - get(): Address = address() + val address: AddressPath + get(): AddressPath = address() + + private lateinit var _payment: PaymentPath + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + fun payment(): PaymentPath { + if (!this::_payment.isInitialized) + _payment = PaymentPath(this, null, PAYMENT__PAYMENT_CUSTOMER_ID_FKEY.inverseKey) + + return _payment; + } + + val payment: PaymentPath + get(): PaymentPath = payment() + + private lateinit var _paymentP2007_01: PaymentP2007_01Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + fun paymentP2007_01(): PaymentP2007_01Path { + if (!this::_paymentP2007_01.isInitialized) + _paymentP2007_01 = PaymentP2007_01Path(this, null, PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_01; + } + + val paymentP2007_01: PaymentP2007_01Path + get(): PaymentP2007_01Path = paymentP2007_01() + + private lateinit var _paymentP2007_02: PaymentP2007_02Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + fun paymentP2007_02(): PaymentP2007_02Path { + if (!this::_paymentP2007_02.isInitialized) + _paymentP2007_02 = PaymentP2007_02Path(this, null, PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_02; + } + + val paymentP2007_02: PaymentP2007_02Path + get(): PaymentP2007_02Path = paymentP2007_02() + + private lateinit var _paymentP2007_03: PaymentP2007_03Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + fun paymentP2007_03(): PaymentP2007_03Path { + if (!this::_paymentP2007_03.isInitialized) + _paymentP2007_03 = PaymentP2007_03Path(this, null, PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_03; + } + + val paymentP2007_03: PaymentP2007_03Path + get(): PaymentP2007_03Path = paymentP2007_03() + + private lateinit var _paymentP2007_04: PaymentP2007_04Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + fun paymentP2007_04(): PaymentP2007_04Path { + if (!this::_paymentP2007_04.isInitialized) + _paymentP2007_04 = PaymentP2007_04Path(this, null, PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_04; + } + + val paymentP2007_04: PaymentP2007_04Path + get(): PaymentP2007_04Path = paymentP2007_04() + + private lateinit var _paymentP2007_05: PaymentP2007_05Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + fun paymentP2007_05(): PaymentP2007_05Path { + if (!this::_paymentP2007_05.isInitialized) + _paymentP2007_05 = PaymentP2007_05Path(this, null, PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_05; + } + + val paymentP2007_05: PaymentP2007_05Path + get(): PaymentP2007_05Path = paymentP2007_05() + + private lateinit var _paymentP2007_06: PaymentP2007_06Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + fun paymentP2007_06(): PaymentP2007_06Path { + if (!this::_paymentP2007_06.isInitialized) + _paymentP2007_06 = PaymentP2007_06Path(this, null, PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY.inverseKey) + + return _paymentP2007_06; + } + + val paymentP2007_06: PaymentP2007_06Path + get(): PaymentP2007_06Path = paymentP2007_06() + + private lateinit var _rental: RentalPath + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + fun rental(): RentalPath { + if (!this::_rental.isInitialized) + _rental = RentalPath(this, null, RENTAL__RENTAL_CUSTOMER_ID_FKEY.inverseKey) + + return _rental; + } + + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Customer = Customer(DSL.name(alias), this) override fun `as`(alias: Name): Customer = Customer(alias, this) - override fun `as`(alias: Table<*>): Customer = Customer(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Customer = Customer(alias.qualifiedName, this) /** * Rename this table @@ -191,21 +359,55 @@ open class Customer( /** * Rename this table */ - override fun rename(name: Table<*>): Customer = Customer(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Customer = Customer(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Customer = Customer(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Customer = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row10 = super.fieldsRow() as Row10 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Customer = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Customer = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Customer = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Customer = where(DSL.notExists(select)) } 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 bc22754..a818b7f 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 @@ -4,23 +4,26 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function +import kotlin.collections.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row9 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.CustomerListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -31,15 +34,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class CustomerList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -60,7 +66,8 @@ open class CustomerList( JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where, ) { companion object { @@ -120,8 +127,9 @@ open class CustomerList( */ val SID: TableField = createField(DSL.name("sid"), SQLDataType.BIGINT, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.customer_list table reference @@ -137,12 +145,10 @@ open class CustomerList( * Create a public.customer_list table reference */ constructor(): this(DSL.name("customer_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, CUSTOMER_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): CustomerList = CustomerList(DSL.name(alias), this) override fun `as`(alias: Name): CustomerList = CustomerList(alias, this) - override fun `as`(alias: Table<*>): CustomerList = CustomerList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): CustomerList = CustomerList(alias.qualifiedName, this) /** * Rename this table @@ -157,21 +163,55 @@ open class CustomerList( /** * Rename this table */ - override fun rename(name: Table<*>): CustomerList = CustomerList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): CustomerList = CustomerList(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): CustomerList = CustomerList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): CustomerList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): CustomerList = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row9 = super.fieldsRow() as Row9 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): CustomerList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): CustomerList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): CustomerList = where(DSL.notExists(select)) } 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 40e5998..f28c1b9 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 @@ -6,35 +6,53 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row14 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions +import org.jooq.Trigger import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.domains.YEAR import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.indexes.FILM_FULLTEXT_IDX import org.jooq.demo.kotlin.db.indexes.IDX_FK_LANGUAGE_ID import org.jooq.demo.kotlin.db.indexes.IDX_FK_ORIGINAL_LANGUAGE_ID import org.jooq.demo.kotlin.db.indexes.IDX_TITLE +import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM_PKEY import org.jooq.demo.kotlin.db.keys.FILM__FILM_LANGUAGE_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Actor.ActorPath +import org.jooq.demo.kotlin.db.tables.Category.CategoryPath +import org.jooq.demo.kotlin.db.tables.FilmActor.FilmActorPath +import org.jooq.demo.kotlin.db.tables.FilmCategory.FilmCategoryPath +import org.jooq.demo.kotlin.db.tables.Inventory.InventoryPath +import org.jooq.demo.kotlin.db.tables.Language.LanguagePath import org.jooq.demo.kotlin.db.tables.records.FilmRecord +import org.jooq.demo.kotlin.db.triggers.FILM_FULLTEXT_TRIGGER import org.jooq.impl.DSL +import org.jooq.impl.DefaultDataType import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -46,19 +64,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Film( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -91,7 +113,7 @@ open class Film( /** * The column public.film.release_year. */ - val RELEASE_YEAR: TableField = createField(DSL.name("release_year"), org.jooq.demo.kotlin.db.domains.YEAR.getDataType(), this, "") + val RELEASE_YEAR: TableField = createField(DSL.name("release_year"), YEAR.getDataType(), this, "") /** * The column public.film.language_id. @@ -126,7 +148,7 @@ open class Film( /** * The column public.film.rating. */ - val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(org.jooq.demo.kotlin.db.enums.MpaaRating::class.java), this, "") + val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(MpaaRating::class.java), this, "") /** * The column public.film.last_update. @@ -138,10 +160,11 @@ open class Film( */ val SPECIAL_FEATURES: TableField?> = createField(DSL.name("special_features"), SQLDataType.CLOB.array(), this, "") @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - val FULLTEXT: TableField = createField(DSL.name("fulltext"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, "") + val FULLTEXT: TableField = createField(DSL.name("fulltext"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film table reference @@ -158,46 +181,121 @@ open class Film( */ constructor(): this(DSL.name("film"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, FILM, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class FilmPath : Film, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): FilmPath = FilmPath(DSL.name(alias), this) + override fun `as`(alias: Name): FilmPath = FilmPath(alias, this) + override fun `as`(alias: Table<*>): FilmPath = FilmPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(FILM_FULLTEXT_IDX, IDX_FK_LANGUAGE_ID, IDX_FK_ORIGINAL_LANGUAGE_ID, IDX_TITLE) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = FILM_PKEY override fun getReferences(): List> = listOf(FILM__FILM_LANGUAGE_ID_FKEY, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY) - private lateinit var _filmLanguageIdFkey: Language - private lateinit var _filmOriginalLanguageIdFkey: Language + private lateinit var _filmLanguageIdFkey: LanguagePath /** * Get the implicit join path to the public.language table, via * the film_language_id_fkey key. */ - fun filmLanguageIdFkey(): Language { + fun filmLanguageIdFkey(): LanguagePath { if (!this::_filmLanguageIdFkey.isInitialized) - _filmLanguageIdFkey = Language(this, FILM__FILM_LANGUAGE_ID_FKEY) + _filmLanguageIdFkey = LanguagePath(this, FILM__FILM_LANGUAGE_ID_FKEY, null) return _filmLanguageIdFkey; } - val filmLanguageIdFkey: Language - get(): Language = filmLanguageIdFkey() + val filmLanguageIdFkey: LanguagePath + get(): LanguagePath = filmLanguageIdFkey() + + private lateinit var _filmOriginalLanguageIdFkey: LanguagePath /** * Get the implicit join path to the public.language table, via * the film_original_language_id_fkey key. */ - fun filmOriginalLanguageIdFkey(): Language { + fun filmOriginalLanguageIdFkey(): LanguagePath { if (!this::_filmOriginalLanguageIdFkey.isInitialized) - _filmOriginalLanguageIdFkey = Language(this, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY) + _filmOriginalLanguageIdFkey = LanguagePath(this, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null) return _filmOriginalLanguageIdFkey; } - val filmOriginalLanguageIdFkey: Language - get(): Language = filmOriginalLanguageIdFkey() + val filmOriginalLanguageIdFkey: LanguagePath + get(): LanguagePath = filmOriginalLanguageIdFkey() + + private lateinit var _filmActor: FilmActorPath + + /** + * Get the implicit to-many join path to the public.film_actor + * table + */ + fun filmActor(): FilmActorPath { + if (!this::_filmActor.isInitialized) + _filmActor = FilmActorPath(this, null, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY.inverseKey) + + return _filmActor; + } + + val filmActor: FilmActorPath + get(): FilmActorPath = filmActor() + + private lateinit var _filmCategory: FilmCategoryPath + + /** + * Get the implicit to-many join path to the + * public.film_category table + */ + fun filmCategory(): FilmCategoryPath { + if (!this::_filmCategory.isInitialized) + _filmCategory = FilmCategoryPath(this, null, FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY.inverseKey) + + return _filmCategory; + } + + val filmCategory: FilmCategoryPath + get(): FilmCategoryPath = filmCategory() + + private lateinit var _inventory: InventoryPath + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + fun inventory(): InventoryPath { + if (!this::_inventory.isInitialized) + _inventory = InventoryPath(this, null, INVENTORY__INVENTORY_FILM_ID_FKEY.inverseKey) + + return _inventory; + } + + val inventory: InventoryPath + get(): InventoryPath = inventory() + + /** + * Get the implicit many-to-many join path to the public.actor + * table + */ + val actor: ActorPath + get(): ActorPath = filmActor().actor() + + /** + * Get the implicit many-to-many join path to the + * public.category table + */ + val category: CategoryPath + get(): CategoryPath = filmCategory().category() + override fun getTriggers(): List = listOf(FILM_FULLTEXT_TRIGGER) override fun `as`(alias: String): Film = Film(DSL.name(alias), this) override fun `as`(alias: Name): Film = Film(alias, this) - override fun `as`(alias: Table<*>): Film = Film(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Film = Film(alias.qualifiedName, this) /** * Rename this table @@ -212,21 +310,55 @@ open class Film( /** * Rename this table */ - override fun rename(name: Table<*>): Film = Film(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Film = Film(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Film = Film(qualifiedName, if (aliased()) this else null, condition) - // ------------------------------------------------------------------------- - // Row14 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row14?, Any?> = super.fieldsRow() as Row14?, Any?> + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Film = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Film = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Film = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, Int?, Long?, Long?, Short?, BigDecimal?, Short?, BigDecimal?, MpaaRating?, LocalDateTime?, Array?, Any?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Film = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, Int?, Long?, Long?, Short?, BigDecimal?, Short?, BigDecimal?, MpaaRating?, LocalDateTime?, Array?, Any?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Film = where(DSL.notExists(select)) } 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 15edff1..3d788b0 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 @@ -5,19 +5,24 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -27,6 +32,8 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_FILM_ID import org.jooq.demo.kotlin.db.keys.FILM_ACTOR_PKEY import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Actor.ActorPath +import org.jooq.demo.kotlin.db.tables.Film.FilmPath import org.jooq.demo.kotlin.db.tables.records.FilmActorRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -40,19 +47,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmActor( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -82,8 +93,9 @@ open class FilmActor( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film_actor table reference @@ -100,43 +112,55 @@ open class FilmActor( */ constructor(): this(DSL.name("film_actor"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM_ACTOR, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, FILM_ACTOR, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class FilmActorPath : FilmActor, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): FilmActorPath = FilmActorPath(DSL.name(alias), this) + override fun `as`(alias: Name): FilmActorPath = FilmActorPath(alias, this) + override fun `as`(alias: Table<*>): FilmActorPath = FilmActorPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_FILM_ID) override fun getPrimaryKey(): UniqueKey = FILM_ACTOR_PKEY override fun getReferences(): List> = listOf(FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY) - private lateinit var _actor: Actor - private lateinit var _film: Film + private lateinit var _actor: ActorPath /** * Get the implicit join path to the public.actor table. */ - fun actor(): Actor { + fun actor(): ActorPath { if (!this::_actor.isInitialized) - _actor = Actor(this, FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY) + _actor = ActorPath(this, FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, null) return _actor; } - val actor: Actor - get(): Actor = actor() + val actor: ActorPath + get(): ActorPath = actor() + + private lateinit var _film: FilmPath /** * Get the implicit join path to the public.film table. */ - fun film(): Film { + fun film(): FilmPath { if (!this::_film.isInitialized) - _film = Film(this, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY) + _film = FilmPath(this, FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY, null) return _film; } - val film: Film - get(): Film = film() + val film: FilmPath + get(): FilmPath = film() override fun `as`(alias: String): FilmActor = FilmActor(DSL.name(alias), this) override fun `as`(alias: Name): FilmActor = FilmActor(alias, this) - override fun `as`(alias: Table<*>): FilmActor = FilmActor(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): FilmActor = FilmActor(alias.qualifiedName, this) /** * Rename this table @@ -151,21 +175,55 @@ open class FilmActor( /** * Rename this table */ - override fun rename(name: Table<*>): FilmActor = FilmActor(name.getQualifiedName(), null) + override fun rename(name: Table<*>): FilmActor = FilmActor(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): FilmActor = FilmActor(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): FilmActor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): FilmActor = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): FilmActor = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): FilmActor = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): FilmActor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): FilmActor = where(DSL.notExists(select)) } 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 490a8c2..022b096 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 @@ -5,18 +5,23 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -25,6 +30,8 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY_PKEY import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY import org.jooq.demo.kotlin.db.keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Category.CategoryPath +import org.jooq.demo.kotlin.db.tables.Film.FilmPath import org.jooq.demo.kotlin.db.tables.records.FilmCategoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -38,19 +45,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmCategory( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -80,8 +91,9 @@ open class FilmCategory( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film_category table reference @@ -98,42 +110,54 @@ open class FilmCategory( */ constructor(): this(DSL.name("film_category"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM_CATEGORY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, FILM_CATEGORY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class FilmCategoryPath : FilmCategory, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): FilmCategoryPath = FilmCategoryPath(DSL.name(alias), this) + override fun `as`(alias: Name): FilmCategoryPath = FilmCategoryPath(alias, this) + override fun `as`(alias: Table<*>): FilmCategoryPath = FilmCategoryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getPrimaryKey(): UniqueKey = FILM_CATEGORY_PKEY override fun getReferences(): List> = listOf(FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY) - private lateinit var _film: Film - private lateinit var _category: Category + private lateinit var _film: FilmPath /** * Get the implicit join path to the public.film table. */ - fun film(): Film { + fun film(): FilmPath { if (!this::_film.isInitialized) - _film = Film(this, FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY) + _film = FilmPath(this, FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, null) return _film; } - val film: Film - get(): Film = film() + val film: FilmPath + get(): FilmPath = film() + + private lateinit var _category: CategoryPath /** * Get the implicit join path to the public.category table. */ - fun category(): Category { + fun category(): CategoryPath { if (!this::_category.isInitialized) - _category = Category(this, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY) + _category = CategoryPath(this, FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY, null) return _category; } - val category: Category - get(): Category = category() + val category: CategoryPath + get(): CategoryPath = category() override fun `as`(alias: String): FilmCategory = FilmCategory(DSL.name(alias), this) override fun `as`(alias: Name): FilmCategory = FilmCategory(alias, this) - override fun `as`(alias: Table<*>): FilmCategory = FilmCategory(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): FilmCategory = FilmCategory(alias.qualifiedName, this) /** * Rename this table @@ -148,21 +172,55 @@ open class FilmCategory( /** * Rename this table */ - override fun rename(name: Table<*>): FilmCategory = FilmCategory(name.getQualifiedName(), null) + override fun rename(name: Table<*>): FilmCategory = FilmCategory(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): FilmCategory = FilmCategory(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): FilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): FilmCategory = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): FilmCategory = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): FilmCategory = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): FilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): FilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt index 6a8a3e9..2aba2fa 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmInStock.kt @@ -4,16 +4,13 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function - +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Records -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,19 +27,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmInStock( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function() + TableOptions.function(), + where, ) { companion object { @@ -62,11 +63,11 @@ open class FilmInStock( */ val P_FILM_COUNT: TableField = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, arrayOf( + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, arrayOf( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + ), null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) /** * Create an aliased public.film_in_stock table reference @@ -85,7 +86,7 @@ open class FilmInStock( override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): FilmInStock = FilmInStock(DSL.name(alias), this, parameters) override fun `as`(alias: Name): FilmInStock = FilmInStock(alias, this, parameters) - override fun `as`(alias: Table<*>): FilmInStock = FilmInStock(alias.getQualifiedName(), this, parameters) + override fun `as`(alias: Table<*>): FilmInStock = FilmInStock(alias.qualifiedName, this, parameters) /** * Rename this table @@ -100,12 +101,7 @@ open class FilmInStock( /** * Rename this table */ - override fun rename(name: Table<*>): FilmInStock = FilmInStock(name.getQualifiedName(), null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 + override fun rename(name: Table<*>): FilmInStock = FilmInStock(name.qualifiedName, null, parameters) /** * Call this table-valued function @@ -128,15 +124,4 @@ open class FilmInStock( pFilmId, pStoreId )).let { if (aliased()) it.`as`(unqualifiedName) else it } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - fun mapping(from: (Int?) -> U): SelectField = convertFrom(Records.mapping(from)) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - fun mapping(toType: Class, from: (Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) } 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 938db80..29ab2a2 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 @@ -5,16 +5,21 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -22,7 +27,6 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.records.FilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -33,15 +37,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -60,7 +67,8 @@ open class FilmList( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where, ) { companion object { @@ -108,15 +116,16 @@ open class FilmList( /** * The column public.film_list.rating. */ - val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.kotlin.db.enums.MpaaRating::class.java), this, "") + val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating::class.java), this, "") /** * The column public.film_list.actors. */ val ACTORS: TableField = createField(DSL.name("actors"), SQLDataType.CLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.film_list table reference @@ -132,12 +141,10 @@ open class FilmList( * Create a public.film_list table reference */ constructor(): this(DSL.name("film_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, FILM_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): FilmList = FilmList(DSL.name(alias), this) override fun `as`(alias: Name): FilmList = FilmList(alias, this) - override fun `as`(alias: Table<*>): FilmList = FilmList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): FilmList = FilmList(alias.qualifiedName, this) /** * Rename this table @@ -152,21 +159,55 @@ open class FilmList( /** * Rename this table */ - override fun rename(name: Table<*>): FilmList = FilmList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): FilmList = FilmList(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): FilmList = FilmList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): FilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): FilmList = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): FilmList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): FilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): FilmList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt index df3eb43..cb36e1d 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/FilmNotInStock.kt @@ -4,16 +4,13 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function - +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Records -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,19 +27,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class FilmNotInStock( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function() + TableOptions.function(), + where, ) { companion object { @@ -62,11 +63,11 @@ open class FilmNotInStock( */ val P_FILM_COUNT: TableField = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, arrayOf( + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, arrayOf( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + ), null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) /** * Create an aliased public.film_not_in_stock table reference @@ -85,7 +86,7 @@ open class FilmNotInStock( override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): FilmNotInStock = FilmNotInStock(DSL.name(alias), this, parameters) override fun `as`(alias: Name): FilmNotInStock = FilmNotInStock(alias, this, parameters) - override fun `as`(alias: Table<*>): FilmNotInStock = FilmNotInStock(alias.getQualifiedName(), this, parameters) + override fun `as`(alias: Table<*>): FilmNotInStock = FilmNotInStock(alias.qualifiedName, this, parameters) /** * Rename this table @@ -100,12 +101,7 @@ open class FilmNotInStock( /** * Rename this table */ - override fun rename(name: Table<*>): FilmNotInStock = FilmNotInStock(name.getQualifiedName(), null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 + override fun rename(name: Table<*>): FilmNotInStock = FilmNotInStock(name.qualifiedName, null, parameters) /** * Call this table-valued function @@ -128,15 +124,4 @@ open class FilmNotInStock( pFilmId, pStoreId )).let { if (aliased()) it.`as`(unqualifiedName) else it } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - fun mapping(from: (Int?) -> U): SelectField = convertFrom(Records.mapping(from)) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - fun mapping(toType: Class, from: (Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) } 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 de8d29e..e2e1d39 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 @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,6 +33,10 @@ import org.jooq.demo.kotlin.db.indexes.IDX_STORE_ID_FILM_ID import org.jooq.demo.kotlin.db.keys.INVENTORY_PKEY import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_FILM_ID_FKEY import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_INVENTORY_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.InventoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -41,19 +50,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Inventory( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -88,8 +101,9 @@ open class Inventory( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.inventory table reference @@ -106,44 +120,72 @@ open class Inventory( */ constructor(): this(DSL.name("inventory"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, INVENTORY, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, INVENTORY, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class InventoryPath : Inventory, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): InventoryPath = InventoryPath(DSL.name(alias), this) + override fun `as`(alias: Name): InventoryPath = InventoryPath(alias, this) + override fun `as`(alias: Table<*>): InventoryPath = InventoryPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_STORE_ID_FILM_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = INVENTORY_PKEY override fun getReferences(): List> = listOf(INVENTORY__INVENTORY_FILM_ID_FKEY, INVENTORY__INVENTORY_STORE_ID_FKEY) - private lateinit var _film: Film - private lateinit var _store: Store + private lateinit var _film: FilmPath /** * Get the implicit join path to the public.film table. */ - fun film(): Film { + fun film(): FilmPath { if (!this::_film.isInitialized) - _film = Film(this, INVENTORY__INVENTORY_FILM_ID_FKEY) + _film = FilmPath(this, INVENTORY__INVENTORY_FILM_ID_FKEY, null) return _film; } - val film: Film - get(): Film = film() + val film: FilmPath + get(): FilmPath = film() + + private lateinit var _store: StorePath /** * Get the implicit join path to the public.store table. */ - fun store(): Store { + fun store(): StorePath { if (!this::_store.isInitialized) - _store = Store(this, INVENTORY__INVENTORY_STORE_ID_FKEY) + _store = StorePath(this, INVENTORY__INVENTORY_STORE_ID_FKEY, null) return _store; } - val store: Store - get(): Store = store() + val store: StorePath + get(): StorePath = store() + + private lateinit var _rental: RentalPath + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + fun rental(): RentalPath { + if (!this::_rental.isInitialized) + _rental = RentalPath(this, null, RENTAL__RENTAL_INVENTORY_ID_FKEY.inverseKey) + + return _rental; + } + + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Inventory = Inventory(DSL.name(alias), this) override fun `as`(alias: Name): Inventory = Inventory(alias, this) - override fun `as`(alias: Table<*>): Inventory = Inventory(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Inventory = Inventory(alias.qualifiedName, this) /** * Rename this table @@ -158,21 +200,55 @@ open class Inventory( /** * Rename this table */ - override fun rename(name: Table<*>): Inventory = Inventory(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Inventory = Inventory(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Inventory = Inventory(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Inventory = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Inventory = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Inventory = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Inventory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Inventory = where(DSL.notExists(select)) } 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 48f0e0f..b5f29b5 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 @@ -5,23 +5,32 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.keys.FILM__FILM_LANGUAGE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY import org.jooq.demo.kotlin.db.keys.LANGUAGE_PKEY +import org.jooq.demo.kotlin.db.tables.Film.FilmPath import org.jooq.demo.kotlin.db.tables.records.LanguageRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -35,19 +44,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Language( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -77,8 +90,9 @@ open class Language( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.language table reference @@ -95,13 +109,56 @@ open class Language( */ constructor(): this(DSL.name("language"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, LANGUAGE, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, LANGUAGE, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class LanguagePath : Language, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): LanguagePath = LanguagePath(DSL.name(alias), this) + override fun `as`(alias: Name): LanguagePath = LanguagePath(alias, this) + override fun `as`(alias: Table<*>): LanguagePath = LanguagePath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = LANGUAGE_PKEY + + private lateinit var _filmLanguageIdFkey: FilmPath + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_language_id_fkey key + */ + fun filmLanguageIdFkey(): FilmPath { + if (!this::_filmLanguageIdFkey.isInitialized) + _filmLanguageIdFkey = FilmPath(this, null, FILM__FILM_LANGUAGE_ID_FKEY.inverseKey) + + return _filmLanguageIdFkey; + } + + val filmLanguageIdFkey: FilmPath + get(): FilmPath = filmLanguageIdFkey() + + private lateinit var _filmOriginalLanguageIdFkey: FilmPath + + /** + * Get the implicit to-many join path to the public.film table, + * via the film_original_language_id_fkey key + */ + fun filmOriginalLanguageIdFkey(): FilmPath { + if (!this::_filmOriginalLanguageIdFkey.isInitialized) + _filmOriginalLanguageIdFkey = FilmPath(this, null, FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY.inverseKey) + + return _filmOriginalLanguageIdFkey; + } + + val filmOriginalLanguageIdFkey: FilmPath + get(): FilmPath = filmOriginalLanguageIdFkey() override fun `as`(alias: String): Language = Language(DSL.name(alias), this) override fun `as`(alias: Name): Language = Language(alias, this) - override fun `as`(alias: Table<*>): Language = Language(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Language = Language(alias.qualifiedName, this) /** * Rename this table @@ -116,21 +173,55 @@ open class Language( /** * Rename this table */ - override fun rename(name: Table<*>): Language = Language(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Language = Language(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Language = Language(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Language = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Language = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Language = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Language = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Language = where(DSL.notExists(select)) } 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 5a4757c..da560a7 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 @@ -5,16 +5,21 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -22,7 +27,6 @@ import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.records.NicerButSlowerFilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -33,15 +37,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class NicerButSlowerFilmList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -60,7 +67,8 @@ open class NicerButSlowerFilmList( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where, ) { companion object { @@ -109,15 +117,16 @@ open class NicerButSlowerFilmList( /** * The column public.nicer_but_slower_film_list.rating. */ - val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(org.jooq.demo.kotlin.db.enums.MpaaRating::class.java), this, "") + val RATING: TableField = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(MpaaRating::class.java), this, "") /** * The column public.nicer_but_slower_film_list.actors. */ val ACTORS: TableField = createField(DSL.name("actors"), SQLDataType.CLOB, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.nicer_but_slower_film_list table @@ -135,12 +144,10 @@ open class NicerButSlowerFilmList( * Create a public.nicer_but_slower_film_list table reference */ constructor(): this(DSL.name("nicer_but_slower_film_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, NICER_BUT_SLOWER_FILM_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): NicerButSlowerFilmList = NicerButSlowerFilmList(DSL.name(alias), this) override fun `as`(alias: Name): NicerButSlowerFilmList = NicerButSlowerFilmList(alias, this) - override fun `as`(alias: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(alias.qualifiedName, this) /** * Rename this table @@ -155,21 +162,55 @@ open class NicerButSlowerFilmList( /** * Rename this table */ - override fun rename(name: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): NicerButSlowerFilmList = NicerButSlowerFilmList(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): NicerButSlowerFilmList = NicerButSlowerFilmList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): NicerButSlowerFilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): NicerButSlowerFilmList = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): NicerButSlowerFilmList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): NicerButSlowerFilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, BigDecimal?, Short?, MpaaRating?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): NicerButSlowerFilmList = where(DSL.notExists(select)) } 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 2101bbe..2188606 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 @@ -6,20 +6,25 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -31,6 +36,9 @@ import org.jooq.demo.kotlin.db.keys.PAYMENT_PKEY import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -44,19 +52,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Payment( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -101,8 +113,9 @@ open class Payment( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment table reference @@ -119,58 +132,71 @@ open class Payment( */ constructor(): this(DSL.name("payment"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentPath : Payment, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentPath = PaymentPath(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentPath = PaymentPath(alias, this) + override fun `as`(alias: Table<*>): PaymentPath = PaymentPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_CUSTOMER_ID, IDX_FK_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = PAYMENT_PKEY override fun getReferences(): List> = listOf(PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, PAYMENT__PAYMENT_STAFF_ID_FKEY, PAYMENT__PAYMENT_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT__PAYMENT_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT__PAYMENT_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT__PAYMENT_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT__PAYMENT_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT__PAYMENT_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Payment = Payment(DSL.name(alias), this) override fun `as`(alias: Name): Payment = Payment(alias, this) - override fun `as`(alias: Table<*>): Payment = Payment(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Payment = Payment(alias.qualifiedName, this) /** * Rename this table @@ -185,21 +211,55 @@ open class Payment( /** * Rename this table */ - override fun rename(name: Table<*>): Payment = Payment(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Payment = Payment(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Payment = Payment(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Payment = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): Payment = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Payment = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Payment = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Payment = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Payment = where(DSL.notExists(select)) } 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 c7224c8..7e9f17f 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 @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_01_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_01Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_01( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_01( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_01 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_01( */ constructor(): this(DSL.name("payment_p2007_01"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_01, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_01, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_01Path : PaymentP2007_01, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_01Path = PaymentP2007_01Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_01Path = PaymentP2007_01Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_01Path = PaymentP2007_01Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_01_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_01_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_01_payment_date_check"), "(((payment_date >= '2007-01-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-02-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_01 = PaymentP2007_01(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_01 = PaymentP2007_01(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_01 = PaymentP2007_01(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_01 = PaymentP2007_01(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_01( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_01 = PaymentP2007_01(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_01 = PaymentP2007_01(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_01 = PaymentP2007_01(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_01 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_01 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_01 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_01 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_01 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_01 = where(DSL.notExists(select)) } 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 2ae28a8..93fac7f 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 @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_02_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_02Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_02( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_02( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_02 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_02( */ constructor(): this(DSL.name("payment_p2007_02"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_02, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_02, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_02Path : PaymentP2007_02, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_02Path = PaymentP2007_02Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_02Path = PaymentP2007_02Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_02Path = PaymentP2007_02Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_02_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_02_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_02_payment_date_check"), "(((payment_date >= '2007-02-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-03-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_02 = PaymentP2007_02(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_02 = PaymentP2007_02(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_02 = PaymentP2007_02(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_02 = PaymentP2007_02(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_02( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_02 = PaymentP2007_02(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_02 = PaymentP2007_02(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_02 = PaymentP2007_02(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_02 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_02 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_02 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_02 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_02 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_02 = where(DSL.notExists(select)) } 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 f30562c..a527e24 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 @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_03_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_03Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_03( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_03( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_03 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_03( */ constructor(): this(DSL.name("payment_p2007_03"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_03, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_03, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_03Path : PaymentP2007_03, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_03Path = PaymentP2007_03Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_03Path = PaymentP2007_03Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_03Path = PaymentP2007_03Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_03_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_03_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_03_payment_date_check"), "(((payment_date >= '2007-03-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-04-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_03 = PaymentP2007_03(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_03 = PaymentP2007_03(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_03 = PaymentP2007_03(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_03 = PaymentP2007_03(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_03( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_03 = PaymentP2007_03(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_03 = PaymentP2007_03(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_03 = PaymentP2007_03(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_03 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_03 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_03 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_03 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_03 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_03 = where(DSL.notExists(select)) } 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 0384064..a9a7ade 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 @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_04_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_04Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_04( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_04( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_04 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_04( */ constructor(): this(DSL.name("payment_p2007_04"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_04, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_04, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_04Path : PaymentP2007_04, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_04Path = PaymentP2007_04Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_04Path = PaymentP2007_04Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_04Path = PaymentP2007_04Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_04_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_04_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_04_payment_date_check"), "(((payment_date >= '2007-04-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-05-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_04 = PaymentP2007_04(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_04 = PaymentP2007_04(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_04 = PaymentP2007_04(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_04 = PaymentP2007_04(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_04( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_04 = PaymentP2007_04(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_04 = PaymentP2007_04(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_04 = PaymentP2007_04(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_04 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_04 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_04 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_04 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_04 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_04 = where(DSL.notExists(select)) } 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 9a8791f..c6fa36f 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 @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_05_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_05Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_05( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_05( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_05 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_05( */ constructor(): this(DSL.name("payment_p2007_05"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_05, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_05, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_05Path : PaymentP2007_05, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_05Path = PaymentP2007_05Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_05Path = PaymentP2007_05Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_05Path = PaymentP2007_05Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_05_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_05_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_05_payment_date_check"), "(((payment_date >= '2007-05-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-06-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_05 = PaymentP2007_05(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_05 = PaymentP2007_05(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_05 = PaymentP2007_05(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_05 = PaymentP2007_05(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_05( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_05 = PaymentP2007_05(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_05 = PaymentP2007_05(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_05 = PaymentP2007_05(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_05 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_05 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_05 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_05 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_05 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_05 = where(DSL.notExists(select)) } 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 bfbc012..ae02856 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 @@ -6,21 +6,26 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -30,6 +35,9 @@ import org.jooq.demo.kotlin.db.indexes.IDX_FK_PAYMENT_P2007_06_STAFF_ID import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.PaymentP2007_06Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +51,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class PaymentP2007_06( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -100,8 +112,9 @@ open class PaymentP2007_06( */ val PAYMENT_DATE: TableField = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.payment_p2007_06 table reference @@ -118,60 +131,73 @@ open class PaymentP2007_06( */ constructor(): this(DSL.name("payment_p2007_06"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, PAYMENT_P2007_06, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, PAYMENT_P2007_06, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class PaymentP2007_06Path : PaymentP2007_06, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): PaymentP2007_06Path = PaymentP2007_06Path(DSL.name(alias), this) + override fun `as`(alias: Name): PaymentP2007_06Path = PaymentP2007_06Path(alias, this) + override fun `as`(alias: Table<*>): PaymentP2007_06Path = PaymentP2007_06Path(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_PAYMENT_P2007_06_CUSTOMER_ID, IDX_FK_PAYMENT_P2007_06_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getReferences(): List> = listOf(PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY) - private lateinit var _customer: Customer - private lateinit var _staff: Staff - private lateinit var _rental: Rental + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY) + _staff = StaffPath(this, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _rental: RentalPath /** * Get the implicit join path to the public.rental table. */ - fun rental(): Rental { + fun rental(): RentalPath { if (!this::_rental.isInitialized) - _rental = Rental(this, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY) + _rental = RentalPath(this, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY, null) return _rental; } - val rental: Rental - get(): Rental = rental() + val rental: RentalPath + get(): RentalPath = rental() override fun getChecks(): List> = listOf( Internal.createCheck(this, DSL.name("payment_p2007_06_payment_date_check"), "(((payment_date >= '2007-06-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-07-01 00:00:00'::timestamp without time zone)))", true) ) override fun `as`(alias: String): PaymentP2007_06 = PaymentP2007_06(DSL.name(alias), this) override fun `as`(alias: Name): PaymentP2007_06 = PaymentP2007_06(alias, this) - override fun `as`(alias: Table<*>): PaymentP2007_06 = PaymentP2007_06(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): PaymentP2007_06 = PaymentP2007_06(alias.qualifiedName, this) /** * Rename this table @@ -186,21 +212,55 @@ open class PaymentP2007_06( /** * Rename this table */ - override fun rename(name: Table<*>): PaymentP2007_06 = PaymentP2007_06(name.getQualifiedName(), null) + override fun rename(name: Table<*>): PaymentP2007_06 = PaymentP2007_06(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): PaymentP2007_06 = PaymentP2007_06(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): PaymentP2007_06 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override fun where(vararg conditions: Condition): PaymentP2007_06 = where(DSL.and(*conditions)) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Field): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): PaymentP2007_06 = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): PaymentP2007_06 = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): PaymentP2007_06 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, Long?, BigDecimal?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): PaymentP2007_06 = where(DSL.notExists(select)) } 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 3bbc3f3..c79c633 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 @@ -5,20 +5,25 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row7 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -26,10 +31,27 @@ import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_FK_INVENTORY_ID import org.jooq.demo.kotlin.db.indexes.IDX_UNQ_RENTAL_RENTAL_DATE_INVENTORY_ID_CUSTOMER_ID +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY import org.jooq.demo.kotlin.db.keys.RENTAL_PKEY import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_INVENTORY_ID_FKEY import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Inventory.InventoryPath +import org.jooq.demo.kotlin.db.tables.Payment.PaymentPath +import org.jooq.demo.kotlin.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.RentalRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,19 +65,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Rental( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -105,8 +131,9 @@ open class Rental( */ val LAST_UPDATE: TableField = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.rental table reference @@ -123,58 +150,183 @@ open class Rental( */ constructor(): this(DSL.name("rental"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, RENTAL, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, RENTAL, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class RentalPath : Rental, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): RentalPath = RentalPath(DSL.name(alias), this) + override fun `as`(alias: Name): RentalPath = RentalPath(alias, this) + override fun `as`(alias: Table<*>): RentalPath = RentalPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_FK_INVENTORY_ID, IDX_UNQ_RENTAL_RENTAL_DATE_INVENTORY_ID_CUSTOMER_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = RENTAL_PKEY override fun getReferences(): List> = listOf(RENTAL__RENTAL_INVENTORY_ID_FKEY, RENTAL__RENTAL_CUSTOMER_ID_FKEY, RENTAL__RENTAL_STAFF_ID_FKEY) - private lateinit var _inventory: Inventory - private lateinit var _customer: Customer - private lateinit var _staff: Staff + private lateinit var _inventory: InventoryPath /** * Get the implicit join path to the public.inventory table. */ - fun inventory(): Inventory { + fun inventory(): InventoryPath { if (!this::_inventory.isInitialized) - _inventory = Inventory(this, RENTAL__RENTAL_INVENTORY_ID_FKEY) + _inventory = InventoryPath(this, RENTAL__RENTAL_INVENTORY_ID_FKEY, null) return _inventory; } - val inventory: Inventory - get(): Inventory = inventory() + val inventory: InventoryPath + get(): InventoryPath = inventory() + + private lateinit var _customer: CustomerPath /** * Get the implicit join path to the public.customer table. */ - fun customer(): Customer { + fun customer(): CustomerPath { if (!this::_customer.isInitialized) - _customer = Customer(this, RENTAL__RENTAL_CUSTOMER_ID_FKEY) + _customer = CustomerPath(this, RENTAL__RENTAL_CUSTOMER_ID_FKEY, null) return _customer; } - val customer: Customer - get(): Customer = customer() + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, RENTAL__RENTAL_STAFF_ID_FKEY) + _staff = StaffPath(this, RENTAL__RENTAL_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _payment: PaymentPath + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + fun payment(): PaymentPath { + if (!this::_payment.isInitialized) + _payment = PaymentPath(this, null, PAYMENT__PAYMENT_RENTAL_ID_FKEY.inverseKey) + + return _payment; + } + + val payment: PaymentPath + get(): PaymentPath = payment() + + private lateinit var _paymentP2007_01: PaymentP2007_01Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + fun paymentP2007_01(): PaymentP2007_01Path { + if (!this::_paymentP2007_01.isInitialized) + _paymentP2007_01 = PaymentP2007_01Path(this, null, PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_01; + } + + val paymentP2007_01: PaymentP2007_01Path + get(): PaymentP2007_01Path = paymentP2007_01() + + private lateinit var _paymentP2007_02: PaymentP2007_02Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + fun paymentP2007_02(): PaymentP2007_02Path { + if (!this::_paymentP2007_02.isInitialized) + _paymentP2007_02 = PaymentP2007_02Path(this, null, PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_02; + } + + val paymentP2007_02: PaymentP2007_02Path + get(): PaymentP2007_02Path = paymentP2007_02() + + private lateinit var _paymentP2007_03: PaymentP2007_03Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + fun paymentP2007_03(): PaymentP2007_03Path { + if (!this::_paymentP2007_03.isInitialized) + _paymentP2007_03 = PaymentP2007_03Path(this, null, PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_03; + } + + val paymentP2007_03: PaymentP2007_03Path + get(): PaymentP2007_03Path = paymentP2007_03() + + private lateinit var _paymentP2007_04: PaymentP2007_04Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + fun paymentP2007_04(): PaymentP2007_04Path { + if (!this::_paymentP2007_04.isInitialized) + _paymentP2007_04 = PaymentP2007_04Path(this, null, PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_04; + } + + val paymentP2007_04: PaymentP2007_04Path + get(): PaymentP2007_04Path = paymentP2007_04() + + private lateinit var _paymentP2007_05: PaymentP2007_05Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + fun paymentP2007_05(): PaymentP2007_05Path { + if (!this::_paymentP2007_05.isInitialized) + _paymentP2007_05 = PaymentP2007_05Path(this, null, PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_05; + } + + val paymentP2007_05: PaymentP2007_05Path + get(): PaymentP2007_05Path = paymentP2007_05() + + private lateinit var _paymentP2007_06: PaymentP2007_06Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + fun paymentP2007_06(): PaymentP2007_06Path { + if (!this::_paymentP2007_06.isInitialized) + _paymentP2007_06 = PaymentP2007_06Path(this, null, PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY.inverseKey) + + return _paymentP2007_06; + } + + val paymentP2007_06: PaymentP2007_06Path + get(): PaymentP2007_06Path = paymentP2007_06() override fun `as`(alias: String): Rental = Rental(DSL.name(alias), this) override fun `as`(alias: Name): Rental = Rental(alias, this) - override fun `as`(alias: Table<*>): Rental = Rental(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Rental = Rental(alias.qualifiedName, this) /** * Rename this table @@ -189,21 +341,55 @@ open class Rental( /** * Rename this table */ - override fun rename(name: Table<*>): Rental = Rental(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Rental = Rental(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row7 = super.fieldsRow() as Row7 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Rental = Rental(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Rental = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Rental = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Rental = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, LocalDateTime?, Long?, Long?, LocalDateTime?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Rental = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, LocalDateTime?, Long?, Long?, LocalDateTime?, Long?, LocalDateTime?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Rental = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt index 81af714..28dc872 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/RewardsReport.kt @@ -7,17 +7,15 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal import java.time.LocalDate import java.time.LocalDateTime -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Records -import org.jooq.Row10 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -34,19 +32,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class RewardsReport( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function() + TableOptions.function(), + where, ) { companion object { @@ -111,11 +113,11 @@ open class RewardsReport( */ val ACTIVE: TableField = createField(DSL.name("active"), SQLDataType.INTEGER, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, arrayOf( + private constructor(alias: Name, aliased: Table?): this(alias, null, null, null, aliased, arrayOf( DSL.value(null, SQLDataType.INTEGER), DSL.value(null, SQLDataType.NUMERIC) - )) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + ), null) + private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, null, aliased, parameters, null) /** * Create an aliased public.rewards_report table reference @@ -135,7 +137,7 @@ open class RewardsReport( override fun getIdentity(): Identity = super.getIdentity() as Identity override fun `as`(alias: String): RewardsReport = RewardsReport(DSL.name(alias), this, parameters) override fun `as`(alias: Name): RewardsReport = RewardsReport(alias, this, parameters) - override fun `as`(alias: Table<*>): RewardsReport = RewardsReport(alias.getQualifiedName(), this, parameters) + override fun `as`(alias: Table<*>): RewardsReport = RewardsReport(alias.qualifiedName, this, parameters) /** * Rename this table @@ -150,12 +152,7 @@ open class RewardsReport( /** * Rename this table */ - override fun rename(name: Table<*>): RewardsReport = RewardsReport(name.getQualifiedName(), null, parameters) - - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row10 = super.fieldsRow() as Row10 + override fun rename(name: Table<*>): RewardsReport = RewardsReport(name.qualifiedName, null, parameters) /** * Call this table-valued function @@ -178,15 +175,4 @@ open class RewardsReport( minMonthlyPurchases, minDollarAmountPurchased )).let { if (aliased()) it.`as`(unqualifiedName) else it } - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - fun mapping(from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(Records.mapping(from)) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - fun mapping(toType: Class, from: (Long?, Long?, String?, String?, String?, Long?, Boolean?, LocalDate?, LocalDateTime?, Int?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) } 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 1b7b993..5574e0e 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 @@ -5,23 +5,27 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row2 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.SalesByFilmCategoryRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -32,15 +36,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class SalesByFilmCategory( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -55,7 +62,8 @@ open class SalesByFilmCategory( JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY (sum(p.amount)) DESC; - """) + """), + where, ) { companion object { @@ -80,8 +88,9 @@ open class SalesByFilmCategory( */ val TOTAL_SALES: TableField = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.sales_by_film_category table @@ -99,12 +108,10 @@ open class SalesByFilmCategory( * Create a public.sales_by_film_category table reference */ constructor(): this(DSL.name("sales_by_film_category"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, SALES_BY_FILM_CATEGORY, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): SalesByFilmCategory = SalesByFilmCategory(DSL.name(alias), this) override fun `as`(alias: Name): SalesByFilmCategory = SalesByFilmCategory(alias, this) - override fun `as`(alias: Table<*>): SalesByFilmCategory = SalesByFilmCategory(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): SalesByFilmCategory = SalesByFilmCategory(alias.qualifiedName, this) /** * Rename this table @@ -119,21 +126,55 @@ open class SalesByFilmCategory( /** * Rename this table */ - override fun rename(name: Table<*>): SalesByFilmCategory = SalesByFilmCategory(name.getQualifiedName(), null) + override fun rename(name: Table<*>): SalesByFilmCategory = SalesByFilmCategory(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row2 = super.fieldsRow() as Row2 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): SalesByFilmCategory = SalesByFilmCategory(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): SalesByFilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): SalesByFilmCategory = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): SalesByFilmCategory = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (String?, BigDecimal?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): SalesByFilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (String?, BigDecimal?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): SalesByFilmCategory = where(DSL.notExists(select)) } 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 49ff34b..c9dc23d 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 @@ -5,23 +5,27 @@ package org.jooq.demo.kotlin.db.tables import java.math.BigDecimal -import java.util.function.Function +import kotlin.collections.Collection + +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.SalesByStoreRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -32,15 +36,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class SalesByStore( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -58,7 +65,8 @@ open class SalesByStore( JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city; - """) + """), + where, ) { companion object { @@ -88,8 +96,9 @@ open class SalesByStore( */ val TOTAL_SALES: TableField = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.sales_by_store table reference @@ -105,12 +114,10 @@ open class SalesByStore( * Create a public.sales_by_store table reference */ constructor(): this(DSL.name("sales_by_store"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, SALES_BY_STORE, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): SalesByStore = SalesByStore(DSL.name(alias), this) override fun `as`(alias: Name): SalesByStore = SalesByStore(alias, this) - override fun `as`(alias: Table<*>): SalesByStore = SalesByStore(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): SalesByStore = SalesByStore(alias.qualifiedName, this) /** * Rename this table @@ -125,21 +132,55 @@ open class SalesByStore( /** * Rename this table */ - override fun rename(name: Table<*>): SalesByStore = SalesByStore(name.getQualifiedName(), null) + override fun rename(name: Table<*>): SalesByStore = SalesByStore(name.qualifiedName, null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): SalesByStore = SalesByStore(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): SalesByStore = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): SalesByStore = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): SalesByStore = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (String?, String?, BigDecimal?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): SalesByStore = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (String?, String?, BigDecimal?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): SalesByStore = where(DSL.notExists(select)) } 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 22a5fa4..922e2d9 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 @@ -5,27 +5,50 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row13 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.PAYMENT__PAYMENT_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.keys.RENTAL__RENTAL_STAFF_ID_FKEY import org.jooq.demo.kotlin.db.keys.STAFF_PKEY import org.jooq.demo.kotlin.db.keys.STAFF__STAFF_ADDRESS_ID_FKEY import org.jooq.demo.kotlin.db.keys.STAFF__STAFF_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Payment.PaymentPath +import org.jooq.demo.kotlin.db.tables.PaymentP2007_01.PaymentP2007_01Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_02.PaymentP2007_02Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_03.PaymentP2007_03Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_04.PaymentP2007_04Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_05.PaymentP2007_05Path +import org.jooq.demo.kotlin.db.tables.PaymentP2007_06.PaymentP2007_06Path +import org.jooq.demo.kotlin.db.tables.Rental.RentalPath +import org.jooq.demo.kotlin.db.tables.Store.StorePath import org.jooq.demo.kotlin.db.tables.records.StaffRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -39,19 +62,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Staff( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -131,8 +158,9 @@ open class Staff( */ val FULL_NAME: TableField = createField(DSL.name("full_name"), SQLDataType.CLOB.virtual(), this, "", { ctx -> DSL.concat(FIRST_NAME, DSL.inline(" "), LAST_NAME) }) - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.staff table reference @@ -149,43 +177,183 @@ open class Staff( */ constructor(): this(DSL.name("staff"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, STAFF, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, STAFF, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class StaffPath : Staff, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): StaffPath = StaffPath(DSL.name(alias), this) + override fun `as`(alias: Name): StaffPath = StaffPath(alias, this) + override fun `as`(alias: Table<*>): StaffPath = StaffPath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = STAFF_PKEY override fun getReferences(): List> = listOf(STAFF__STAFF_ADDRESS_ID_FKEY, STAFF__STAFF_STORE_ID_FKEY) - private lateinit var _address: Address - private lateinit var _store: Store + private lateinit var _address: AddressPath /** * Get the implicit join path to the public.address table. */ - fun address(): Address { + fun address(): AddressPath { if (!this::_address.isInitialized) - _address = Address(this, STAFF__STAFF_ADDRESS_ID_FKEY) + _address = AddressPath(this, STAFF__STAFF_ADDRESS_ID_FKEY, null) return _address; } - val address: Address - get(): Address = address() + val address: AddressPath + get(): AddressPath = address() + + private lateinit var _store: StorePath /** * Get the implicit join path to the public.store table. */ - fun store(): Store { + fun store(): StorePath { if (!this::_store.isInitialized) - _store = Store(this, STAFF__STAFF_STORE_ID_FKEY) + _store = StorePath(this, STAFF__STAFF_STORE_ID_FKEY, null) return _store; } - val store: Store - get(): Store = store() + val store: StorePath + get(): StorePath = store() + + private lateinit var _payment: PaymentPath + + /** + * Get the implicit to-many join path to the public.payment + * table + */ + fun payment(): PaymentPath { + if (!this::_payment.isInitialized) + _payment = PaymentPath(this, null, PAYMENT__PAYMENT_STAFF_ID_FKEY.inverseKey) + + return _payment; + } + + val payment: PaymentPath + get(): PaymentPath = payment() + + private lateinit var _paymentP2007_01: PaymentP2007_01Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_01 table + */ + fun paymentP2007_01(): PaymentP2007_01Path { + if (!this::_paymentP2007_01.isInitialized) + _paymentP2007_01 = PaymentP2007_01Path(this, null, PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_01; + } + + val paymentP2007_01: PaymentP2007_01Path + get(): PaymentP2007_01Path = paymentP2007_01() + + private lateinit var _paymentP2007_02: PaymentP2007_02Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_02 table + */ + fun paymentP2007_02(): PaymentP2007_02Path { + if (!this::_paymentP2007_02.isInitialized) + _paymentP2007_02 = PaymentP2007_02Path(this, null, PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_02; + } + + val paymentP2007_02: PaymentP2007_02Path + get(): PaymentP2007_02Path = paymentP2007_02() + + private lateinit var _paymentP2007_03: PaymentP2007_03Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_03 table + */ + fun paymentP2007_03(): PaymentP2007_03Path { + if (!this::_paymentP2007_03.isInitialized) + _paymentP2007_03 = PaymentP2007_03Path(this, null, PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_03; + } + + val paymentP2007_03: PaymentP2007_03Path + get(): PaymentP2007_03Path = paymentP2007_03() + + private lateinit var _paymentP2007_04: PaymentP2007_04Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_04 table + */ + fun paymentP2007_04(): PaymentP2007_04Path { + if (!this::_paymentP2007_04.isInitialized) + _paymentP2007_04 = PaymentP2007_04Path(this, null, PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_04; + } + + val paymentP2007_04: PaymentP2007_04Path + get(): PaymentP2007_04Path = paymentP2007_04() + + private lateinit var _paymentP2007_05: PaymentP2007_05Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_05 table + */ + fun paymentP2007_05(): PaymentP2007_05Path { + if (!this::_paymentP2007_05.isInitialized) + _paymentP2007_05 = PaymentP2007_05Path(this, null, PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_05; + } + + val paymentP2007_05: PaymentP2007_05Path + get(): PaymentP2007_05Path = paymentP2007_05() + + private lateinit var _paymentP2007_06: PaymentP2007_06Path + + /** + * Get the implicit to-many join path to the + * public.payment_p2007_06 table + */ + fun paymentP2007_06(): PaymentP2007_06Path { + if (!this::_paymentP2007_06.isInitialized) + _paymentP2007_06 = PaymentP2007_06Path(this, null, PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY.inverseKey) + + return _paymentP2007_06; + } + + val paymentP2007_06: PaymentP2007_06Path + get(): PaymentP2007_06Path = paymentP2007_06() + + private lateinit var _rental: RentalPath + + /** + * Get the implicit to-many join path to the public.rental + * table + */ + fun rental(): RentalPath { + if (!this::_rental.isInitialized) + _rental = RentalPath(this, null, RENTAL__RENTAL_STAFF_ID_FKEY.inverseKey) + + return _rental; + } + + val rental: RentalPath + get(): RentalPath = rental() override fun `as`(alias: String): Staff = Staff(DSL.name(alias), this) override fun `as`(alias: Name): Staff = Staff(alias, this) - override fun `as`(alias: Table<*>): Staff = Staff(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Staff = Staff(alias.qualifiedName, this) /** * Rename this table @@ -200,21 +368,55 @@ open class Staff( /** * Rename this table */ - override fun rename(name: Table<*>): Staff = Staff(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Staff = Staff(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Staff = Staff(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Staff = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row13 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row13 = super.fieldsRow() as Row13 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Staff = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Staff = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, Long?, String?, Long?, Boolean?, String?, String?, LocalDateTime?, ByteArray?, String?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Staff = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, Long?, String?, Long?, Boolean?, String?, String?, LocalDateTime?, ByteArray?, String?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Staff = where(DSL.notExists(select)) } 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 7ded33f..e48571f 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 @@ -4,23 +4,26 @@ package org.jooq.demo.kotlin.db.tables -import java.util.function.Function +import kotlin.collections.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL +import org.jooq.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.tables.records.StaffListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -31,15 +34,18 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class StaffList( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -56,7 +62,8 @@ open class StaffList( JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where, ) { companion object { @@ -111,8 +118,9 @@ open class StaffList( */ val SID: TableField = createField(DSL.name("sid"), SQLDataType.BIGINT, this, "") - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.staff_list table reference @@ -128,12 +136,10 @@ open class StaffList( * Create a public.staff_list table reference */ constructor(): this(DSL.name("staff_list"), null) - - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, STAFF_LIST, null) override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun `as`(alias: String): StaffList = StaffList(DSL.name(alias), this) override fun `as`(alias: Name): StaffList = StaffList(alias, this) - override fun `as`(alias: Table<*>): StaffList = StaffList(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): StaffList = StaffList(alias.qualifiedName, this) /** * Rename this table @@ -148,21 +154,55 @@ open class StaffList( /** * Rename this table */ - override fun rename(name: Table<*>): StaffList = StaffList(name.getQualifiedName(), null) + override fun rename(name: Table<*>): StaffList = StaffList(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): StaffList = StaffList(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): StaffList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): StaffList = where(DSL.condition(condition, *binds)) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): StaffList = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): StaffList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, String?, String?, String?, String?, String?, String?, Long?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): StaffList = where(DSL.notExists(select)) } 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 4f952dc..0db02c6 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 @@ -5,29 +5,40 @@ package org.jooq.demo.kotlin.db.tables import java.time.LocalDateTime -import java.util.function.Function +import kotlin.collections.Collection import kotlin.collections.List +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.QueryPart import org.jooq.Record -import org.jooq.Records -import org.jooq.Row5 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.UniqueKey import org.jooq.demo.kotlin.db.Public import org.jooq.demo.kotlin.db.indexes.IDX_UNQ_MANAGER_STAFF_ID +import org.jooq.demo.kotlin.db.keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY +import org.jooq.demo.kotlin.db.keys.INVENTORY__INVENTORY_STORE_ID_FKEY import org.jooq.demo.kotlin.db.keys.STORE_PKEY import org.jooq.demo.kotlin.db.keys.STORE__STORE_ADDRESS_ID_FKEY import org.jooq.demo.kotlin.db.keys.STORE__STORE_MANAGER_STAFF_ID_FKEY +import org.jooq.demo.kotlin.db.tables.Address.AddressPath +import org.jooq.demo.kotlin.db.tables.Customer.CustomerPath +import org.jooq.demo.kotlin.db.tables.Inventory.InventoryPath +import org.jooq.demo.kotlin.db.tables.Staff.StaffPath import org.jooq.demo.kotlin.db.tables.records.StoreRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -41,19 +52,23 @@ import org.jooq.impl.TableImpl @Suppress("UNCHECKED_CAST") open class Store( alias: Name, - child: Table?, - path: ForeignKey?, + path: Table?, + childPath: ForeignKey?, + parentPath: InverseForeignKey?, aliased: Table?, - parameters: Array?>? + parameters: Array?>?, + where: Condition? ): TableImpl( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table() + TableOptions.table(), + where, ) { companion object { @@ -93,8 +108,9 @@ open class Store( */ val FULL_ADDRESS: TableField = createField(DSL.name("full_address"), SQLDataType.CLOB.virtual(), this, "", { ctx -> DSL.concat(address.ADDRESS_, DSL.inline(", "), address.POSTAL_CODE, DSL.inline(", "), address.city.CITY_, DSL.inline(", "), address.city.country.COUNTRY_) }) - private constructor(alias: Name, aliased: Table?): this(alias, null, null, aliased, null) - private constructor(alias: Name, aliased: Table?, parameters: Array?>?): this(alias, null, null, aliased, parameters) + 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) /** * Create an aliased public.store table reference @@ -111,44 +127,88 @@ open class Store( */ constructor(): this(DSL.name("store"), null) - constructor(child: Table, key: ForeignKey): this(Internal.createPathAlias(child, key), child, key, STORE, null) + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, STORE, null, null) + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + open class StorePath : Store, Path { + constructor(path: Table, childPath: ForeignKey?, parentPath: InverseForeignKey?): super(path, childPath, parentPath) + private constructor(alias: Name, aliased: Table): super(alias, aliased) + override fun `as`(alias: String): StorePath = StorePath(DSL.name(alias), this) + override fun `as`(alias: Name): StorePath = StorePath(alias, this) + override fun `as`(alias: Table<*>): StorePath = StorePath(alias.qualifiedName, this) + } override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC override fun getIndexes(): List = listOf(IDX_UNQ_MANAGER_STAFF_ID) override fun getIdentity(): Identity = super.getIdentity() as Identity override fun getPrimaryKey(): UniqueKey = STORE_PKEY override fun getReferences(): List> = listOf(STORE__STORE_MANAGER_STAFF_ID_FKEY, STORE__STORE_ADDRESS_ID_FKEY) - private lateinit var _staff: Staff - private lateinit var _address: Address + private lateinit var _staff: StaffPath /** * Get the implicit join path to the public.staff table. */ - fun staff(): Staff { + fun staff(): StaffPath { if (!this::_staff.isInitialized) - _staff = Staff(this, STORE__STORE_MANAGER_STAFF_ID_FKEY) + _staff = StaffPath(this, STORE__STORE_MANAGER_STAFF_ID_FKEY, null) return _staff; } - val staff: Staff - get(): Staff = staff() + val staff: StaffPath + get(): StaffPath = staff() + + private lateinit var _address: AddressPath /** * Get the implicit join path to the public.address table. */ - fun address(): Address { + fun address(): AddressPath { if (!this::_address.isInitialized) - _address = Address(this, STORE__STORE_ADDRESS_ID_FKEY) + _address = AddressPath(this, STORE__STORE_ADDRESS_ID_FKEY, null) return _address; } - val address: Address - get(): Address = address() + val address: AddressPath + get(): AddressPath = address() + + private lateinit var _customer: CustomerPath + + /** + * Get the implicit to-many join path to the public.customer + * table + */ + fun customer(): CustomerPath { + if (!this::_customer.isInitialized) + _customer = CustomerPath(this, null, CUSTOMER__CUSTOMER_STORE_ID_FKEY.inverseKey) + + return _customer; + } + + val customer: CustomerPath + get(): CustomerPath = customer() + + private lateinit var _inventory: InventoryPath + + /** + * Get the implicit to-many join path to the public.inventory + * table + */ + fun inventory(): InventoryPath { + if (!this::_inventory.isInitialized) + _inventory = InventoryPath(this, null, INVENTORY__INVENTORY_STORE_ID_FKEY.inverseKey) + + return _inventory; + } + + val inventory: InventoryPath + get(): InventoryPath = inventory() override fun `as`(alias: String): Store = Store(DSL.name(alias), this) override fun `as`(alias: Name): Store = Store(alias, this) - override fun `as`(alias: Table<*>): Store = Store(alias.getQualifiedName(), this) + override fun `as`(alias: Table<*>): Store = Store(alias.qualifiedName, this) /** * Rename this table @@ -163,21 +223,55 @@ open class Store( /** * Rename this table */ - override fun rename(name: Table<*>): Store = Store(name.getQualifiedName(), null) + override fun rename(name: Table<*>): Store = Store(name.qualifiedName, null) + + /** + * Create an inline derived table from this table + */ + override fun where(condition: Condition): Store = Store(qualifiedName, if (aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override fun where(conditions: Collection): Store = where(DSL.and(conditions)) - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - override fun fieldsRow(): Row5 = super.fieldsRow() as Row5 + /** + * Create an inline derived table from this table + */ + 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)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(condition: SQL): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg binds: Any?): Store = where(DSL.condition(condition, *binds)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override fun where(@Stringly.SQL condition: String, vararg parts: QueryPart): Store = where(DSL.condition(condition, *parts)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - fun mapping(from: (Long?, Long?, Long?, LocalDateTime?, String?) -> U): SelectField = convertFrom(Records.mapping(from)) + override fun whereExists(select: Select<*>): Store = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - fun mapping(toType: Class, from: (Long?, Long?, Long?, LocalDateTime?, String?) -> U): SelectField = convertFrom(toType, Records.mapping(from)) + override fun whereNotExists(select: Select<*>): Store = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt index 2299cd1..8c422d7 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorInfoRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.ActorInfo import org.jooq.impl.TableRecordImpl @@ -15,7 +12,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class ActorInfoRecord() : TableRecordImpl(ActorInfo.ACTOR_INFO), Record4 { +open class ActorInfoRecord() : TableRecordImpl(ActorInfo.ACTOR_INFO) { open var actorId: Long? set(value): Unit = set(0, value) @@ -33,53 +30,6 @@ open class ActorInfoRecord() : TableRecordImpl(ActorInfo.ACTOR_ set(value): Unit = set(3, value) get(): String? = get(3) as String? - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = ActorInfo.ACTOR_INFO.ACTOR_ID - override fun field2(): Field = ActorInfo.ACTOR_INFO.FIRST_NAME - override fun field3(): Field = ActorInfo.ACTOR_INFO.LAST_NAME - override fun field4(): Field = ActorInfo.ACTOR_INFO.FILM_INFO - override fun component1(): Long? = actorId - override fun component2(): String? = firstName - override fun component3(): String? = lastName - override fun component4(): String? = filmInfo - override fun value1(): Long? = actorId - override fun value2(): String? = firstName - override fun value3(): String? = lastName - override fun value4(): String? = filmInfo - - override fun value1(value: Long?): ActorInfoRecord { - set(0, value) - return this - } - - override fun value2(value: String?): ActorInfoRecord { - set(1, value) - return this - } - - override fun value3(value: String?): ActorInfoRecord { - set(2, value) - return this - } - - override fun value4(value: String?): ActorInfoRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?): ActorInfoRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised ActorInfoRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt index d73bc57..22d6c62 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/ActorRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.Actor import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class ActorRecord() : UpdatableRecordImpl(Actor.ACTOR), Record4 { +open class ActorRecord() : UpdatableRecordImpl(Actor.ACTOR) { open var actorId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class ActorRecord() : UpdatableRecordImpl(Actor.ACTOR), Record override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = Actor.ACTOR.ACTOR_ID - override fun field2(): Field = Actor.ACTOR.FIRST_NAME - override fun field3(): Field = Actor.ACTOR.LAST_NAME - override fun field4(): Field = Actor.ACTOR.LAST_UPDATE - override fun component1(): Long? = actorId - override fun component2(): String? = firstName - override fun component3(): String? = lastName - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = actorId - override fun value2(): String? = firstName - override fun value3(): String? = lastName - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): ActorRecord { - set(0, value) - return this - } - - override fun value2(value: String?): ActorRecord { - set(1, value) - return this - } - - override fun value3(value: String?): ActorRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): ActorRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: LocalDateTime?): ActorRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised ActorRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt index 829dc94..aca8dfe 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/AddressRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.tables.Address import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class AddressRecord() : UpdatableRecordImpl(Address.ADDRESS), Record8 { +open class AddressRecord() : UpdatableRecordImpl(Address.ADDRESS) { open var addressId: Long? set(value): Unit = set(0, value) @@ -58,89 +55,6 @@ open class AddressRecord() : UpdatableRecordImpl(Address.ADDRESS) override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = Address.ADDRESS.ADDRESS_ID - override fun field2(): Field = Address.ADDRESS.ADDRESS_ - override fun field3(): Field = Address.ADDRESS.ADDRESS2 - override fun field4(): Field = Address.ADDRESS.DISTRICT - override fun field5(): Field = Address.ADDRESS.CITY_ID - override fun field6(): Field = Address.ADDRESS.POSTAL_CODE - override fun field7(): Field = Address.ADDRESS.PHONE - override fun field8(): Field = Address.ADDRESS.LAST_UPDATE - override fun component1(): Long? = addressId - override fun component2(): String? = address - override fun component3(): String? = address2 - override fun component4(): String? = district - override fun component5(): Long? = cityId - override fun component6(): String? = postalCode - override fun component7(): String? = phone - override fun component8(): LocalDateTime? = lastUpdate - override fun value1(): Long? = addressId - override fun value2(): String? = address - override fun value3(): String? = address2 - override fun value4(): String? = district - override fun value5(): Long? = cityId - override fun value6(): String? = postalCode - override fun value7(): String? = phone - override fun value8(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): AddressRecord { - set(0, value) - return this - } - - override fun value2(value: String?): AddressRecord { - set(1, value) - return this - } - - override fun value3(value: String?): AddressRecord { - set(2, value) - return this - } - - override fun value4(value: String?): AddressRecord { - set(3, value) - return this - } - - override fun value5(value: Long?): AddressRecord { - set(4, value) - return this - } - - override fun value6(value: String?): AddressRecord { - set(5, value) - return this - } - - override fun value7(value: String?): AddressRecord { - set(6, value) - return this - } - - override fun value8(value: LocalDateTime?): AddressRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: Long?, value6: String?, value7: String?, value8: LocalDateTime?): AddressRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised AddressRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt index fed3028..50ab505 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CategoryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.Category import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CategoryRecord() : UpdatableRecordImpl(Category.CATEGORY), Record3 { +open class CategoryRecord() : UpdatableRecordImpl(Category.CATEGORY) { open var categoryId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class CategoryRecord() : UpdatableRecordImpl(Category.CATEG override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = Category.CATEGORY.CATEGORY_ID - override fun field2(): Field = Category.CATEGORY.NAME - override fun field3(): Field = Category.CATEGORY.LAST_UPDATE - override fun component1(): Long? = categoryId - override fun component2(): String? = name - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = categoryId - override fun value2(): String? = name - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): CategoryRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CategoryRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): CategoryRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: LocalDateTime?): CategoryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised CategoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt index 929d667..94d47a2 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CityRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.City import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CityRecord() : UpdatableRecordImpl(City.CITY), Record4 { +open class CityRecord() : UpdatableRecordImpl(City.CITY) { open var cityId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class CityRecord() : UpdatableRecordImpl(City.CITY), Record4 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = City.CITY.CITY_ID - override fun field2(): Field = City.CITY.CITY_ - override fun field3(): Field = City.CITY.COUNTRY_ID - override fun field4(): Field = City.CITY.LAST_UPDATE - override fun component1(): Long? = cityId - override fun component2(): String? = city - override fun component3(): Long? = countryId - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = cityId - override fun value2(): String? = city - override fun value3(): Long? = countryId - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): CityRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CityRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): CityRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): CityRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: Long?, value4: LocalDateTime?): CityRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised CityRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt index 79b101f..791349f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CountryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.Country import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CountryRecord() : UpdatableRecordImpl(Country.COUNTRY), Record3 { +open class CountryRecord() : UpdatableRecordImpl(Country.COUNTRY) { open var countryId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class CountryRecord() : UpdatableRecordImpl(Country.COUNTRY) override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = Country.COUNTRY.COUNTRY_ID - override fun field2(): Field = Country.COUNTRY.COUNTRY_ - override fun field3(): Field = Country.COUNTRY.LAST_UPDATE - override fun component1(): Long? = countryId - override fun component2(): String? = country - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = countryId - override fun value2(): String? = country - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): CountryRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CountryRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): CountryRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: LocalDateTime?): CountryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised CountryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt index 70e71f0..0e60f5b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerListRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record9 -import org.jooq.Row9 import org.jooq.demo.kotlin.db.tables.CustomerList import org.jooq.impl.TableRecordImpl @@ -15,7 +12,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CustomerListRecord() : TableRecordImpl(CustomerList.CUSTOMER_LIST), Record9 { +open class CustomerListRecord() : TableRecordImpl(CustomerList.CUSTOMER_LIST) { open var id: Long? set(value): Unit = set(0, value) @@ -53,98 +50,6 @@ open class CustomerListRecord() : TableRecordImpl(CustomerLi set(value): Unit = set(8, value) get(): Long? = get(8) as Long? - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row9 = super.fieldsRow() as Row9 - override fun valuesRow(): Row9 = super.valuesRow() as Row9 - override fun field1(): Field = CustomerList.CUSTOMER_LIST.ID - override fun field2(): Field = CustomerList.CUSTOMER_LIST.NAME - override fun field3(): Field = CustomerList.CUSTOMER_LIST.ADDRESS - override fun field4(): Field = org.jooq.demo.kotlin.db.tables.CustomerList.CUSTOMER_LIST.`ZIP CODE` - override fun field5(): Field = CustomerList.CUSTOMER_LIST.PHONE - override fun field6(): Field = CustomerList.CUSTOMER_LIST.CITY - override fun field7(): Field = CustomerList.CUSTOMER_LIST.COUNTRY - override fun field8(): Field = CustomerList.CUSTOMER_LIST.NOTES - override fun field9(): Field = CustomerList.CUSTOMER_LIST.SID - override fun component1(): Long? = id - override fun component2(): String? = name - override fun component3(): String? = address - override fun component4(): String? = zipCode - override fun component5(): String? = phone - override fun component6(): String? = city - override fun component7(): String? = country - override fun component8(): String? = notes - override fun component9(): Long? = sid - override fun value1(): Long? = id - override fun value2(): String? = name - override fun value3(): String? = address - override fun value4(): String? = zipCode - override fun value5(): String? = phone - override fun value6(): String? = city - override fun value7(): String? = country - override fun value8(): String? = notes - override fun value9(): Long? = sid - - override fun value1(value: Long?): CustomerListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): CustomerListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): CustomerListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): CustomerListRecord { - set(3, value) - return this - } - - override fun value5(value: String?): CustomerListRecord { - set(4, value) - return this - } - - override fun value6(value: String?): CustomerListRecord { - set(5, value) - return this - } - - override fun value7(value: String?): CustomerListRecord { - set(6, value) - return this - } - - override fun value8(value: String?): CustomerListRecord { - set(7, value) - return this - } - - override fun value9(value: Long?): CustomerListRecord { - set(8, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: String?, value6: String?, value7: String?, value8: String?, value9: Long?): CustomerListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - return this - } - /** * Create a detached, initialised CustomerListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt index 9ae1243..f3ec039 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/CustomerRecord.kt @@ -7,10 +7,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDate import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record10 -import org.jooq.Row10 import org.jooq.demo.kotlin.db.tables.Customer import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class CustomerRecord() : UpdatableRecordImpl(Customer.CUSTOMER), Record10 { +open class CustomerRecord() : UpdatableRecordImpl(Customer.CUSTOMER) { open var customerId: Long? set(value): Unit = set(0, value) @@ -67,107 +64,6 @@ open class CustomerRecord() : UpdatableRecordImpl(Customer.CUSTO override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row10 = super.fieldsRow() as Row10 - override fun valuesRow(): Row10 = super.valuesRow() as Row10 - override fun field1(): Field = Customer.CUSTOMER.CUSTOMER_ID - override fun field2(): Field = Customer.CUSTOMER.STORE_ID - override fun field3(): Field = Customer.CUSTOMER.FIRST_NAME - override fun field4(): Field = Customer.CUSTOMER.LAST_NAME - override fun field5(): Field = Customer.CUSTOMER.EMAIL - override fun field6(): Field = Customer.CUSTOMER.ADDRESS_ID - override fun field7(): Field = Customer.CUSTOMER.ACTIVEBOOL - override fun field8(): Field = Customer.CUSTOMER.CREATE_DATE - override fun field9(): Field = Customer.CUSTOMER.LAST_UPDATE - override fun field10(): Field = Customer.CUSTOMER.ACTIVE - override fun component1(): Long? = customerId - override fun component2(): Long? = storeId - override fun component3(): String? = firstName - override fun component4(): String? = lastName - override fun component5(): String? = email - override fun component6(): Long? = addressId - override fun component7(): Boolean? = activebool - override fun component8(): LocalDate? = createDate - override fun component9(): LocalDateTime? = lastUpdate - override fun component10(): Int? = active - override fun value1(): Long? = customerId - override fun value2(): Long? = storeId - override fun value3(): String? = firstName - override fun value4(): String? = lastName - override fun value5(): String? = email - override fun value6(): Long? = addressId - override fun value7(): Boolean? = activebool - override fun value8(): LocalDate? = createDate - override fun value9(): LocalDateTime? = lastUpdate - override fun value10(): Int? = active - - override fun value1(value: Long?): CustomerRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): CustomerRecord { - set(1, value) - return this - } - - override fun value3(value: String?): CustomerRecord { - set(2, value) - return this - } - - override fun value4(value: String?): CustomerRecord { - set(3, value) - return this - } - - override fun value5(value: String?): CustomerRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): CustomerRecord { - set(5, value) - return this - } - - override fun value7(value: Boolean?): CustomerRecord { - set(6, value) - return this - } - - override fun value8(value: LocalDate?): CustomerRecord { - set(7, value) - return this - } - - override fun value9(value: LocalDateTime?): CustomerRecord { - set(8, value) - return this - } - - override fun value10(value: Int?): CustomerRecord { - set(9, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: String?, value4: String?, value5: String?, value6: Long?, value7: Boolean?, value8: LocalDate?, value9: LocalDateTime?, value10: Int?): CustomerRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - return this - } - /** * Create a detached, initialised CustomerRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt index fc8e787..99aae6d 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmActorRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.FilmActor import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmActorRecord() : UpdatableRecordImpl(FilmActor.FILM_ACTOR), Record3 { +open class FilmActorRecord() : UpdatableRecordImpl(FilmActor.FILM_ACTOR) { open var actorId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class FilmActorRecord() : UpdatableRecordImpl(FilmActor.FI override fun key(): Record2 = super.key() as Record2 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = FilmActor.FILM_ACTOR.ACTOR_ID - override fun field2(): Field = FilmActor.FILM_ACTOR.FILM_ID - override fun field3(): Field = FilmActor.FILM_ACTOR.LAST_UPDATE - override fun component1(): Long? = actorId - override fun component2(): Long? = filmId - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = actorId - override fun value2(): Long? = filmId - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): FilmActorRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): FilmActorRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): FilmActorRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: LocalDateTime?): FilmActorRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised FilmActorRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt index 6c01ce6..3ef511f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmCategoryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.FilmCategory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmCategoryRecord() : UpdatableRecordImpl(FilmCategory.FILM_CATEGORY), Record3 { +open class FilmCategoryRecord() : UpdatableRecordImpl(FilmCategory.FILM_CATEGORY) { open var filmId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class FilmCategoryRecord() : UpdatableRecordImpl(FilmCa override fun key(): Record2 = super.key() as Record2 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = FilmCategory.FILM_CATEGORY.FILM_ID - override fun field2(): Field = FilmCategory.FILM_CATEGORY.CATEGORY_ID - override fun field3(): Field = FilmCategory.FILM_CATEGORY.LAST_UPDATE - override fun component1(): Long? = filmId - override fun component2(): Long? = categoryId - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = filmId - override fun value2(): Long? = categoryId - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): FilmCategoryRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): FilmCategoryRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): FilmCategoryRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: LocalDateTime?): FilmCategoryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised FilmCategoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt index d73de26..832bdf3 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmInStockRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.kotlin.db.tables.FilmInStock import org.jooq.impl.TableRecordImpl @@ -15,32 +12,12 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmInStockRecord() : TableRecordImpl(FilmInStock.FILM_IN_STOCK), Record1 { +open class FilmInStockRecord() : TableRecordImpl(FilmInStock.FILM_IN_STOCK) { open var pFilmCount: Int? set(value): Unit = set(0, value) get(): Int? = get(0) as Int? - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 - override fun valuesRow(): Row1 = super.valuesRow() as Row1 - override fun field1(): Field = FilmInStock.FILM_IN_STOCK.P_FILM_COUNT - override fun component1(): Int? = pFilmCount - override fun value1(): Int? = pFilmCount - - override fun value1(value: Int?): FilmInStockRecord { - set(0, value) - return this - } - - override fun values(value1: Int?): FilmInStockRecord { - this.value1(value1) - return this - } - /** * Create a detached, initialised FilmInStockRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt index 38d1cee..050adc9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmListRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.FilmList import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmListRecord() : TableRecordImpl(FilmList.FILM_LIST), Record8 { +open class FilmListRecord() : TableRecordImpl(FilmList.FILM_LIST) { open var fid: Long? set(value): Unit = set(0, value) @@ -52,89 +49,6 @@ open class FilmListRecord() : TableRecordImpl(FilmList.FILM_LIST set(value): Unit = set(7, value) get(): String? = get(7) as String? - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = FilmList.FILM_LIST.FID - override fun field2(): Field = FilmList.FILM_LIST.TITLE - override fun field3(): Field = FilmList.FILM_LIST.DESCRIPTION - override fun field4(): Field = FilmList.FILM_LIST.CATEGORY - override fun field5(): Field = FilmList.FILM_LIST.PRICE - override fun field6(): Field = FilmList.FILM_LIST.LENGTH - override fun field7(): Field = FilmList.FILM_LIST.RATING - override fun field8(): Field = FilmList.FILM_LIST.ACTORS - override fun component1(): Long? = fid - override fun component2(): String? = title - override fun component3(): String? = description - override fun component4(): String? = category - override fun component5(): BigDecimal? = price - override fun component6(): Short? = length - override fun component7(): MpaaRating? = rating - override fun component8(): String? = actors - override fun value1(): Long? = fid - override fun value2(): String? = title - override fun value3(): String? = description - override fun value4(): String? = category - override fun value5(): BigDecimal? = price - override fun value6(): Short? = length - override fun value7(): MpaaRating? = rating - override fun value8(): String? = actors - - override fun value1(value: Long?): FilmListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): FilmListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): FilmListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): FilmListRecord { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): FilmListRecord { - set(4, value) - return this - } - - override fun value6(value: Short?): FilmListRecord { - set(5, value) - return this - } - - override fun value7(value: MpaaRating?): FilmListRecord { - set(6, value) - return this - } - - override fun value8(value: String?): FilmListRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: BigDecimal?, value6: Short?, value7: MpaaRating?, value8: String?): FilmListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised FilmListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt index e7179b2..fee14e3 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmNotInStockRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.kotlin.db.tables.FilmNotInStock import org.jooq.impl.TableRecordImpl @@ -15,32 +12,12 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmNotInStockRecord() : TableRecordImpl(FilmNotInStock.FILM_NOT_IN_STOCK), Record1 { +open class FilmNotInStockRecord() : TableRecordImpl(FilmNotInStock.FILM_NOT_IN_STOCK) { open var pFilmCount: Int? set(value): Unit = set(0, value) get(): Int? = get(0) as Int? - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row1 = super.fieldsRow() as Row1 - override fun valuesRow(): Row1 = super.valuesRow() as Row1 - override fun field1(): Field = FilmNotInStock.FILM_NOT_IN_STOCK.P_FILM_COUNT - override fun component1(): Int? = pFilmCount - override fun value1(): Int? = pFilmCount - - override fun value1(value: Int?): FilmNotInStockRecord { - set(0, value) - return this - } - - override fun values(value1: Int?): FilmNotInStockRecord { - this.value1(value1) - return this - } - /** * Create a detached, initialised FilmNotInStockRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt index 01b5416..9240e89 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/FilmRecord.kt @@ -7,10 +7,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record14 -import org.jooq.Row14 import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.Film import org.jooq.impl.UpdatableRecordImpl @@ -20,7 +17,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class FilmRecord() : UpdatableRecordImpl(Film.FILM), Record14?, Any?> { +open class FilmRecord() : UpdatableRecordImpl(Film.FILM) { open var filmId: Long? set(value): Unit = set(0, value) @@ -84,147 +81,6 @@ open class FilmRecord() : UpdatableRecordImpl(Film.FILM), Record14 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row14?, Any?> = super.fieldsRow() as Row14?, Any?> - override fun valuesRow(): Row14?, Any?> = super.valuesRow() as Row14?, Any?> - override fun field1(): Field = Film.FILM.FILM_ID - override fun field2(): Field = Film.FILM.TITLE - override fun field3(): Field = Film.FILM.DESCRIPTION - override fun field4(): Field = Film.FILM.RELEASE_YEAR - override fun field5(): Field = Film.FILM.LANGUAGE_ID - override fun field6(): Field = Film.FILM.ORIGINAL_LANGUAGE_ID - override fun field7(): Field = Film.FILM.RENTAL_DURATION - override fun field8(): Field = Film.FILM.RENTAL_RATE - override fun field9(): Field = Film.FILM.LENGTH - override fun field10(): Field = Film.FILM.REPLACEMENT_COST - override fun field11(): Field = Film.FILM.RATING - override fun field12(): Field = Film.FILM.LAST_UPDATE - override fun field13(): Field?> = Film.FILM.SPECIAL_FEATURES - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun field14(): Field = Film.FILM.FULLTEXT - override fun component1(): Long? = filmId - override fun component2(): String? = title - override fun component3(): String? = description - override fun component4(): Int? = releaseYear - override fun component5(): Long? = languageId - override fun component6(): Long? = originalLanguageId - override fun component7(): Short? = rentalDuration - override fun component8(): BigDecimal? = rentalRate - override fun component9(): Short? = length - override fun component10(): BigDecimal? = replacementCost - override fun component11(): MpaaRating? = rating - override fun component12(): LocalDateTime? = lastUpdate - override fun component13(): Array? = specialFeatures - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun component14(): Any? = fulltext - override fun value1(): Long? = filmId - override fun value2(): String? = title - override fun value3(): String? = description - override fun value4(): Int? = releaseYear - override fun value5(): Long? = languageId - override fun value6(): Long? = originalLanguageId - override fun value7(): Short? = rentalDuration - override fun value8(): BigDecimal? = rentalRate - override fun value9(): Short? = length - override fun value10(): BigDecimal? = replacementCost - override fun value11(): MpaaRating? = rating - override fun value12(): LocalDateTime? = lastUpdate - override fun value13(): Array? = specialFeatures - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun value14(): Any? = fulltext - - override fun value1(value: Long?): FilmRecord { - set(0, value) - return this - } - - override fun value2(value: String?): FilmRecord { - set(1, value) - return this - } - - override fun value3(value: String?): FilmRecord { - set(2, value) - return this - } - - override fun value4(value: Int?): FilmRecord { - set(3, value) - return this - } - - override fun value5(value: Long?): FilmRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): FilmRecord { - set(5, value) - return this - } - - override fun value7(value: Short?): FilmRecord { - set(6, value) - return this - } - - override fun value8(value: BigDecimal?): FilmRecord { - set(7, value) - return this - } - - override fun value9(value: Short?): FilmRecord { - set(8, value) - return this - } - - override fun value10(value: BigDecimal?): FilmRecord { - set(9, value) - return this - } - - override fun value11(value: MpaaRating?): FilmRecord { - set(10, value) - return this - } - - override fun value12(value: LocalDateTime?): FilmRecord { - set(11, value) - return this - } - - override fun value13(value: Array?): FilmRecord { - set(12, value) - return this - } - - @Deprecated(message = "Unknown data type. If this is a qualified, user-defined type, it may have been excluded from code generation. If this is a built-in type, you can define an explicit org.jooq.Binding to specify how this type should be handled. Deprecation can be turned off using in your code generator configuration.") - override fun value14(value: Any?): FilmRecord { - set(13, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: Int?, value5: Long?, value6: Long?, value7: Short?, value8: BigDecimal?, value9: Short?, value10: BigDecimal?, value11: MpaaRating?, value12: LocalDateTime?, value13: Array?, value14: Any?): FilmRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this.value12(value12) - this.value13(value13) - this.value14(value14) - return this - } - /** * Create a detached, initialised FilmRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt index f4dcecf..ca237eb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/InventoryRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.kotlin.db.tables.Inventory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class InventoryRecord() : UpdatableRecordImpl(Inventory.INVENTORY), Record4 { +open class InventoryRecord() : UpdatableRecordImpl(Inventory.INVENTORY) { open var inventoryId: Long? set(value): Unit = set(0, value) @@ -42,53 +39,6 @@ open class InventoryRecord() : UpdatableRecordImpl(Inventory.IN override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row4 = super.fieldsRow() as Row4 - override fun valuesRow(): Row4 = super.valuesRow() as Row4 - override fun field1(): Field = Inventory.INVENTORY.INVENTORY_ID - override fun field2(): Field = Inventory.INVENTORY.FILM_ID - override fun field3(): Field = Inventory.INVENTORY.STORE_ID - override fun field4(): Field = Inventory.INVENTORY.LAST_UPDATE - override fun component1(): Long? = inventoryId - override fun component2(): Long? = filmId - override fun component3(): Long? = storeId - override fun component4(): LocalDateTime? = lastUpdate - override fun value1(): Long? = inventoryId - override fun value2(): Long? = filmId - override fun value3(): Long? = storeId - override fun value4(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): InventoryRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): InventoryRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): InventoryRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): InventoryRecord { - set(3, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: LocalDateTime?): InventoryRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - return this - } - /** * Create a detached, initialised InventoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt index 9adf90f..8b68523 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/LanguageRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.Language import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class LanguageRecord() : UpdatableRecordImpl(Language.LANGUAGE), Record3 { +open class LanguageRecord() : UpdatableRecordImpl(Language.LANGUAGE) { open var languageId: Long? set(value): Unit = set(0, value) @@ -38,44 +35,6 @@ open class LanguageRecord() : UpdatableRecordImpl(Language.LANGU override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = Language.LANGUAGE.LANGUAGE_ID - override fun field2(): Field = Language.LANGUAGE.NAME - override fun field3(): Field = Language.LANGUAGE.LAST_UPDATE - override fun component1(): Long? = languageId - override fun component2(): String? = name - override fun component3(): LocalDateTime? = lastUpdate - override fun value1(): Long? = languageId - override fun value2(): String? = name - override fun value3(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): LanguageRecord { - set(0, value) - return this - } - - override fun value2(value: String?): LanguageRecord { - set(1, value) - return this - } - - override fun value3(value: LocalDateTime?): LanguageRecord { - set(2, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: LocalDateTime?): LanguageRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised LanguageRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt index ef0a40a..c60f09a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/NicerButSlowerFilmListRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.enums.MpaaRating import org.jooq.demo.kotlin.db.tables.NicerButSlowerFilmList import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class NicerButSlowerFilmListRecord() : TableRecordImpl(NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST), Record8 { +open class NicerButSlowerFilmListRecord() : TableRecordImpl(NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST) { open var fid: Long? set(value): Unit = set(0, value) @@ -52,89 +49,6 @@ open class NicerButSlowerFilmListRecord() : TableRecordImpl = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.FID - override fun field2(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.TITLE - override fun field3(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.DESCRIPTION - override fun field4(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.CATEGORY - override fun field5(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.PRICE - override fun field6(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.LENGTH - override fun field7(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.RATING - override fun field8(): Field = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.ACTORS - override fun component1(): Long? = fid - override fun component2(): String? = title - override fun component3(): String? = description - override fun component4(): String? = category - override fun component5(): BigDecimal? = price - override fun component6(): Short? = length - override fun component7(): MpaaRating? = rating - override fun component8(): String? = actors - override fun value1(): Long? = fid - override fun value2(): String? = title - override fun value3(): String? = description - override fun value4(): String? = category - override fun value5(): BigDecimal? = price - override fun value6(): Short? = length - override fun value7(): MpaaRating? = rating - override fun value8(): String? = actors - - override fun value1(value: Long?): NicerButSlowerFilmListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): NicerButSlowerFilmListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): NicerButSlowerFilmListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): NicerButSlowerFilmListRecord { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): NicerButSlowerFilmListRecord { - set(4, value) - return this - } - - override fun value6(value: Short?): NicerButSlowerFilmListRecord { - set(5, value) - return this - } - - override fun value7(value: MpaaRating?): NicerButSlowerFilmListRecord { - set(6, value) - return this - } - - override fun value8(value: String?): NicerButSlowerFilmListRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: BigDecimal?, value6: Short?, value7: MpaaRating?, value8: String?): NicerButSlowerFilmListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised NicerButSlowerFilmListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt index b34209e..0cabf8b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_01Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_01 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_01Record() : TableRecordImpl(PaymentP2007_01.PAYMENT_P2007_01), Record6 { +open class PaymentP2007_01Record() : TableRecordImpl(PaymentP2007_01.PAYMENT_P2007_01) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_01Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_ID - override fun field2(): Field = PaymentP2007_01.PAYMENT_P2007_01.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_01.PAYMENT_P2007_01.STAFF_ID - override fun field4(): Field = PaymentP2007_01.PAYMENT_P2007_01.RENTAL_ID - override fun field5(): Field = PaymentP2007_01.PAYMENT_P2007_01.AMOUNT - override fun field6(): Field = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_01Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_01Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_01Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_01Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_01Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_01Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_01Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_01Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt index 5cb93b0..8e5c29b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_02Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_02 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_02Record() : TableRecordImpl(PaymentP2007_02.PAYMENT_P2007_02), Record6 { +open class PaymentP2007_02Record() : TableRecordImpl(PaymentP2007_02.PAYMENT_P2007_02) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_02Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_ID - override fun field2(): Field = PaymentP2007_02.PAYMENT_P2007_02.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_02.PAYMENT_P2007_02.STAFF_ID - override fun field4(): Field = PaymentP2007_02.PAYMENT_P2007_02.RENTAL_ID - override fun field5(): Field = PaymentP2007_02.PAYMENT_P2007_02.AMOUNT - override fun field6(): Field = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_02Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_02Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_02Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_02Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_02Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_02Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_02Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_02Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt index c7c86e8..6e27765 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_03Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_03 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_03Record() : TableRecordImpl(PaymentP2007_03.PAYMENT_P2007_03), Record6 { +open class PaymentP2007_03Record() : TableRecordImpl(PaymentP2007_03.PAYMENT_P2007_03) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_03Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_ID - override fun field2(): Field = PaymentP2007_03.PAYMENT_P2007_03.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_03.PAYMENT_P2007_03.STAFF_ID - override fun field4(): Field = PaymentP2007_03.PAYMENT_P2007_03.RENTAL_ID - override fun field5(): Field = PaymentP2007_03.PAYMENT_P2007_03.AMOUNT - override fun field6(): Field = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_03Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_03Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_03Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_03Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_03Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_03Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_03Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_03Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt index d19447e..f8b6a26 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_04Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_04 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_04Record() : TableRecordImpl(PaymentP2007_04.PAYMENT_P2007_04), Record6 { +open class PaymentP2007_04Record() : TableRecordImpl(PaymentP2007_04.PAYMENT_P2007_04) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_04Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_ID - override fun field2(): Field = PaymentP2007_04.PAYMENT_P2007_04.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_04.PAYMENT_P2007_04.STAFF_ID - override fun field4(): Field = PaymentP2007_04.PAYMENT_P2007_04.RENTAL_ID - override fun field5(): Field = PaymentP2007_04.PAYMENT_P2007_04.AMOUNT - override fun field6(): Field = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_04Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_04Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_04Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_04Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_04Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_04Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_04Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_04Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt index 054d1b2..c7ef019 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_05Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_05 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_05Record() : TableRecordImpl(PaymentP2007_05.PAYMENT_P2007_05), Record6 { +open class PaymentP2007_05Record() : TableRecordImpl(PaymentP2007_05.PAYMENT_P2007_05) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_05Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_ID - override fun field2(): Field = PaymentP2007_05.PAYMENT_P2007_05.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_05.PAYMENT_P2007_05.STAFF_ID - override fun field4(): Field = PaymentP2007_05.PAYMENT_P2007_05.RENTAL_ID - override fun field5(): Field = PaymentP2007_05.PAYMENT_P2007_05.AMOUNT - override fun field6(): Field = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_05Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_05Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_05Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_05Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_05Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_05Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_05Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_05Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt index a809a5b..2cc309b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentP2007_06Record.kt @@ -7,9 +7,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.PaymentP2007_06 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentP2007_06Record() : TableRecordImpl(PaymentP2007_06.PAYMENT_P2007_06), Record6 { +open class PaymentP2007_06Record() : TableRecordImpl(PaymentP2007_06.PAYMENT_P2007_06) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -44,71 +41,6 @@ open class PaymentP2007_06Record() : TableRecordImpl(Paym set(value): Unit = set(5, value) get(): LocalDateTime? = get(5) as LocalDateTime? - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_ID - override fun field2(): Field = PaymentP2007_06.PAYMENT_P2007_06.CUSTOMER_ID - override fun field3(): Field = PaymentP2007_06.PAYMENT_P2007_06.STAFF_ID - override fun field4(): Field = PaymentP2007_06.PAYMENT_P2007_06.RENTAL_ID - override fun field5(): Field = PaymentP2007_06.PAYMENT_P2007_06.AMOUNT - override fun field6(): Field = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentP2007_06Record { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentP2007_06Record { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentP2007_06Record { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentP2007_06Record { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentP2007_06Record { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentP2007_06Record { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentP2007_06Record { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentP2007_06Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt index b014ffd..eb629fd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/PaymentRecord.kt @@ -7,10 +7,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.kotlin.db.tables.Payment import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class PaymentRecord() : UpdatableRecordImpl(Payment.PAYMENT), Record6 { +open class PaymentRecord() : UpdatableRecordImpl(Payment.PAYMENT) { open var paymentId: Long? set(value): Unit = set(0, value) @@ -51,71 +48,6 @@ open class PaymentRecord() : UpdatableRecordImpl(Payment.PAYMENT) override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row6 = super.fieldsRow() as Row6 - override fun valuesRow(): Row6 = super.valuesRow() as Row6 - override fun field1(): Field = Payment.PAYMENT.PAYMENT_ID - override fun field2(): Field = Payment.PAYMENT.CUSTOMER_ID - override fun field3(): Field = Payment.PAYMENT.STAFF_ID - override fun field4(): Field = Payment.PAYMENT.RENTAL_ID - override fun field5(): Field = Payment.PAYMENT.AMOUNT - override fun field6(): Field = Payment.PAYMENT.PAYMENT_DATE - override fun component1(): Long? = paymentId - override fun component2(): Long? = customerId - override fun component3(): Long? = staffId - override fun component4(): Long? = rentalId - override fun component5(): BigDecimal? = amount - override fun component6(): LocalDateTime? = paymentDate - override fun value1(): Long? = paymentId - override fun value2(): Long? = customerId - override fun value3(): Long? = staffId - override fun value4(): Long? = rentalId - override fun value5(): BigDecimal? = amount - override fun value6(): LocalDateTime? = paymentDate - - override fun value1(value: Long?): PaymentRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): PaymentRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): PaymentRecord { - set(2, value) - return this - } - - override fun value4(value: Long?): PaymentRecord { - set(3, value) - return this - } - - override fun value5(value: BigDecimal?): PaymentRecord { - set(4, value) - return this - } - - override fun value6(value: LocalDateTime?): PaymentRecord { - set(5, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: Long?, value5: BigDecimal?, value6: LocalDateTime?): PaymentRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - return this - } - /** * Create a detached, initialised PaymentRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt index c3e03bc..bab5196 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/RentalRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record7 -import org.jooq.Row7 import org.jooq.demo.kotlin.db.tables.Rental import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class RentalRecord() : UpdatableRecordImpl(Rental.RENTAL), Record7 { +open class RentalRecord() : UpdatableRecordImpl(Rental.RENTAL) { open var rentalId: Long? set(value): Unit = set(0, value) @@ -54,80 +51,6 @@ open class RentalRecord() : UpdatableRecordImpl(Rental.RENTAL), Re override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row7 = super.fieldsRow() as Row7 - override fun valuesRow(): Row7 = super.valuesRow() as Row7 - override fun field1(): Field = Rental.RENTAL.RENTAL_ID - override fun field2(): Field = Rental.RENTAL.RENTAL_DATE - override fun field3(): Field = Rental.RENTAL.INVENTORY_ID - override fun field4(): Field = Rental.RENTAL.CUSTOMER_ID - override fun field5(): Field = Rental.RENTAL.RETURN_DATE - override fun field6(): Field = Rental.RENTAL.STAFF_ID - override fun field7(): Field = Rental.RENTAL.LAST_UPDATE - override fun component1(): Long? = rentalId - override fun component2(): LocalDateTime? = rentalDate - override fun component3(): Long? = inventoryId - override fun component4(): Long? = customerId - override fun component5(): LocalDateTime? = returnDate - override fun component6(): Long? = staffId - override fun component7(): LocalDateTime? = lastUpdate - override fun value1(): Long? = rentalId - override fun value2(): LocalDateTime? = rentalDate - override fun value3(): Long? = inventoryId - override fun value4(): Long? = customerId - override fun value5(): LocalDateTime? = returnDate - override fun value6(): Long? = staffId - override fun value7(): LocalDateTime? = lastUpdate - - override fun value1(value: Long?): RentalRecord { - set(0, value) - return this - } - - override fun value2(value: LocalDateTime?): RentalRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): RentalRecord { - set(2, value) - return this - } - - override fun value4(value: Long?): RentalRecord { - set(3, value) - return this - } - - override fun value5(value: LocalDateTime?): RentalRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): RentalRecord { - set(5, value) - return this - } - - override fun value7(value: LocalDateTime?): RentalRecord { - set(6, value) - return this - } - - override fun values(value1: Long?, value2: LocalDateTime?, value3: Long?, value4: Long?, value5: LocalDateTime?, value6: Long?, value7: LocalDateTime?): RentalRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - return this - } - /** * Create a detached, initialised RentalRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt index 8a0275c..e38bca9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByFilmCategoryRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record2 -import org.jooq.Row2 import org.jooq.demo.kotlin.db.tables.SalesByFilmCategory import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class SalesByFilmCategoryRecord() : TableRecordImpl(SalesByFilmCategory.SALES_BY_FILM_CATEGORY), Record2 { +open class SalesByFilmCategoryRecord() : TableRecordImpl(SalesByFilmCategory.SALES_BY_FILM_CATEGORY) { open var category: String? set(value): Unit = set(0, value) @@ -27,35 +24,6 @@ open class SalesByFilmCategoryRecord() : TableRecordImpl = super.fieldsRow() as Row2 - override fun valuesRow(): Row2 = super.valuesRow() as Row2 - override fun field1(): Field = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.CATEGORY - override fun field2(): Field = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.TOTAL_SALES - override fun component1(): String? = category - override fun component2(): BigDecimal? = totalSales - override fun value1(): String? = category - override fun value2(): BigDecimal? = totalSales - - override fun value1(value: String?): SalesByFilmCategoryRecord { - set(0, value) - return this - } - - override fun value2(value: BigDecimal?): SalesByFilmCategoryRecord { - set(1, value) - return this - } - - override fun values(value1: String?, value2: BigDecimal?): SalesByFilmCategoryRecord { - this.value1(value1) - this.value2(value2) - return this - } - /** * Create a detached, initialised SalesByFilmCategoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt index c7a1a4c..ed31866 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/SalesByStoreRecord.kt @@ -6,9 +6,6 @@ package org.jooq.demo.kotlin.db.tables.records import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.kotlin.db.tables.SalesByStore import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class SalesByStoreRecord() : TableRecordImpl(SalesByStore.SALES_BY_STORE), Record3 { +open class SalesByStoreRecord() : TableRecordImpl(SalesByStore.SALES_BY_STORE) { open var store: String? set(value): Unit = set(0, value) @@ -31,44 +28,6 @@ open class SalesByStoreRecord() : TableRecordImpl(SalesBySto set(value): Unit = set(2, value) get(): BigDecimal? = get(2) as BigDecimal? - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row3 = super.fieldsRow() as Row3 - override fun valuesRow(): Row3 = super.valuesRow() as Row3 - override fun field1(): Field = SalesByStore.SALES_BY_STORE.STORE - override fun field2(): Field = SalesByStore.SALES_BY_STORE.MANAGER - override fun field3(): Field = SalesByStore.SALES_BY_STORE.TOTAL_SALES - override fun component1(): String? = store - override fun component2(): String? = manager - override fun component3(): BigDecimal? = totalSales - override fun value1(): String? = store - override fun value2(): String? = manager - override fun value3(): BigDecimal? = totalSales - - override fun value1(value: String?): SalesByStoreRecord { - set(0, value) - return this - } - - override fun value2(value: String?): SalesByStoreRecord { - set(1, value) - return this - } - - override fun value3(value: BigDecimal?): SalesByStoreRecord { - set(2, value) - return this - } - - override fun values(value1: String?, value2: String?, value3: BigDecimal?): SalesByStoreRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - return this - } - /** * Create a detached, initialised SalesByStoreRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt index ece29ce..b96b763 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffListRecord.kt @@ -4,9 +4,6 @@ package org.jooq.demo.kotlin.db.tables.records -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.kotlin.db.tables.StaffList import org.jooq.impl.TableRecordImpl @@ -15,7 +12,7 @@ import org.jooq.impl.TableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class StaffListRecord() : TableRecordImpl(StaffList.STAFF_LIST), Record8 { +open class StaffListRecord() : TableRecordImpl(StaffList.STAFF_LIST) { open var id: Long? set(value): Unit = set(0, value) @@ -49,89 +46,6 @@ open class StaffListRecord() : TableRecordImpl(StaffList.STAFF_ set(value): Unit = set(7, value) get(): Long? = get(7) as Long? - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row8 = super.fieldsRow() as Row8 - override fun valuesRow(): Row8 = super.valuesRow() as Row8 - override fun field1(): Field = StaffList.STAFF_LIST.ID - override fun field2(): Field = StaffList.STAFF_LIST.NAME - override fun field3(): Field = StaffList.STAFF_LIST.ADDRESS - override fun field4(): Field = org.jooq.demo.kotlin.db.tables.StaffList.STAFF_LIST.`ZIP CODE` - override fun field5(): Field = StaffList.STAFF_LIST.PHONE - override fun field6(): Field = StaffList.STAFF_LIST.CITY - override fun field7(): Field = StaffList.STAFF_LIST.COUNTRY - override fun field8(): Field = StaffList.STAFF_LIST.SID - override fun component1(): Long? = id - override fun component2(): String? = name - override fun component3(): String? = address - override fun component4(): String? = zipCode - override fun component5(): String? = phone - override fun component6(): String? = city - override fun component7(): String? = country - override fun component8(): Long? = sid - override fun value1(): Long? = id - override fun value2(): String? = name - override fun value3(): String? = address - override fun value4(): String? = zipCode - override fun value5(): String? = phone - override fun value6(): String? = city - override fun value7(): String? = country - override fun value8(): Long? = sid - - override fun value1(value: Long?): StaffListRecord { - set(0, value) - return this - } - - override fun value2(value: String?): StaffListRecord { - set(1, value) - return this - } - - override fun value3(value: String?): StaffListRecord { - set(2, value) - return this - } - - override fun value4(value: String?): StaffListRecord { - set(3, value) - return this - } - - override fun value5(value: String?): StaffListRecord { - set(4, value) - return this - } - - override fun value6(value: String?): StaffListRecord { - set(5, value) - return this - } - - override fun value7(value: String?): StaffListRecord { - set(6, value) - return this - } - - override fun value8(value: Long?): StaffListRecord { - set(7, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: String?, value5: String?, value6: String?, value7: String?, value8: Long?): StaffListRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - return this - } - /** * Create a detached, initialised StaffListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt index 81907ae..560c18c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StaffRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record13 -import org.jooq.Row13 import org.jooq.demo.kotlin.db.tables.Staff import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class StaffRecord() : UpdatableRecordImpl(Staff.STAFF), Record13 { +open class StaffRecord() : UpdatableRecordImpl(Staff.STAFF) { open var staffId: Long? set(value): Unit = set(0, value) @@ -78,134 +75,6 @@ open class StaffRecord() : UpdatableRecordImpl(Staff.STAFF), Record override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record13 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row13 = super.fieldsRow() as Row13 - override fun valuesRow(): Row13 = super.valuesRow() as Row13 - override fun field1(): Field = Staff.STAFF.STAFF_ID - override fun field2(): Field = Staff.STAFF.FIRST_NAME - override fun field3(): Field = Staff.STAFF.LAST_NAME - override fun field4(): Field = Staff.STAFF.ADDRESS_ID - override fun field5(): Field = Staff.STAFF.EMAIL - override fun field6(): Field = Staff.STAFF.STORE_ID - override fun field7(): Field = Staff.STAFF.ACTIVE - override fun field8(): Field = Staff.STAFF.USERNAME - override fun field9(): Field = Staff.STAFF.PASSWORD - override fun field10(): Field = Staff.STAFF.LAST_UPDATE - override fun field11(): Field = Staff.STAFF.PICTURE - override fun field12(): Field = Staff.STAFF.FULL_ADDRESS - override fun field13(): Field = Staff.STAFF.FULL_NAME - override fun component1(): Long? = staffId - override fun component2(): String? = firstName - override fun component3(): String? = lastName - override fun component4(): Long? = addressId - override fun component5(): String? = email - override fun component6(): Long? = storeId - override fun component7(): Boolean? = active - override fun component8(): String? = username - override fun component9(): String? = password - override fun component10(): LocalDateTime? = lastUpdate - override fun component11(): ByteArray? = picture - override fun component12(): String? = fullAddress - override fun component13(): String? = fullName - override fun value1(): Long? = staffId - override fun value2(): String? = firstName - override fun value3(): String? = lastName - override fun value4(): Long? = addressId - override fun value5(): String? = email - override fun value6(): Long? = storeId - override fun value7(): Boolean? = active - override fun value8(): String? = username - override fun value9(): String? = password - override fun value10(): LocalDateTime? = lastUpdate - override fun value11(): ByteArray? = picture - override fun value12(): String? = fullAddress - override fun value13(): String? = fullName - - override fun value1(value: Long?): StaffRecord { - set(0, value) - return this - } - - override fun value2(value: String?): StaffRecord { - set(1, value) - return this - } - - override fun value3(value: String?): StaffRecord { - set(2, value) - return this - } - - override fun value4(value: Long?): StaffRecord { - set(3, value) - return this - } - - override fun value5(value: String?): StaffRecord { - set(4, value) - return this - } - - override fun value6(value: Long?): StaffRecord { - set(5, value) - return this - } - - override fun value7(value: Boolean?): StaffRecord { - set(6, value) - return this - } - - override fun value8(value: String?): StaffRecord { - set(7, value) - return this - } - - override fun value9(value: String?): StaffRecord { - set(8, value) - return this - } - - override fun value10(value: LocalDateTime?): StaffRecord { - set(9, value) - return this - } - - override fun value11(value: ByteArray?): StaffRecord { - set(10, value) - return this - } - - override fun value12(value: String?): StaffRecord { - set(11, value) - return this - } - - override fun value13(value: String?): StaffRecord { - set(12, value) - return this - } - - override fun values(value1: Long?, value2: String?, value3: String?, value4: Long?, value5: String?, value6: Long?, value7: Boolean?, value8: String?, value9: String?, value10: LocalDateTime?, value11: ByteArray?, value12: String?, value13: String?): StaffRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this.value12(value12) - this.value13(value13) - return this - } - /** * Create a detached, initialised StaffRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt index fc2dbd5..acbfa10 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/tables/records/StoreRecord.kt @@ -6,10 +6,7 @@ package org.jooq.demo.kotlin.db.tables.records import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record5 -import org.jooq.Row5 import org.jooq.demo.kotlin.db.tables.Store import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl * This class is generated by jOOQ. */ @Suppress("UNCHECKED_CAST") -open class StoreRecord() : UpdatableRecordImpl(Store.STORE), Record5 { +open class StoreRecord() : UpdatableRecordImpl(Store.STORE) { open var storeId: Long? set(value): Unit = set(0, value) @@ -46,62 +43,6 @@ open class StoreRecord() : UpdatableRecordImpl(Store.STORE), Record override fun key(): Record1 = super.key() as Record1 - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - override fun fieldsRow(): Row5 = super.fieldsRow() as Row5 - override fun valuesRow(): Row5 = super.valuesRow() as Row5 - override fun field1(): Field = Store.STORE.STORE_ID - override fun field2(): Field = Store.STORE.MANAGER_STAFF_ID - override fun field3(): Field = Store.STORE.ADDRESS_ID - override fun field4(): Field = Store.STORE.LAST_UPDATE - override fun field5(): Field = Store.STORE.FULL_ADDRESS - override fun component1(): Long? = storeId - override fun component2(): Long? = managerStaffId - override fun component3(): Long? = addressId - override fun component4(): LocalDateTime? = lastUpdate - override fun component5(): String? = fullAddress - override fun value1(): Long? = storeId - override fun value2(): Long? = managerStaffId - override fun value3(): Long? = addressId - override fun value4(): LocalDateTime? = lastUpdate - override fun value5(): String? = fullAddress - - override fun value1(value: Long?): StoreRecord { - set(0, value) - return this - } - - override fun value2(value: Long?): StoreRecord { - set(1, value) - return this - } - - override fun value3(value: Long?): StoreRecord { - set(2, value) - return this - } - - override fun value4(value: LocalDateTime?): StoreRecord { - set(3, value) - return this - } - - override fun value5(value: String?): StoreRecord { - set(4, value) - return this - } - - override fun values(value1: Long?, value2: Long?, value3: Long?, value4: LocalDateTime?, value5: String?): StoreRecord { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - return this - } - /** * Create a detached, initialised StoreRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/triggers/Triggers.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/triggers/Triggers.kt new file mode 100644 index 0000000..6592449 --- /dev/null +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/main/kotlin/org/jooq/demo/kotlin/db/triggers/Triggers.kt @@ -0,0 +1,30 @@ +/* + * This file is generated by jOOQ. + */ +package org.jooq.demo.kotlin.db.triggers + + +import java.util.Arrays +import java.util.EnumSet + +import org.jooq.Trigger +import org.jooq.TriggerEvent +import org.jooq.TriggerExecution +import org.jooq.TriggerTime +import org.jooq.demo.kotlin.db.Public +import org.jooq.demo.kotlin.db.tables.Actor +import org.jooq.demo.kotlin.db.tables.Film +import org.jooq.impl.DSL +import org.jooq.impl.Internal + + + +/** + * The trigger public.film_fulltext_trigger + */ +val FILM_FULLTEXT_TRIGGER: Trigger = Internal.createTrigger(Public.PUBLIC, Film.FILM, Arrays.asList(), DSL.name("film_fulltext_trigger"), DSL.comment(""), TriggerTime.BEFORE, EnumSet.of(TriggerEvent.INSERT, TriggerEvent.UPDATE), TriggerExecution.FOR_EACH_ROW, null, 1, DSL.statement("EXECUTE FUNCTION tsvector_update_trigger('fulltext', 'pg_catalog.english', 'title', 'description')")) + +/** + * The trigger public.last_updated + */ +val LAST_UPDATED: Trigger = Internal.createTrigger(Public.PUBLIC, Actor.ACTOR, Arrays.asList(), DSL.name("last_updated"), DSL.comment(""), TriggerTime.BEFORE, EnumSet.of(TriggerEvent.UPDATE), TriggerExecution.FOR_EACH_ROW, null, 1, DSL.statement("EXECUTE FUNCTION last_updated()")) diff --git a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt index 478c10d..2eaaef9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt +++ b/jOOQ-demo-pro/jOOQ-demo-kotlin/src/test/kotlin/org/jooq/demo/kotlin/Demo14Mocking.kt @@ -8,7 +8,6 @@ import org.jooq.tools.jdbc.MockConnection import org.jooq.tools.jdbc.MockDataProvider import org.jooq.tools.jdbc.MockFileDatabase import org.jooq.tools.jdbc.MockResult -import org.junit.After import org.junit.Test @@ -27,7 +26,11 @@ class Demo14Mocking : AbstractDemo() { val p = MockDataProvider { c -> arrayOf( if (c.sql().contains("select")) - MockResult(ctx.newRecord(ACTOR).values(1L, "A", "A", null)) + MockResult( + ctx.newRecord(ACTOR) + .with(ACTOR.ACTOR_ID, 1L) + .with(ACTOR.FIRST_NAME, "A") + .with(ACTOR.LAST_NAME, "A")) else MockResult(0) ) diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml b/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml index cf6ec0d..bc93619 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml +++ b/jOOQ-demo-pro/jOOQ-demo-scala/pom.xml @@ -6,7 +6,7 @@ org.jooq.trial jooq-demo - 3.18.7 + 3.19.1 jooq-demo-scala @@ -134,6 +134,11 @@ 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/DefaultCatalog.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/DefaultCatalog.scala index b9846a2..1406f18 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/DefaultCatalog.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/DefaultCatalog.scala @@ -35,10 +35,10 @@ class DefaultCatalog extends CatalogImpl("") { ) /** - * A reference to the 3.18 minor release of the code generator. If this + * A reference to the 3.19 minor release of the code generator. If this * doesn't compile, it's because the runtime library uses an older minor - * release, namely: 3.18. You can turn off the generation of this reference by + * release, namely: 3.19. You can turn off the generation of this reference by * specifying /configuration/generator/generate/jooqVersionReference */ - private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_18 + private val REQUIRE_RUNTIME_JOOQ_VERSION = Constants.VERSION_3_19 } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Public.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Public.scala index 74c32d6..9824164 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Public.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Public.scala @@ -16,6 +16,7 @@ import org.jooq.Domain import org.jooq.Field import org.jooq.Result import org.jooq.Table +import org.jooq.Trigger import org.jooq.demo.skala.db.tables.Actor import org.jooq.demo.skala.db.tables.ActorInfo import org.jooq.demo.skala.db.tables.Address @@ -329,6 +330,11 @@ class Public extends SchemaImpl("public", DefaultCatalog.DEFAULT_CATALOG) { Domains.YEAR ) + override def getTriggers: List[Trigger] = Arrays.asList[Trigger]( + Triggers.FILM_FULLTEXT_TRIGGER, + Triggers.LAST_UPDATED + ) + override def getTables: List[Table[_]] = Arrays.asList[Table[_]]( Actor.ACTOR, ActorInfo.ACTOR_INFO, diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Triggers.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Triggers.scala new file mode 100644 index 0000000..5e01906 --- /dev/null +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/Triggers.scala @@ -0,0 +1,34 @@ +/* + * This file is generated by jOOQ. + */ +package org.jooq.demo.skala.db + + +import java.util.Arrays +import java.util.EnumSet + +import org.jooq.Trigger +import org.jooq.TriggerEvent +import org.jooq.TriggerExecution +import org.jooq.TriggerTime +import org.jooq.demo.skala.db.tables.Actor +import org.jooq.demo.skala.db.tables.Film +import org.jooq.impl.DSL +import org.jooq.impl.Internal + + +/** + * Convenience access to all triggers in public. + */ +object Triggers { + + /** + * The trigger public.film_fulltext_trigger + */ + val FILM_FULLTEXT_TRIGGER: Trigger = Internal.createTrigger(Public.PUBLIC, Film.FILM, Arrays.asList(), DSL.name("film_fulltext_trigger"), DSL.comment(""), TriggerTime.BEFORE, EnumSet.of(TriggerEvent.INSERT, TriggerEvent.UPDATE), TriggerExecution.FOR_EACH_ROW, null, 1, DSL.statement("EXECUTE FUNCTION tsvector_update_trigger('fulltext', 'pg_catalog.english', 'title', 'description')")) + + /** + * The trigger public.last_updated + */ + val LAST_UPDATED: Trigger = Internal.createTrigger(Public.PUBLIC, Actor.ACTOR, Arrays.asList(), DSL.name("last_updated"), DSL.comment(""), TriggerTime.BEFORE, EnumSet.of(TriggerEvent.UPDATE), TriggerExecution.FOR_EACH_ROW, null, 1, DSL.statement("EXECUTE FUNCTION last_updated()")) +} diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java index 9971db4..caa19d1 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/enums/MpaaRating.java @@ -12,7 +12,7 @@ /** * This class is generated by jOOQ. */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" }) public enum MpaaRating implements EnumType { G("G"), @@ -52,7 +52,9 @@ public String getLiteral() { } /** - * Lookup a value of this EnumType by its literal + * Lookup a value of this EnumType by its literal. Returns + * null, if no such value could be found, see {@link + * EnumType#lookupLiteral(Class, String)}. */ public static MpaaRating lookupLiteral(String literal) { return EnumType.lookupLiteral(MpaaRating.class, literal); 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 0f1815b..2eb1e83 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 @@ -4,30 +4,38 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions +import org.jooq.Trigger 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.Triggers import org.jooq.demo.skala.db.tables.records.ActorRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +51,11 @@ object Actor { * The reference instance of public.actor */ val ACTOR = new Actor + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class ActorPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, ActorRecord], parentPath: InverseForeignKey[_ <: Record, ActorRecord]) extends Actor(path, childPath, parentPath) with Path[ActorRecord] } /** @@ -50,20 +63,24 @@ object Actor { */ class Actor( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, ActorRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, ActorRecord], + parentPath: InverseForeignKey[_ <: Record, ActorRecord], aliased: Table[ActorRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[ActorRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +108,8 @@ extends TableImpl[ActorRecord]( */ val LAST_UPDATE: TableField[ActorRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[ActorRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[ActorRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[ActorRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.actor table reference @@ -108,15 +126,16 @@ extends TableImpl[ActorRecord]( */ def this() = this(DSL.name("actor"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, ActorRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Actor.ACTOR, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, ActorRecord], parentPath: InverseForeignKey[_ <: Record, ActorRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Actor.ACTOR, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_ACTOR_LAST_NAME) override def getIdentity: Identity[ActorRecord, Long] = super.getIdentity.asInstanceOf[ Identity[ActorRecord, Long] ] override def getPrimaryKey: UniqueKey[ActorRecord] = Keys.ACTOR_PKEY + 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) override def as(alias: Table[_]): Actor = new Actor(alias.getQualifiedName(), this) @@ -136,19 +155,48 @@ extends TableImpl[ActorRecord]( */ override def rename(name: Table[_]): Actor = new Actor(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Actor = new Actor(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Actor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Actor = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Actor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Actor = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): Actor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): Actor = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala index dfc70cf..92c1d3e 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/ActorInfo.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.ActorInfoRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object ActorInfo { */ class ActorInfo( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, ActorInfoRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, ActorInfoRecord], + parentPath: InverseForeignKey[_ <: Record, ActorInfoRecord], aliased: Table[ActorInfoRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[ActorInfoRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -70,7 +77,8 @@ extends TableImpl[ActorInfoRecord]( LEFT JOIN film_category fc ON ((fa.film_id = fc.film_id))) LEFT JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY a.actor_id, a.first_name, a.last_name; - """) + """), + where ) { /** @@ -98,7 +106,8 @@ extends TableImpl[ActorInfoRecord]( */ val FILM_INFO: TableField[ActorInfoRecord, String] = createField(DSL.name("film_info"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[ActorInfoRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[ActorInfoRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[ActorInfoRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.actor_info table reference @@ -115,9 +124,7 @@ extends TableImpl[ActorInfoRecord]( */ def this() = this(DSL.name("actor_info"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, ActorInfoRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.ActorInfo.ACTOR_INFO, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): ActorInfo = new ActorInfo(DSL.name(alias), this) override def as(alias: Name): ActorInfo = new ActorInfo(alias, this) override def as(alias: Table[_]): ActorInfo = new ActorInfo(alias.getQualifiedName(), this) @@ -137,19 +144,48 @@ extends TableImpl[ActorInfoRecord]( */ override def rename(name: Table[_]): ActorInfo = new ActorInfo(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, String, String, String] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): ActorInfo = new ActorInfo(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): ActorInfo = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): ActorInfo = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): ActorInfo = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): ActorInfo = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): ActorInfo = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): ActorInfo = where(DSL.notExists(select)) } 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 8219d3a..d0dabb0 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.City.CityPath import org.jooq.demo.skala.db.tables.records.AddressRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +50,11 @@ object Address { * The reference instance of public.address */ val ADDRESS = new Address + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class AddressPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, AddressRecord], parentPath: InverseForeignKey[_ <: Record, AddressRecord]) extends Address(path, childPath, parentPath) with Path[AddressRecord] } /** @@ -50,20 +62,24 @@ object Address { */ class Address( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, AddressRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, AddressRecord], + parentPath: InverseForeignKey[_ <: Record, AddressRecord], aliased: Table[AddressRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[AddressRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -111,7 +127,8 @@ extends TableImpl[AddressRecord]( */ val LAST_UPDATE: TableField[AddressRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[AddressRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[AddressRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[AddressRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.address table reference @@ -128,9 +145,9 @@ extends TableImpl[AddressRecord]( */ def this() = this(DSL.name("address"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, AddressRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Address.ADDRESS, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, AddressRecord], parentPath: InverseForeignKey[_ <: Record, AddressRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Address.ADDRESS, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_CITY_ID) @@ -143,7 +160,7 @@ extends TableImpl[AddressRecord]( /** * Get the implicit join path to the public.city table. */ - lazy val city: City = { new City(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY) } + lazy val city: CityPath = { new CityPath(this, Keys.ADDRESS__ADDRESS_CITY_ID_FKEY, null) } 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) @@ -163,19 +180,48 @@ extends TableImpl[AddressRecord]( */ override def rename(name: Table[_]): Address = new Address(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, Long, String, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Address = new Address(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Address = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Address = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Address = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Address = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): Address = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, Long, String, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): Address = where(DSL.notExists(select)) } 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 6879988..b892505 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 @@ -4,20 +4,26 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -39,6 +45,11 @@ object Category { * The reference instance of public.category */ val CATEGORY = new Category + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CategoryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CategoryRecord], parentPath: InverseForeignKey[_ <: Record, CategoryRecord]) extends Category(path, childPath, parentPath) with Path[CategoryRecord] } /** @@ -46,20 +57,24 @@ object Category { */ class Category( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CategoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CategoryRecord], + parentPath: InverseForeignKey[_ <: Record, CategoryRecord], aliased: Table[CategoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CategoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -82,7 +97,8 @@ extends TableImpl[CategoryRecord]( */ val LAST_UPDATE: TableField[CategoryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[CategoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CategoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CategoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.category table reference @@ -99,9 +115,9 @@ extends TableImpl[CategoryRecord]( */ def this() = this(DSL.name("category"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CategoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Category.CATEGORY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CategoryRecord], parentPath: InverseForeignKey[_ <: Record, CategoryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Category.CATEGORY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[CategoryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CategoryRecord, Long] ] @@ -125,19 +141,48 @@ extends TableImpl[CategoryRecord]( */ override def rename(name: Table[_]): Category = new Category(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Category = new Category(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Category = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Category = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Category = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Category = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): Category = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): Category = where(DSL.notExists(select)) } 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 798d3ef..0f0db2e 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.Country.CountryPath import org.jooq.demo.skala.db.tables.records.CityRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +50,11 @@ object City { * The reference instance of public.city */ val CITY = new City + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CityPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CityRecord], parentPath: InverseForeignKey[_ <: Record, CityRecord]) extends City(path, childPath, parentPath) with Path[CityRecord] } /** @@ -50,20 +62,24 @@ object City { */ class City( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CityRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CityRecord], + parentPath: InverseForeignKey[_ <: Record, CityRecord], aliased: Table[CityRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CityRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +107,8 @@ extends TableImpl[CityRecord]( */ val LAST_UPDATE: TableField[CityRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[CityRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CityRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CityRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.city table reference @@ -108,9 +125,9 @@ extends TableImpl[CityRecord]( */ def this() = this(DSL.name("city"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CityRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.City.CITY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CityRecord], parentPath: InverseForeignKey[_ <: Record, CityRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.City.CITY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_COUNTRY_ID) @@ -123,7 +140,7 @@ extends TableImpl[CityRecord]( /** * Get the implicit join path to the public.country table. */ - lazy val country: Country = { new Country(this, Keys.CITY__CITY_COUNTRY_ID_FKEY) } + lazy val country: CountryPath = { new CountryPath(this, Keys.CITY__CITY_COUNTRY_ID_FKEY, null) } 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) @@ -143,19 +160,48 @@ extends TableImpl[CityRecord]( */ override def rename(name: Table[_]): City = new City(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, String, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): City = new City(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): City = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): City = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): City = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): City = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): City = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): City = where(DSL.notExists(select)) } 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 5f81cc2..7327ab6 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 @@ -4,20 +4,26 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -39,6 +45,11 @@ object Country { * The reference instance of public.country */ val COUNTRY = new Country + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CountryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CountryRecord], parentPath: InverseForeignKey[_ <: Record, CountryRecord]) extends Country(path, childPath, parentPath) with Path[CountryRecord] } /** @@ -46,20 +57,24 @@ object Country { */ class Country( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CountryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CountryRecord], + parentPath: InverseForeignKey[_ <: Record, CountryRecord], aliased: Table[CountryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CountryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -82,7 +97,8 @@ extends TableImpl[CountryRecord]( */ val LAST_UPDATE: TableField[CountryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[CountryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CountryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CountryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.country table reference @@ -99,9 +115,9 @@ extends TableImpl[CountryRecord]( */ def this() = this(DSL.name("country"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CountryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Country.COUNTRY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CountryRecord], parentPath: InverseForeignKey[_ <: Record, CountryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Country.COUNTRY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[CountryRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CountryRecord, Long] ] @@ -125,19 +141,48 @@ extends TableImpl[CountryRecord]( */ override def rename(name: Table[_]): Country = new Country(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Country = new Country(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Country = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Country = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Country = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Country = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): Country = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): Country = where(DSL.notExists(select)) } 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 4c3f5b7..d943f19 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 @@ -12,18 +12,23 @@ import java.lang.String import java.time.LocalDate import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row10 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -31,6 +36,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.Address.AddressPath +import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.CustomerRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -46,6 +53,11 @@ object Customer { * The reference instance of public.customer */ val CUSTOMER = new Customer + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class CustomerPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CustomerRecord], parentPath: InverseForeignKey[_ <: Record, CustomerRecord]) extends Customer(path, childPath, parentPath) with Path[CustomerRecord] } /** @@ -53,20 +65,24 @@ object Customer { */ class Customer( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CustomerRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CustomerRecord], + parentPath: InverseForeignKey[_ <: Record, CustomerRecord], aliased: Table[CustomerRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CustomerRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -124,7 +140,8 @@ extends TableImpl[CustomerRecord]( */ val ACTIVE: TableField[CustomerRecord, Integer] = createField(DSL.name("active"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CustomerRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.customer table reference @@ -141,9 +158,9 @@ extends TableImpl[CustomerRecord]( */ def this() = this(DSL.name("customer"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CustomerRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Customer.CUSTOMER, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, CustomerRecord], parentPath: InverseForeignKey[_ <: Record, CustomerRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Customer.CUSTOMER, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_ADDRESS_ID, Indexes.IDX_FK_STORE_ID, Indexes.IDX_LAST_NAME) @@ -156,12 +173,12 @@ extends TableImpl[CustomerRecord]( /** * Get the implicit join path to the public.store table. */ - lazy val store: Store = { new Store(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY) } + lazy val store: StorePath = { new StorePath(this, Keys.CUSTOMER__CUSTOMER_STORE_ID_FKEY, null) } /** * Get the implicit join path to the public.address table. */ - lazy val address: Address = { new Address(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY) } + lazy val address: AddressPath = { new AddressPath(this, Keys.CUSTOMER__CUSTOMER_ADDRESS_ID_FKEY, null) } 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) @@ -181,19 +198,48 @@ extends TableImpl[CustomerRecord]( */ override def rename(name: Table[_]): Customer = new Customer(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.fieldsRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Customer = new Customer(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Customer = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Customer = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Customer = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Customer = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) + override def whereExists(select: Select[_]): Customer = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) + override def whereNotExists(select: Select[_]): Customer = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala index 63bd227..70e91b7 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/CustomerList.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row9 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.CustomerListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object CustomerList { */ class CustomerList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CustomerListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CustomerListRecord], + parentPath: InverseForeignKey[_ <: Record, CustomerListRecord], aliased: Table[CustomerListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CustomerListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -72,7 +79,8 @@ extends TableImpl[CustomerListRecord]( JOIN address a ON ((cu.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where ) { /** @@ -125,7 +133,8 @@ extends TableImpl[CustomerListRecord]( */ val SID: TableField[CustomerListRecord, Long] = createField(DSL.name("sid"), SQLDataType.BIGINT, "") - private def this(alias: Name, aliased: Table[CustomerListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[CustomerListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[CustomerListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.customer_list table reference @@ -142,9 +151,7 @@ extends TableImpl[CustomerListRecord]( */ def this() = this(DSL.name("customer_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, CustomerListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.CustomerList.CUSTOMER_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): CustomerList = new CustomerList(DSL.name(alias), this) override def as(alias: Name): CustomerList = new CustomerList(alias, this) override def as(alias: Table[_]): CustomerList = new CustomerList(alias.getQualifiedName(), this) @@ -164,19 +171,48 @@ extends TableImpl[CustomerListRecord]( */ override def rename(name: Table[_]): CustomerList = new CustomerList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row9 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row9[Long, String, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row9[Long, String, String, String, String, String, String, String, Long] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): CustomerList = new CustomerList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): CustomerList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): CustomerList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): CustomerList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): CustomerList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9())) + override def whereExists(select: Select[_]): CustomerList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9())) + override def whereNotExists(select: Select[_]): CustomerList = where(DSL.notExists(select)) } 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 afafd60..9fedf24 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 @@ -4,6 +4,7 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Deprecated import java.lang.Integer @@ -14,28 +15,38 @@ import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row14 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions +import org.jooq.Trigger import org.jooq.UniqueKey +import org.jooq.demo.skala.db.Domains 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.enums.MpaaRating +import org.jooq.demo.skala.db.tables.Language.LanguagePath import org.jooq.demo.skala.db.tables.records.FilmRecord import org.jooq.impl.DSL +import org.jooq.impl.DefaultDataType import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -49,6 +60,11 @@ object Film { * The reference instance of public.film */ val FILM = new Film + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class FilmPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmRecord], parentPath: InverseForeignKey[_ <: Record, FilmRecord]) extends Film(path, childPath, parentPath) with Path[FilmRecord] } /** @@ -56,20 +72,24 @@ object Film { */ class Film( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmRecord], + parentPath: InverseForeignKey[_ <: Record, FilmRecord], aliased: Table[FilmRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -95,7 +115,7 @@ extends TableImpl[FilmRecord]( /** * The column public.film.release_year. */ - val RELEASE_YEAR: TableField[FilmRecord, Integer] = createField(DSL.name("release_year"), org.jooq.demo.skala.db.Domains.YEAR.getDataType(), "") + val RELEASE_YEAR: TableField[FilmRecord, Integer] = createField(DSL.name("release_year"), Domains.YEAR.getDataType(), "") /** * The column public.film.language_id. @@ -130,7 +150,7 @@ extends TableImpl[FilmRecord]( /** * The column public.film.rating. */ - val RATING: TableField[FilmRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(classOf[org.jooq.demo.skala.db.enums.MpaaRating]), "") + val RATING: TableField[FilmRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.defaultValue(DSL.field(DSL.raw("'G'::mpaa_rating"), SQLDataType.VARCHAR)).asEnumDataType(classOf[MpaaRating]), "") /** * The column public.film.last_update. @@ -150,9 +170,10 @@ extends TableImpl[FilmRecord]( * } in your code generator configuration. */ @Deprecated - val FULLTEXT: TableField[FilmRecord, Object] = createField(DSL.name("fulltext"), org.jooq.impl.DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), "") + val FULLTEXT: TableField[FilmRecord, Object] = createField(DSL.name("fulltext"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"tsvector\"").nullable(false), "") - private def this(alias: Name, aliased: Table[FilmRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film table reference @@ -169,9 +190,9 @@ extends TableImpl[FilmRecord]( */ def this() = this(DSL.name("film"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Film.FILM, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, FilmRecord], parentPath: InverseForeignKey[_ <: Record, FilmRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Film.FILM, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.FILM_FULLTEXT_IDX, Indexes.IDX_FK_LANGUAGE_ID, Indexes.IDX_FK_ORIGINAL_LANGUAGE_ID, Indexes.IDX_TITLE) @@ -185,13 +206,14 @@ extends TableImpl[FilmRecord]( * Get the implicit join path to the public.language table, via * the film_language_id_fkey key. */ - lazy val filmLanguageIdFkey: Language = { new Language(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY) } + lazy val filmLanguageIdFkey: LanguagePath = { new LanguagePath(this, Keys.FILM__FILM_LANGUAGE_ID_FKEY, null) } /** * Get the implicit join path to the public.language table, via * the film_original_language_id_fkey key. */ - lazy val filmOriginalLanguageIdFkey: Language = { new Language(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY) } + lazy val filmOriginalLanguageIdFkey: LanguagePath = { new LanguagePath(this, Keys.FILM__FILM_ORIGINAL_LANGUAGE_ID_FKEY, null) } + 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) override def as(alias: Table[_]): Film = new Film(alias.getQualifiedName(), this) @@ -211,19 +233,48 @@ extends TableImpl[FilmRecord]( */ override def rename(name: Table[_]): Film = new Film(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row14 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] = super.fieldsRow.asInstanceOf[ Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Film = new Film(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Film = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Film = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Film = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Film = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11(), r.value12(), r.value13(), r.value14())) + override def whereExists(select: Select[_]): Film = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11(), r.value12(), r.value13(), r.value14())) + override def whereNotExists(select: Select[_]): Film = where(DSL.notExists(select)) } 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 9590583..e5154ab 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 @@ -4,22 +4,27 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -27,9 +32,10 @@ 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.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 @@ -49,20 +55,24 @@ object FilmActor { */ class FilmActor( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmActorRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmActorRecord], + parentPath: InverseForeignKey[_ <: Record, FilmActorRecord], aliased: Table[FilmActorRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmActorRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -85,7 +95,8 @@ extends TableImpl[FilmActorRecord]( */ val LAST_UPDATE: TableField[FilmActorRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[FilmActorRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmActorRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmActorRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_actor table reference @@ -102,9 +113,7 @@ extends TableImpl[FilmActorRecord]( */ def this() = this(DSL.name("film_actor"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmActorRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.FilmActor.FILM_ACTOR, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_FILM_ID) @@ -115,12 +124,12 @@ extends TableImpl[FilmActorRecord]( /** * Get the implicit join path to the public.actor table. */ - lazy val actor: Actor = { new Actor(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY) } + lazy val actor: ActorPath = { new ActorPath(this, Keys.FILM_ACTOR__FILM_ACTOR_ACTOR_ID_FKEY, null) } /** * Get the implicit join path to the public.film table. */ - lazy val film: Film = { new Film(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY) } + lazy val film: FilmPath = { new FilmPath(this, Keys.FILM_ACTOR__FILM_ACTOR_FILM_ID_FKEY, null) } override def as(alias: String): FilmActor = new FilmActor(DSL.name(alias), this) override def as(alias: Name): FilmActor = new FilmActor(alias, this) override def as(alias: Table[_]): FilmActor = new FilmActor(alias.getQualifiedName(), this) @@ -140,19 +149,48 @@ extends TableImpl[FilmActorRecord]( */ override def rename(name: Table[_]): FilmActor = new FilmActor(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): FilmActor = new FilmActor(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): FilmActor = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): FilmActor = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): FilmActor = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): FilmActor = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): FilmActor = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): FilmActor = where(DSL.notExists(select)) } 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 0798ef7..9e2cbf4 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 @@ -4,30 +4,36 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField 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.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 @@ -47,20 +53,24 @@ object FilmCategory { */ class FilmCategory( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmCategoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmCategoryRecord], + parentPath: InverseForeignKey[_ <: Record, FilmCategoryRecord], aliased: Table[FilmCategoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmCategoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -83,7 +93,8 @@ extends TableImpl[FilmCategoryRecord]( */ val LAST_UPDATE: TableField[FilmCategoryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[FilmCategoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmCategoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmCategoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_category table reference @@ -100,9 +111,7 @@ extends TableImpl[FilmCategoryRecord]( */ def this() = this(DSL.name("film_category"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmCategoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.FilmCategory.FILM_CATEGORY, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getPrimaryKey: UniqueKey[FilmCategoryRecord] = Keys.FILM_CATEGORY_PKEY @@ -111,12 +120,12 @@ extends TableImpl[FilmCategoryRecord]( /** * Get the implicit join path to the public.film table. */ - lazy val film: Film = { new Film(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY) } + lazy val film: FilmPath = { new FilmPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_FILM_ID_FKEY, null) } /** * Get the implicit join path to the public.category table. */ - lazy val category: Category = { new Category(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY) } + lazy val category: CategoryPath = { new CategoryPath(this, Keys.FILM_CATEGORY__FILM_CATEGORY_CATEGORY_ID_FKEY, null) } override def as(alias: String): FilmCategory = new FilmCategory(DSL.name(alias), this) override def as(alias: Name): FilmCategory = new FilmCategory(alias, this) override def as(alias: Table[_]): FilmCategory = new FilmCategory(alias.getQualifiedName(), this) @@ -136,19 +145,48 @@ extends TableImpl[FilmCategoryRecord]( */ override def rename(name: Table[_]): FilmCategory = new FilmCategory(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): FilmCategory = new FilmCategory(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): FilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): FilmCategory = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): FilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): FilmCategory = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): FilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): FilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala index 247a902..3b0d7e8 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmInStock.scala @@ -8,15 +8,14 @@ import java.lang.Class import java.lang.Integer import java.lang.Long import java.lang.String -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -42,20 +41,24 @@ object FilmInStock { */ class FilmInStock( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmInStockRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmInStockRecord], + parentPath: InverseForeignKey[_ <: Record, FilmInStockRecord], aliased: Table[FilmInStockRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmInStockRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function + TableOptions.function, + where ) { /** @@ -68,10 +71,10 @@ extends TableImpl[FilmInStockRecord]( */ val P_FILM_COUNT: TableField[FilmInStockRecord, Integer] = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[FilmInStockRecord]) = this(alias, null, null, aliased, Array( + private def this(alias: Name, aliased: Table[FilmInStockRecord]) = this(alias, null, null, null, aliased, Array( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) + ), null) /** * Create an aliased public.film_in_stock table reference @@ -88,30 +91,25 @@ extends TableImpl[FilmInStockRecord]( */ def this() = this(DSL.name("film_in_stock"), null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC - override def as(alias: String): FilmInStock = new FilmInStock(DSL.name(alias), null, null, this, parameters) - override def as(alias: Name): FilmInStock = new FilmInStock(alias, null, null, this, parameters) - override def as(alias: Table[_]): FilmInStock = new FilmInStock(alias.getQualifiedName(), null, null, this, parameters) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC + override def as(alias: String): FilmInStock = new FilmInStock(DSL.name(alias), null, null, null, this, parameters, null) + override def as(alias: Name): FilmInStock = new FilmInStock(alias, null, null, null, this, parameters, null) + override def as(alias: Table[_]): FilmInStock = new FilmInStock(alias.getQualifiedName(), null, null, null, this, parameters, null) /** * Rename this table */ - override def rename(name: String): FilmInStock = new FilmInStock(DSL.name(name), null, null, null, parameters) + override def rename(name: String): FilmInStock = new FilmInStock(DSL.name(name), null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Name): FilmInStock = new FilmInStock(name, null, null, null, parameters) + override def rename(name: Name): FilmInStock = new FilmInStock(name, null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Table[_]): FilmInStock = new FilmInStock(name.getQualifiedName(), null, null, null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] + override def rename(name: Table[_]): FilmInStock = new FilmInStock(name.getQualifiedName(), null, null, null, null, parameters, null) /** * Call this table-valued function @@ -119,10 +117,10 @@ extends TableImpl[FilmInStockRecord]( def call( pFilmId: Long , pStoreId: Long - ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, Array( + ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, null, Array( DSL.value(pFilmId, SQLDataType.BIGINT), DSL.value(pStoreId, SQLDataType.BIGINT) - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get /** * Call this table-valued function @@ -130,19 +128,8 @@ extends TableImpl[FilmInStockRecord]( def call( pFilmId: Field[Long] , pStoreId: Field[Long] - ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, Array( + ): FilmInStock = Option(new FilmInStock(DSL.name("film_in_stock"), null, null, null, null, Array( pFilmId, pStoreId - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - def mapping[U](from: (Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1())) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - def mapping[U](toType: Class[U], from: (Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1())) + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala index 6f5b696..829efe0 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmList.scala @@ -4,20 +4,25 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.Short import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -25,7 +30,6 @@ import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.records.FilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -45,16 +49,19 @@ object FilmList { */ class FilmList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmListRecord], + parentPath: InverseForeignKey[_ <: Record, FilmListRecord], aliased: Table[FilmListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -73,7 +80,8 @@ extends TableImpl[FilmListRecord]( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where ) { /** @@ -114,14 +122,15 @@ extends TableImpl[FilmListRecord]( /** * The column public.film_list.rating. */ - val RATING: TableField[FilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[org.jooq.demo.skala.db.enums.MpaaRating]), "") + val RATING: TableField[FilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[MpaaRating]), "") /** * The column public.film_list.actors. */ val ACTORS: TableField[FilmListRecord, String] = createField(DSL.name("actors"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[FilmListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[FilmListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[FilmListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.film_list table reference @@ -138,9 +147,7 @@ extends TableImpl[FilmListRecord]( */ def this() = this(DSL.name("film_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, FilmListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.FilmList.FILM_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): FilmList = new FilmList(DSL.name(alias), this) override def as(alias: Name): FilmList = new FilmList(alias, this) override def as(alias: Table[_]): FilmList = new FilmList(alias.getQualifiedName(), this) @@ -160,19 +167,48 @@ extends TableImpl[FilmListRecord]( */ override def rename(name: Table[_]): FilmList = new FilmList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): FilmList = new FilmList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): FilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): FilmList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): FilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): FilmList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): FilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): FilmList = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala index 08351a2..6f79c16 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/FilmNotInStock.scala @@ -8,15 +8,14 @@ import java.lang.Class import java.lang.Integer import java.lang.Long import java.lang.String -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Row1 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -42,20 +41,24 @@ object FilmNotInStock { */ class FilmNotInStock( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, FilmNotInStockRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, FilmNotInStockRecord], + parentPath: InverseForeignKey[_ <: Record, FilmNotInStockRecord], aliased: Table[FilmNotInStockRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[FilmNotInStockRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function + TableOptions.function, + where ) { /** @@ -68,10 +71,10 @@ extends TableImpl[FilmNotInStockRecord]( */ val P_FILM_COUNT: TableField[FilmNotInStockRecord, Integer] = createField(DSL.name("p_film_count"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[FilmNotInStockRecord]) = this(alias, null, null, aliased, Array( + private def this(alias: Name, aliased: Table[FilmNotInStockRecord]) = this(alias, null, null, null, aliased, Array( DSL.value(null, SQLDataType.BIGINT), DSL.value(null, SQLDataType.BIGINT) - )) + ), null) /** * Create an aliased public.film_not_in_stock table reference @@ -88,30 +91,25 @@ extends TableImpl[FilmNotInStockRecord]( */ def this() = this(DSL.name("film_not_in_stock"), null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC - override def as(alias: String): FilmNotInStock = new FilmNotInStock(DSL.name(alias), null, null, this, parameters) - override def as(alias: Name): FilmNotInStock = new FilmNotInStock(alias, null, null, this, parameters) - override def as(alias: Table[_]): FilmNotInStock = new FilmNotInStock(alias.getQualifiedName(), null, null, this, parameters) + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC + override def as(alias: String): FilmNotInStock = new FilmNotInStock(DSL.name(alias), null, null, null, this, parameters, null) + override def as(alias: Name): FilmNotInStock = new FilmNotInStock(alias, null, null, null, this, parameters, null) + override def as(alias: Table[_]): FilmNotInStock = new FilmNotInStock(alias.getQualifiedName(), null, null, null, this, parameters, null) /** * Rename this table */ - override def rename(name: String): FilmNotInStock = new FilmNotInStock(DSL.name(name), null, null, null, parameters) + override def rename(name: String): FilmNotInStock = new FilmNotInStock(DSL.name(name), null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Name): FilmNotInStock = new FilmNotInStock(name, null, null, null, parameters) + override def rename(name: Name): FilmNotInStock = new FilmNotInStock(name, null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Table[_]): FilmNotInStock = new FilmNotInStock(name.getQualifiedName(), null, null, null, parameters) - - // ------------------------------------------------------------------------- - // Row1 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] + override def rename(name: Table[_]): FilmNotInStock = new FilmNotInStock(name.getQualifiedName(), null, null, null, null, parameters, null) /** * Call this table-valued function @@ -119,10 +117,10 @@ extends TableImpl[FilmNotInStockRecord]( def call( pFilmId: Long , pStoreId: Long - ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, Array( + ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, null, Array( DSL.value(pFilmId, SQLDataType.BIGINT), DSL.value(pStoreId, SQLDataType.BIGINT) - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get /** * Call this table-valued function @@ -130,19 +128,8 @@ extends TableImpl[FilmNotInStockRecord]( def call( pFilmId: Field[Long] , pStoreId: Field[Long] - ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, Array( + ): FilmNotInStock = Option(new FilmNotInStock(DSL.name("film_not_in_stock"), null, null, null, null, Array( pFilmId, pStoreId - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - def mapping[U](from: (Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1())) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - def mapping[U](toType: Class[U], from: (Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1())) + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get } 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 bd24356..e59652f 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row4 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.Store.StorePath import org.jooq.demo.skala.db.tables.records.InventoryRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +51,11 @@ object Inventory { * The reference instance of public.inventory */ val INVENTORY = new Inventory + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class InventoryPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, InventoryRecord], parentPath: InverseForeignKey[_ <: Record, InventoryRecord]) extends Inventory(path, childPath, parentPath) with Path[InventoryRecord] } /** @@ -50,20 +63,24 @@ object Inventory { */ class Inventory( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, InventoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, InventoryRecord], + parentPath: InverseForeignKey[_ <: Record, InventoryRecord], aliased: Table[InventoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[InventoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -91,7 +108,8 @@ extends TableImpl[InventoryRecord]( */ val LAST_UPDATE: TableField[InventoryRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[InventoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[InventoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[InventoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.inventory table reference @@ -108,9 +126,9 @@ extends TableImpl[InventoryRecord]( */ def this() = this(DSL.name("inventory"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, InventoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Inventory.INVENTORY, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, InventoryRecord], parentPath: InverseForeignKey[_ <: Record, InventoryRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Inventory.INVENTORY, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_STORE_ID_FILM_ID) @@ -123,12 +141,12 @@ extends TableImpl[InventoryRecord]( /** * Get the implicit join path to the public.film table. */ - lazy val film: Film = { new Film(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY) } + lazy val film: FilmPath = { new FilmPath(this, Keys.INVENTORY__INVENTORY_FILM_ID_FKEY, null) } /** * Get the implicit join path to the public.store table. */ - lazy val store: Store = { new Store(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY) } + lazy val store: StorePath = { new StorePath(this, Keys.INVENTORY__INVENTORY_STORE_ID_FKEY, null) } 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) @@ -148,19 +166,48 @@ extends TableImpl[InventoryRecord]( */ override def rename(name: Table[_]): Inventory = new Inventory(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row4 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row4[Long, Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Inventory = new Inventory(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Inventory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Inventory = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Inventory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Inventory = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereExists(select: Select[_]): Inventory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4())) + override def whereNotExists(select: Select[_]): Inventory = where(DSL.notExists(select)) } 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 e13777d..ea1ac65 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 @@ -4,20 +4,26 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -39,6 +45,11 @@ object Language { * The reference instance of public.language */ val LANGUAGE = new Language + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class LanguagePath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, LanguageRecord], parentPath: InverseForeignKey[_ <: Record, LanguageRecord]) extends Language(path, childPath, parentPath) with Path[LanguageRecord] } /** @@ -46,20 +57,24 @@ object Language { */ class Language( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, LanguageRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, LanguageRecord], + parentPath: InverseForeignKey[_ <: Record, LanguageRecord], aliased: Table[LanguageRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[LanguageRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -82,7 +97,8 @@ extends TableImpl[LanguageRecord]( */ val LAST_UPDATE: TableField[LanguageRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[LanguageRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[LanguageRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[LanguageRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.language table reference @@ -99,9 +115,9 @@ extends TableImpl[LanguageRecord]( */ def this() = this(DSL.name("language"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, LanguageRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Language.LANGUAGE, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, LanguageRecord], parentPath: InverseForeignKey[_ <: Record, LanguageRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Language.LANGUAGE, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[LanguageRecord, Long] = super.getIdentity.asInstanceOf[ Identity[LanguageRecord, Long] ] @@ -125,19 +141,48 @@ extends TableImpl[LanguageRecord]( */ override def rename(name: Table[_]): Language = new Language(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Language = new Language(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Language = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Language = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Language = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Language = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): Language = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): Language = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala index 50c5929..aac13ce 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/NicerButSlowerFilmList.scala @@ -4,20 +4,25 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.Short import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -25,7 +30,6 @@ import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.records.NicerButSlowerFilmListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -45,16 +49,19 @@ object NicerButSlowerFilmList { */ class NicerButSlowerFilmList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, NicerButSlowerFilmListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, NicerButSlowerFilmListRecord], + parentPath: InverseForeignKey[_ <: Record, NicerButSlowerFilmListRecord], aliased: Table[NicerButSlowerFilmListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[NicerButSlowerFilmListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -73,7 +80,8 @@ extends TableImpl[NicerButSlowerFilmListRecord]( JOIN film_actor ON ((film.film_id = film_actor.film_id))) JOIN actor ON ((film_actor.actor_id = actor.actor_id))) GROUP BY film.film_id, film.title, film.description, category.name, film.rental_rate, film.length, film.rating; - """) + """), + where ) { /** @@ -114,14 +122,15 @@ extends TableImpl[NicerButSlowerFilmListRecord]( /** * The column public.nicer_but_slower_film_list.rating. */ - val RATING: TableField[NicerButSlowerFilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[org.jooq.demo.skala.db.enums.MpaaRating]), "") + val RATING: TableField[NicerButSlowerFilmListRecord, MpaaRating] = createField(DSL.name("rating"), SQLDataType.VARCHAR.asEnumDataType(classOf[MpaaRating]), "") /** * The column public.nicer_but_slower_film_list.actors. */ val ACTORS: TableField[NicerButSlowerFilmListRecord, String] = createField(DSL.name("actors"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[NicerButSlowerFilmListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[NicerButSlowerFilmListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[NicerButSlowerFilmListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.nicer_but_slower_film_list table @@ -140,9 +149,7 @@ extends TableImpl[NicerButSlowerFilmListRecord]( */ def this() = this(DSL.name("nicer_but_slower_film_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, NicerButSlowerFilmListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): NicerButSlowerFilmList = new NicerButSlowerFilmList(DSL.name(alias), this) override def as(alias: Name): NicerButSlowerFilmList = new NicerButSlowerFilmList(alias, this) override def as(alias: Table[_]): NicerButSlowerFilmList = new NicerButSlowerFilmList(alias.getQualifiedName(), this) @@ -162,19 +169,48 @@ extends TableImpl[NicerButSlowerFilmListRecord]( */ override def rename(name: Table[_]): NicerButSlowerFilmList = new NicerButSlowerFilmList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): NicerButSlowerFilmList = new NicerButSlowerFilmList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): NicerButSlowerFilmList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): NicerButSlowerFilmList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): NicerButSlowerFilmList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): NicerButSlowerFilmList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): NicerButSlowerFilmList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, BigDecimal, Short, MpaaRating, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): NicerButSlowerFilmList = where(DSL.notExists(select)) } 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 9eecff7..1db126e 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 @@ -4,24 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -29,9 +34,11 @@ 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.Customer.CustomerPath +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,20 +58,24 @@ object Payment { */ class Payment( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentRecord], + parentPath: InverseForeignKey[_ <: Record, PaymentRecord], aliased: Table[PaymentRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +113,8 @@ extends TableImpl[PaymentRecord]( */ val PAYMENT_DATE: TableField[PaymentRecord, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment table reference @@ -119,9 +131,7 @@ extends TableImpl[PaymentRecord]( */ def this() = this(DSL.name("payment"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Payment.PAYMENT, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -134,17 +144,17 @@ extends TableImpl[PaymentRecord]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT__PAYMENT_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT__PAYMENT_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT__PAYMENT_RENTAL_ID_FKEY, null) } override def as(alias: String): Payment = new Payment(DSL.name(alias), this) override def as(alias: Name): Payment = new Payment(alias, this) override def as(alias: Table[_]): Payment = new Payment(alias.getQualifiedName(), this) @@ -164,19 +174,48 @@ extends TableImpl[PaymentRecord]( */ override def rename(name: Table[_]): Payment = new Payment(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Payment = new Payment(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Payment = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Payment = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Payment = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Payment = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): Payment = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): Payment = where(DSL.notExists(select)) } 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 e8d3d33..9cd61a3 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_01Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_01 { */ class PaymentP2007_01( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_01Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_01Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_01Record], aliased: Table[PaymentP2007_01Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_01Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_01Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_01Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_01Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_01Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_01Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_01 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_01Record]( */ def this() = this(DSL.name("payment_p2007_01"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_01Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_01.PAYMENT_P2007_01, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_01Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_01__PAYMENT_P2007_01_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_01Record] ] = Arrays.asList[ Check[PaymentP2007_01Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_01_payment_date_check"), "(((payment_date >= '2007-01-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-02-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_01Record]( */ override def rename(name: Table[_]): PaymentP2007_01 = new PaymentP2007_01(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_01 = new PaymentP2007_01(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_01 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_01 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_01 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_01 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_01 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_01 = where(DSL.notExists(select)) } 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 9ef4746..0065717 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_02Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_02 { */ class PaymentP2007_02( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_02Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_02Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_02Record], aliased: Table[PaymentP2007_02Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_02Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_02Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_02Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_02Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_02Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_02Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_02 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_02Record]( */ def this() = this(DSL.name("payment_p2007_02"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_02Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_02.PAYMENT_P2007_02, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_02Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_02__PAYMENT_P2007_02_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_02Record] ] = Arrays.asList[ Check[PaymentP2007_02Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_02_payment_date_check"), "(((payment_date >= '2007-02-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-03-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_02Record]( */ override def rename(name: Table[_]): PaymentP2007_02 = new PaymentP2007_02(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_02 = new PaymentP2007_02(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_02 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_02 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_02 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_02 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_02 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_02 = where(DSL.notExists(select)) } 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 9891515..7baecf3 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_03Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_03 { */ class PaymentP2007_03( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_03Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_03Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_03Record], aliased: Table[PaymentP2007_03Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_03Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_03Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_03Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_03Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_03Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_03Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_03 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_03Record]( */ def this() = this(DSL.name("payment_p2007_03"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_03Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_03.PAYMENT_P2007_03, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_03Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_03__PAYMENT_P2007_03_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_03Record] ] = Arrays.asList[ Check[PaymentP2007_03Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_03_payment_date_check"), "(((payment_date >= '2007-03-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-04-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_03Record]( */ override def rename(name: Table[_]): PaymentP2007_03 = new PaymentP2007_03(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_03 = new PaymentP2007_03(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_03 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_03 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_03 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_03 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_03 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_03 = where(DSL.notExists(select)) } 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 9582956..a55709b 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_04Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_04 { */ class PaymentP2007_04( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_04Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_04Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_04Record], aliased: Table[PaymentP2007_04Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_04Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_04Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_04Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_04Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_04Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_04Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_04 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_04Record]( */ def this() = this(DSL.name("payment_p2007_04"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_04Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_04.PAYMENT_P2007_04, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_04Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_04__PAYMENT_P2007_04_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_04Record] ] = Arrays.asList[ Check[PaymentP2007_04Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_04_payment_date_check"), "(((payment_date >= '2007-04-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-05-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_04Record]( */ override def rename(name: Table[_]): PaymentP2007_04 = new PaymentP2007_04(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_04 = new PaymentP2007_04(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_04 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_04 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_04 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_04 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_04 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_04 = where(DSL.notExists(select)) } 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 65d2b2c..73a15c7 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_05Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_05 { */ class PaymentP2007_05( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_05Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_05Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_05Record], aliased: Table[PaymentP2007_05Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_05Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_05Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_05Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_05Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_05Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_05Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_05 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_05Record]( */ def this() = this(DSL.name("payment_p2007_05"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_05Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_05.PAYMENT_P2007_05, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_05Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_05__PAYMENT_P2007_05_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_05Record] ] = Arrays.asList[ Check[PaymentP2007_05Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_05_payment_date_check"), "(((payment_date >= '2007-05-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-06-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_05Record]( */ override def rename(name: Table[_]): PaymentP2007_05 = new PaymentP2007_05(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_05 = new PaymentP2007_05(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_05 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_05 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_05 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_05 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_05 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_05 = where(DSL.notExists(select)) } 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 7d6f1c4..8d44fa3 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 @@ -4,31 +4,39 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function import org.jooq.Check +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity import org.jooq.Index +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row6 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions 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.Customer.CustomerPath +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.PaymentP2007_06Record import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -51,20 +59,24 @@ object PaymentP2007_06 { */ class PaymentP2007_06( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, PaymentP2007_06Record], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, PaymentP2007_06Record], + parentPath: InverseForeignKey[_ <: Record, PaymentP2007_06Record], aliased: Table[PaymentP2007_06Record], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[PaymentP2007_06Record]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -102,7 +114,8 @@ extends TableImpl[PaymentP2007_06Record]( */ val PAYMENT_DATE: TableField[PaymentP2007_06Record, LocalDateTime] = createField(DSL.name("payment_date"), SQLDataType.LOCALDATETIME(6).nullable(false), "") - private def this(alias: Name, aliased: Table[PaymentP2007_06Record]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[PaymentP2007_06Record]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[PaymentP2007_06Record], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.payment_p2007_06 table reference @@ -119,9 +132,7 @@ extends TableImpl[PaymentP2007_06Record]( */ def this() = this(DSL.name("payment_p2007_06"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, PaymentP2007_06Record]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.PaymentP2007_06.PAYMENT_P2007_06, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + 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) @@ -132,17 +143,17 @@ extends TableImpl[PaymentP2007_06Record]( /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.rental table. */ - lazy val rental: Rental = { new Rental(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY) } + lazy val rental: RentalPath = { new RentalPath(this, Keys.PAYMENT_P2007_06__PAYMENT_P2007_06_RENTAL_ID_FKEY, null) } override def getChecks: List[ Check[PaymentP2007_06Record] ] = Arrays.asList[ Check[PaymentP2007_06Record] ]( Internal.createCheck(this, DSL.name("payment_p2007_06_payment_date_check"), "(((payment_date >= '2007-06-01 00:00:00'::timestamp without time zone) AND (payment_date < '2007-07-01 00:00:00'::timestamp without time zone)))", true) ) @@ -165,19 +176,48 @@ extends TableImpl[PaymentP2007_06Record]( */ override def rename(name: Table[_]): PaymentP2007_06 = new PaymentP2007_06(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row6 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): PaymentP2007_06 = new PaymentP2007_06(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): PaymentP2007_06 = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): PaymentP2007_06 = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): PaymentP2007_06 = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): PaymentP2007_06 = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereExists(select: Select[_]): PaymentP2007_06 = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, Long, BigDecimal, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6())) + override def whereNotExists(select: Select[_]): PaymentP2007_06 = where(DSL.notExists(select)) } 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 7804b7a..1994256 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row7 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,6 +34,9 @@ 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.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.RentalRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +52,11 @@ object Rental { * The reference instance of public.rental */ val RENTAL = new Rental + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class RentalPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, RentalRecord], parentPath: InverseForeignKey[_ <: Record, RentalRecord]) extends Rental(path, childPath, parentPath) with Path[RentalRecord] } /** @@ -50,20 +64,24 @@ object Rental { */ class Rental( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, RentalRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, RentalRecord], + parentPath: InverseForeignKey[_ <: Record, RentalRecord], aliased: Table[RentalRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[RentalRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -106,7 +124,8 @@ extends TableImpl[RentalRecord]( */ val LAST_UPDATE: TableField[RentalRecord, LocalDateTime] = createField(DSL.name("last_update"), SQLDataType.LOCALDATETIME(6).nullable(false).readonly(true).defaultValue(DSL.field(DSL.raw("now()"), SQLDataType.LOCALDATETIME)), "") - private def this(alias: Name, aliased: Table[RentalRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[RentalRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[RentalRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.rental table reference @@ -123,9 +142,9 @@ extends TableImpl[RentalRecord]( */ def this() = this(DSL.name("rental"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, RentalRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Rental.RENTAL, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, RentalRecord], parentPath: InverseForeignKey[_ <: Record, RentalRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Rental.RENTAL, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_FK_INVENTORY_ID, Indexes.IDX_UNQ_RENTAL_RENTAL_DATE_INVENTORY_ID_CUSTOMER_ID) @@ -138,17 +157,17 @@ extends TableImpl[RentalRecord]( /** * Get the implicit join path to the public.inventory table. */ - lazy val inventory: Inventory = { new Inventory(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY) } + lazy val inventory: InventoryPath = { new InventoryPath(this, Keys.RENTAL__RENTAL_INVENTORY_ID_FKEY, null) } /** * Get the implicit join path to the public.customer table. */ - lazy val customer: Customer = { new Customer(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY) } + lazy val customer: CustomerPath = { new CustomerPath(this, Keys.RENTAL__RENTAL_CUSTOMER_ID_FKEY, null) } /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.RENTAL__RENTAL_STAFF_ID_FKEY, null) } 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) @@ -168,19 +187,48 @@ extends TableImpl[RentalRecord]( */ override def rename(name: Table[_]): Rental = new Rental(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row7 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Rental = new Rental(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Rental = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Rental = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Rental = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Rental = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7())) + override def whereExists(select: Select[_]): Rental = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7())) + override def whereNotExists(select: Select[_]): Rental = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala index 2bcd730..b21f059 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/RewardsReport.scala @@ -12,16 +12,15 @@ import java.lang.String import java.math.BigDecimal import java.time.LocalDate import java.time.LocalDateTime -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name import org.jooq.Record -import org.jooq.Row10 import org.jooq.Schema -import org.jooq.SelectField import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -47,20 +46,24 @@ object RewardsReport { */ class RewardsReport( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, CustomerRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, CustomerRecord], + parentPath: InverseForeignKey[_ <: Record, CustomerRecord], aliased: Table[CustomerRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[CustomerRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.function + TableOptions.function, + where ) { /** @@ -118,10 +121,10 @@ extends TableImpl[CustomerRecord]( */ val ACTIVE: TableField[CustomerRecord, Integer] = createField(DSL.name("active"), SQLDataType.INTEGER, "") - private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, aliased, Array( + private def this(alias: Name, aliased: Table[CustomerRecord]) = this(alias, null, null, null, aliased, Array( DSL.value(null, SQLDataType.INTEGER), DSL.value(null, SQLDataType.NUMERIC) - )) + ), null) /** * Create an aliased public.rewards_report table reference @@ -138,32 +141,27 @@ extends TableImpl[CustomerRecord]( */ def this() = this(DSL.name("rewards_report"), null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[CustomerRecord, Long] = super.getIdentity.asInstanceOf[ Identity[CustomerRecord, Long] ] - override def as(alias: String): RewardsReport = new RewardsReport(DSL.name(alias), null, null, this, parameters) - override def as(alias: Name): RewardsReport = new RewardsReport(alias, null, null, this, parameters) - override def as(alias: Table[_]): RewardsReport = new RewardsReport(alias.getQualifiedName(), null, null, this, parameters) + override def as(alias: String): RewardsReport = new RewardsReport(DSL.name(alias), null, null, null, this, parameters, null) + override def as(alias: Name): RewardsReport = new RewardsReport(alias, null, null, null, this, parameters, null) + override def as(alias: Table[_]): RewardsReport = new RewardsReport(alias.getQualifiedName(), null, null, null, this, parameters, null) /** * Rename this table */ - override def rename(name: String): RewardsReport = new RewardsReport(DSL.name(name), null, null, null, parameters) + override def rename(name: String): RewardsReport = new RewardsReport(DSL.name(name), null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Name): RewardsReport = new RewardsReport(name, null, null, null, parameters) + override def rename(name: Name): RewardsReport = new RewardsReport(name, null, null, null, null, parameters, null) /** * Rename this table */ - override def rename(name: Table[_]): RewardsReport = new RewardsReport(name.getQualifiedName(), null, null, null, parameters) - - // ------------------------------------------------------------------------- - // Row10 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.fieldsRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] + override def rename(name: Table[_]): RewardsReport = new RewardsReport(name.getQualifiedName(), null, null, null, null, parameters, null) /** * Call this table-valued function @@ -171,10 +169,10 @@ extends TableImpl[CustomerRecord]( def call( minMonthlyPurchases: Integer , minDollarAmountPurchased: BigDecimal - ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, Array( + ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, null, Array( DSL.value(minMonthlyPurchases, SQLDataType.INTEGER), DSL.value(minDollarAmountPurchased, SQLDataType.NUMERIC) - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get /** * Call this table-valued function @@ -182,19 +180,8 @@ extends TableImpl[CustomerRecord]( def call( minMonthlyPurchases: Field[Integer] , minDollarAmountPurchased: Field[BigDecimal] - ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, Array( + ): RewardsReport = Option(new RewardsReport(DSL.name("rewards_report"), null, null, null, null, Array( minMonthlyPurchases, minDollarAmountPurchased - ))).map(r => if (aliased()) r.as(getUnqualifiedName) else r).get - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. - */ - def mapping[U](from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) - - /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. - */ - def mapping[U](toType: Class[U], from: (Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10())) + ), null)).map(r => if (super.aliased()) r.as(getUnqualifiedName) else r).get } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala index 9f1f7d4..dca0472 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByFilmCategory.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row2 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.SalesByFilmCategoryRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object SalesByFilmCategory { */ class SalesByFilmCategory( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, SalesByFilmCategoryRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, SalesByFilmCategoryRecord], + parentPath: InverseForeignKey[_ <: Record, SalesByFilmCategoryRecord], aliased: Table[SalesByFilmCategoryRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[SalesByFilmCategoryRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -66,7 +73,8 @@ extends TableImpl[SalesByFilmCategoryRecord]( JOIN category c ON ((fc.category_id = c.category_id))) GROUP BY c.name ORDER BY (sum(p.amount)) DESC; - """) + """), + where ) { /** @@ -84,7 +92,8 @@ extends TableImpl[SalesByFilmCategoryRecord]( */ val TOTAL_SALES: TableField[SalesByFilmCategoryRecord, BigDecimal] = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, "") - private def this(alias: Name, aliased: Table[SalesByFilmCategoryRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[SalesByFilmCategoryRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[SalesByFilmCategoryRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.sales_by_film_category table @@ -103,9 +112,7 @@ extends TableImpl[SalesByFilmCategoryRecord]( */ def this() = this(DSL.name("sales_by_film_category"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, SalesByFilmCategoryRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.SalesByFilmCategory.SALES_BY_FILM_CATEGORY, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): SalesByFilmCategory = new SalesByFilmCategory(DSL.name(alias), this) override def as(alias: Name): SalesByFilmCategory = new SalesByFilmCategory(alias, this) override def as(alias: Table[_]): SalesByFilmCategory = new SalesByFilmCategory(alias.getQualifiedName(), this) @@ -125,19 +132,48 @@ extends TableImpl[SalesByFilmCategoryRecord]( */ override def rename(name: Table[_]): SalesByFilmCategory = new SalesByFilmCategory(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row2 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row2[String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row2[String, BigDecimal] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): SalesByFilmCategory = new SalesByFilmCategory(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): SalesByFilmCategory = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): SalesByFilmCategory = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): SalesByFilmCategory = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): SalesByFilmCategory = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (String, BigDecimal) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2())) + override def whereExists(select: Select[_]): SalesByFilmCategory = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (String, BigDecimal) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2())) + override def whereNotExists(select: Select[_]): SalesByFilmCategory = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala index b88f340..c24750c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/SalesByStore.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.String import java.math.BigDecimal -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row3 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.SalesByStoreRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object SalesByStore { */ class SalesByStore( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, SalesByStoreRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, SalesByStoreRecord], + parentPath: InverseForeignKey[_ <: Record, SalesByStoreRecord], aliased: Table[SalesByStoreRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[SalesByStoreRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -69,7 +76,8 @@ extends TableImpl[SalesByStoreRecord]( JOIN staff m ON ((s.manager_staff_id = m.staff_id))) GROUP BY cy.country, c.city, s.store_id, m.first_name, m.last_name ORDER BY cy.country, c.city; - """) + """), + where ) { /** @@ -92,7 +100,8 @@ extends TableImpl[SalesByStoreRecord]( */ val TOTAL_SALES: TableField[SalesByStoreRecord, BigDecimal] = createField(DSL.name("total_sales"), SQLDataType.NUMERIC, "") - private def this(alias: Name, aliased: Table[SalesByStoreRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[SalesByStoreRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[SalesByStoreRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.sales_by_store table reference @@ -109,9 +118,7 @@ extends TableImpl[SalesByStoreRecord]( */ def this() = this(DSL.name("sales_by_store"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, SalesByStoreRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.SalesByStore.SALES_BY_STORE, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): SalesByStore = new SalesByStore(DSL.name(alias), this) override def as(alias: Name): SalesByStore = new SalesByStore(alias, this) override def as(alias: Table[_]): SalesByStore = new SalesByStore(alias.getQualifiedName(), this) @@ -131,19 +138,48 @@ extends TableImpl[SalesByStoreRecord]( */ override def rename(name: Table[_]): SalesByStore = new SalesByStore(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row3 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row3[String, String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row3[String, String, BigDecimal] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): SalesByStore = new SalesByStore(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): SalesByStore = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): SalesByStore = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): SalesByStore = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): SalesByStore = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (String, String, BigDecimal) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereExists(select: Select[_]): SalesByStore = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (String, String, BigDecimal) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3())) + override def whereNotExists(select: Select[_]): SalesByStore = where(DSL.notExists(select)) } 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 eafebb1..4618e09 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 @@ -10,23 +10,30 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey import org.jooq.Identity +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.Path +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row13 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField 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.Address.AddressPath +import org.jooq.demo.skala.db.tables.Store.StorePath import org.jooq.demo.skala.db.tables.records.StaffRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +50,11 @@ object Staff { * The reference instance of public.staff */ val STAFF = new Staff + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class StaffPath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StaffRecord], parentPath: InverseForeignKey[_ <: Record, StaffRecord]) extends Staff(path, childPath, parentPath) with Path[StaffRecord] } /** @@ -50,20 +62,24 @@ object Staff { */ class Staff( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, StaffRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, StaffRecord], + parentPath: InverseForeignKey[_ <: Record, StaffRecord], aliased: Table[StaffRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[StaffRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -136,7 +152,8 @@ extends TableImpl[StaffRecord]( */ val FULL_NAME: TableField[StaffRecord, String] = createField(DSL.name("full_name"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[StaffRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[StaffRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[StaffRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.staff table reference @@ -153,9 +170,9 @@ extends TableImpl[StaffRecord]( */ def this() = this(DSL.name("staff"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, StaffRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Staff.STAFF, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StaffRecord], parentPath: InverseForeignKey[_ <: Record, StaffRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Staff.STAFF, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIdentity: Identity[StaffRecord, Long] = super.getIdentity.asInstanceOf[ Identity[StaffRecord, Long] ] @@ -166,12 +183,12 @@ extends TableImpl[StaffRecord]( /** * Get the implicit join path to the public.address table. */ - lazy val address: Address = { new Address(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY) } + lazy val address: AddressPath = { new AddressPath(this, Keys.STAFF__STAFF_ADDRESS_ID_FKEY, null) } /** * Get the implicit join path to the public.store table. */ - lazy val store: Store = { new Store(this, Keys.STAFF__STAFF_STORE_ID_FKEY) } + lazy val store: StorePath = { new StorePath(this, Keys.STAFF__STAFF_STORE_ID_FKEY, null) } 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) @@ -191,19 +208,48 @@ extends TableImpl[StaffRecord]( */ override def rename(name: Table[_]): Staff = new Staff(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row13 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] = super.fieldsRow.asInstanceOf[ Row13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Staff = new Staff(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Staff = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Staff = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Staff = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Staff = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11(), r.value12(), r.value13())) + override def whereExists(select: Select[_]): Staff = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8(), r.value9(), r.value10(), r.value11(), r.value12(), r.value13())) + override def whereNotExists(select: Select[_]): Staff = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala index 6dba585..70af991 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/StaffList.scala @@ -4,25 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String -import java.util.function.Function +import java.util.Collection +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey +import org.jooq.InverseForeignKey import org.jooq.Name +import org.jooq.PlainSQL import org.jooq.Record -import org.jooq.Row8 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions import org.jooq.demo.skala.db.Public import org.jooq.demo.skala.db.tables.records.StaffListRecord import org.jooq.impl.DSL -import org.jooq.impl.Internal import org.jooq.impl.SQLDataType import org.jooq.impl.TableImpl @@ -42,16 +46,19 @@ object StaffList { */ class StaffList( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, StaffListRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, StaffListRecord], + parentPath: InverseForeignKey[_ <: Record, StaffListRecord], aliased: Table[StaffListRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[StaffListRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), @@ -68,7 +75,8 @@ extends TableImpl[StaffListRecord]( JOIN address a ON ((s.address_id = a.address_id))) JOIN city ON ((a.city_id = city.city_id))) JOIN country ON ((city.country_id = country.country_id))); - """) + """), + where ) { /** @@ -116,7 +124,8 @@ extends TableImpl[StaffListRecord]( */ val SID: TableField[StaffListRecord, Long] = createField(DSL.name("sid"), SQLDataType.BIGINT, "") - private def this(alias: Name, aliased: Table[StaffListRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[StaffListRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[StaffListRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.staff_list table reference @@ -133,9 +142,7 @@ extends TableImpl[StaffListRecord]( */ def this() = this(DSL.name("staff_list"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, StaffListRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.StaffList.STAFF_LIST, null) - - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def as(alias: String): StaffList = new StaffList(DSL.name(alias), this) override def as(alias: Name): StaffList = new StaffList(alias, this) override def as(alias: Table[_]): StaffList = new StaffList(alias.getQualifiedName(), this) @@ -155,19 +162,48 @@ extends TableImpl[StaffListRecord]( */ override def rename(name: Table[_]): StaffList = new StaffList(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row8[Long, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, String, String, String, Long] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): StaffList = new StaffList(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): StaffList = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): StaffList = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): StaffList = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): StaffList = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereExists(select: Select[_]): StaffList = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, String, String, String, String, String, String, Long) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5(), r.value6(), r.value7(), r.value8())) + override def whereNotExists(select: Select[_]): StaffList = where(DSL.notExists(select)) } 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 6d0af1d..08909d9 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 @@ -4,23 +4,29 @@ package org.jooq.demo.skala.db.tables +import java.lang.Boolean import java.lang.Class import java.lang.Long import java.lang.String import java.time.LocalDateTime import java.util.Arrays +import java.util.Collection import java.util.List -import java.util.function.Function +import org.jooq.Condition import org.jooq.Field import org.jooq.ForeignKey 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.Row5 +import org.jooq.SQL import org.jooq.Schema -import org.jooq.SelectField +import org.jooq.Select +import org.jooq.Stringly import org.jooq.Table import org.jooq.TableField import org.jooq.TableOptions @@ -28,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.Address.AddressPath +import org.jooq.demo.skala.db.tables.Staff.StaffPath import org.jooq.demo.skala.db.tables.records.StoreRecord import org.jooq.impl.DSL import org.jooq.impl.Internal @@ -43,6 +51,11 @@ object Store { * The reference instance of public.store */ val STORE = new Store + + /** + * A subtype implementing {@link Path} for simplified path-based joins. + */ + class StorePath(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StoreRecord], parentPath: InverseForeignKey[_ <: Record, StoreRecord]) extends Store(path, childPath, parentPath) with Path[StoreRecord] } /** @@ -50,20 +63,24 @@ object Store { */ class Store( alias: Name, - child: Table[_ <: Record], - path: ForeignKey[_ <: Record, StoreRecord], + path: Table[_ <: Record], + childPath: ForeignKey[_ <: Record, StoreRecord], + parentPath: InverseForeignKey[_ <: Record, StoreRecord], aliased: Table[StoreRecord], - parameters: Array[ Field[_] ] + parameters: Array[ Field[_] ], + where: Condition ) extends TableImpl[StoreRecord]( alias, Public.PUBLIC, - child, path, + childPath, + parentPath, aliased, parameters, DSL.comment(""), - TableOptions.table + TableOptions.table, + where ) { /** @@ -96,7 +113,8 @@ extends TableImpl[StoreRecord]( */ val FULL_ADDRESS: TableField[StoreRecord, String] = createField(DSL.name("full_address"), SQLDataType.CLOB, "") - private def this(alias: Name, aliased: Table[StoreRecord]) = this(alias, null, null, aliased, null) + private def this(alias: Name, aliased: Table[StoreRecord]) = this(alias, null, null, null, aliased, null, null) + private def this(alias: Name, aliased: Table[StoreRecord], where: Condition) = this(alias, null, null, null, aliased, null, where) /** * Create an aliased public.store table reference @@ -113,9 +131,9 @@ extends TableImpl[StoreRecord]( */ def this() = this(DSL.name("store"), null) - def this(child: Table[_ <: Record], key: ForeignKey[_ <: Record, StoreRecord]) = this(Internal.createPathAlias(child, key), child, key, org.jooq.demo.skala.db.tables.Store.STORE, null) + def this(path: Table[_ <: Record], childPath: ForeignKey[_ <: Record, StoreRecord], parentPath: InverseForeignKey[_ <: Record, StoreRecord]) = this(Internal.createPathAlias(path, childPath, parentPath), path, childPath, parentPath, org.jooq.demo.skala.db.tables.Store.STORE, null, null) - override def getSchema: Schema = if (aliased()) null else Public.PUBLIC + override def getSchema: Schema = if (super.aliased()) null else Public.PUBLIC override def getIndexes: List[Index] = Arrays.asList[ Index ](Indexes.IDX_UNQ_MANAGER_STAFF_ID) @@ -128,12 +146,12 @@ extends TableImpl[StoreRecord]( /** * Get the implicit join path to the public.staff table. */ - lazy val staff: Staff = { new Staff(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY) } + lazy val staff: StaffPath = { new StaffPath(this, Keys.STORE__STORE_MANAGER_STAFF_ID_FKEY, null) } /** * Get the implicit join path to the public.address table. */ - lazy val address: Address = { new Address(this, Keys.STORE__STORE_ADDRESS_ID_FKEY) } + lazy val address: AddressPath = { new AddressPath(this, Keys.STORE__STORE_ADDRESS_ID_FKEY, null) } 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) @@ -153,19 +171,48 @@ extends TableImpl[StoreRecord]( */ override def rename(name: Table[_]): Store = new Store(name.getQualifiedName(), null) - // ------------------------------------------------------------------------- - // Row5 type methods - // ------------------------------------------------------------------------- - override def fieldsRow: Row5[Long, Long, Long, LocalDateTime, String] = super.fieldsRow.asInstanceOf[ Row5[Long, Long, Long, LocalDateTime, String] ] + /** + * Create an inline derived table from this table + */ + override def where(condition: Condition): Store = new Store(getQualifiedName(), if (super.aliased()) this else null, condition) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Collection[_ <: Condition]): Store = where(DSL.and(conditions)) + + /** + * Create an inline derived table from this table + */ + override def where(conditions: Condition*): Store = where(DSL.and(conditions:_*)) + + /** + * Create an inline derived table from this table + */ + override def where(condition: Field[Boolean]): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(condition: SQL): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String): Store = where(DSL.condition(condition)) + + /** + * Create an inline derived table from this table + */ + @PlainSQL override def where(@Stringly.SQL condition: String, binds: AnyRef*): Store = where(DSL.condition(condition, binds:_*)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Function)}. + * Create an inline derived table from this table */ - def mapping[U](from: (Long, Long, Long, LocalDateTime, String) => U): SelectField[U] = convertFrom(r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5())) + override def whereExists(select: Select[_]): Store = where(DSL.exists(select)) /** - * Convenience mapping calling {@link SelectField#convertFrom(Class, - * Function)}. + * Create an inline derived table from this table */ - def mapping[U](toType: Class[U], from: (Long, Long, Long, LocalDateTime, String) => U): SelectField[U] = convertFrom(toType,r => from.apply(r.value1(), r.value2(), r.value3(), r.value4(), r.value5())) + override def whereNotExists(select: Select[_]): Store = where(DSL.notExists(select)) } diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala index 8eb5c21..85535cd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorInfoRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.lang.String -import org.jooq.Field -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.ActorInfo import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class ActorInfoRecord extends TableRecordImpl[ActorInfoRecord](ActorInfo.ACTOR_INFO) with Record4[Long, String, String, String] { +class ActorInfoRecord extends TableRecordImpl[ActorInfoRecord](ActorInfo.ACTOR_INFO) { /** * Setter for public.actor_info.actor_id. @@ -67,54 +64,6 @@ class ActorInfoRecord extends TableRecordImpl[ActorInfoRecord](ActorInfo.ACTOR_I */ def getFilmInfo: String = get(3).asInstanceOf[String] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, String, String, String] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, String] ] - - override def valuesRow: Row4[Long, String, String, String] = super.valuesRow.asInstanceOf[ Row4[Long, String, String, String] ] - override def field1: Field[Long] = ActorInfo.ACTOR_INFO.ACTOR_ID - override def field2: Field[String] = ActorInfo.ACTOR_INFO.FIRST_NAME - override def field3: Field[String] = ActorInfo.ACTOR_INFO.LAST_NAME - override def field4: Field[String] = ActorInfo.ACTOR_INFO.FILM_INFO - override def component1: Long = getActorId - override def component2: String = getFirstName - override def component3: String = getLastName - override def component4: String = getFilmInfo - override def value1: Long = getActorId - override def value2: String = getFirstName - override def value3: String = getLastName - override def value4: String = getFilmInfo - - override def value1(value: Long): ActorInfoRecord = { - setActorId(value) - this - } - - override def value2(value: String): ActorInfoRecord = { - setFirstName(value) - this - } - - override def value3(value: String): ActorInfoRecord = { - setLastName(value) - this - } - - override def value4(value: String): ActorInfoRecord = { - setFilmInfo(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String): ActorInfoRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised ActorInfoRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala index 4bb67c1..7517baa 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/ActorRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.Actor import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class ActorRecord extends UpdatableRecordImpl[ActorRecord](Actor.ACTOR) with Record4[Long, String, String, LocalDateTime] { +class ActorRecord extends UpdatableRecordImpl[ActorRecord](Actor.ACTOR) { /** * Setter for public.actor.actor_id. @@ -75,54 +72,6 @@ class ActorRecord extends UpdatableRecordImpl[ActorRecord](Actor.ACTOR) with Rec override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, String, LocalDateTime] ] - - override def valuesRow: Row4[Long, String, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, String, String, LocalDateTime] ] - override def field1: Field[Long] = Actor.ACTOR.ACTOR_ID - override def field2: Field[String] = Actor.ACTOR.FIRST_NAME - override def field3: Field[String] = Actor.ACTOR.LAST_NAME - override def field4: Field[LocalDateTime] = Actor.ACTOR.LAST_UPDATE - override def component1: Long = getActorId - override def component2: String = getFirstName - override def component3: String = getLastName - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getActorId - override def value2: String = getFirstName - override def value3: String = getLastName - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): ActorRecord = { - setActorId(value) - this - } - - override def value2(value: String): ActorRecord = { - setFirstName(value) - this - } - - override def value3(value: String): ActorRecord = { - setLastName(value) - this - } - - override def value4(value: LocalDateTime): ActorRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : LocalDateTime): ActorRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised ActorRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala index 3f5c2bb..41e9435 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/AddressRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.tables.Address import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class AddressRecord extends UpdatableRecordImpl[AddressRecord](Address.ADDRESS) with Record8[Long, String, String, String, Long, String, String, LocalDateTime] { +class AddressRecord extends UpdatableRecordImpl[AddressRecord](Address.ADDRESS) { /** * Setter for public.address.address_id. @@ -123,90 +120,6 @@ class AddressRecord extends UpdatableRecordImpl[AddressRecord](Address.ADDRESS) override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, Long, String, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, Long, String, String, LocalDateTime] ] - - override def valuesRow: Row8[Long, String, String, String, Long, String, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, Long, String, String, LocalDateTime] ] - override def field1: Field[Long] = Address.ADDRESS.ADDRESS_ID - override def field2: Field[String] = Address.ADDRESS.ADDRESS_ - override def field3: Field[String] = Address.ADDRESS.ADDRESS2 - override def field4: Field[String] = Address.ADDRESS.DISTRICT - override def field5: Field[Long] = Address.ADDRESS.CITY_ID - override def field6: Field[String] = Address.ADDRESS.POSTAL_CODE - override def field7: Field[String] = Address.ADDRESS.PHONE - override def field8: Field[LocalDateTime] = Address.ADDRESS.LAST_UPDATE - override def component1: Long = getAddressId - override def component2: String = getAddress - override def component3: String = getAddress2 - override def component4: String = getDistrict - override def component5: Long = getCityId - override def component6: String = getPostalCode - override def component7: String = getPhone - override def component8: LocalDateTime = getLastUpdate - override def value1: Long = getAddressId - override def value2: String = getAddress - override def value3: String = getAddress2 - override def value4: String = getDistrict - override def value5: Long = getCityId - override def value6: String = getPostalCode - override def value7: String = getPhone - override def value8: LocalDateTime = getLastUpdate - - override def value1(value: Long): AddressRecord = { - setAddressId(value) - this - } - - override def value2(value: String): AddressRecord = { - setAddress(value) - this - } - - override def value3(value: String): AddressRecord = { - setAddress2(value) - this - } - - override def value4(value: String): AddressRecord = { - setDistrict(value) - this - } - - override def value5(value: Long): AddressRecord = { - setCityId(value) - this - } - - override def value6(value: String): AddressRecord = { - setPostalCode(value) - this - } - - override def value7(value: String): AddressRecord = { - setPhone(value) - this - } - - override def value8(value: LocalDateTime): AddressRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : Long, value6 : String, value7 : String, value8 : LocalDateTime): AddressRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised AddressRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala index 82f44f7..8704f2c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CategoryRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.Category import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CategoryRecord extends UpdatableRecordImpl[CategoryRecord](Category.CATEGORY) with Record3[Long, String, LocalDateTime] { +class CategoryRecord extends UpdatableRecordImpl[CategoryRecord](Category.CATEGORY) { /** * Setter for public.category.category_id. @@ -63,45 +60,6 @@ class CategoryRecord extends UpdatableRecordImpl[CategoryRecord](Category.CATEGO override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - - override def valuesRow: Row3[Long, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - override def field1: Field[Long] = Category.CATEGORY.CATEGORY_ID - override def field2: Field[String] = Category.CATEGORY.NAME - override def field3: Field[LocalDateTime] = Category.CATEGORY.LAST_UPDATE - override def component1: Long = getCategoryId - override def component2: String = getName - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getCategoryId - override def value2: String = getName - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): CategoryRecord = { - setCategoryId(value) - this - } - - override def value2(value: String): CategoryRecord = { - setName(value) - this - } - - override def value3(value: LocalDateTime): CategoryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : LocalDateTime): CategoryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised CategoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala index 3f83e6d..1f82626 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CityRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.City import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CityRecord extends UpdatableRecordImpl[CityRecord](City.CITY) with Record4[Long, String, Long, LocalDateTime] { +class CityRecord extends UpdatableRecordImpl[CityRecord](City.CITY) { /** * Setter for public.city.city_id. @@ -75,54 +72,6 @@ class CityRecord extends UpdatableRecordImpl[CityRecord](City.CITY) with Record4 override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, String, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, String, Long, LocalDateTime] ] - - override def valuesRow: Row4[Long, String, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, String, Long, LocalDateTime] ] - override def field1: Field[Long] = City.CITY.CITY_ID - override def field2: Field[String] = City.CITY.CITY_ - override def field3: Field[Long] = City.CITY.COUNTRY_ID - override def field4: Field[LocalDateTime] = City.CITY.LAST_UPDATE - override def component1: Long = getCityId - override def component2: String = getCity - override def component3: Long = getCountryId - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getCityId - override def value2: String = getCity - override def value3: Long = getCountryId - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): CityRecord = { - setCityId(value) - this - } - - override def value2(value: String): CityRecord = { - setCity(value) - this - } - - override def value3(value: Long): CityRecord = { - setCountryId(value) - this - } - - override def value4(value: LocalDateTime): CityRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : Long, value4 : LocalDateTime): CityRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised CityRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala index 65fd07e..4406375 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CountryRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.Country import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CountryRecord extends UpdatableRecordImpl[CountryRecord](Country.COUNTRY) with Record3[Long, String, LocalDateTime] { +class CountryRecord extends UpdatableRecordImpl[CountryRecord](Country.COUNTRY) { /** * Setter for public.country.country_id. @@ -63,45 +60,6 @@ class CountryRecord extends UpdatableRecordImpl[CountryRecord](Country.COUNTRY) override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - - override def valuesRow: Row3[Long, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - override def field1: Field[Long] = Country.COUNTRY.COUNTRY_ID - override def field2: Field[String] = Country.COUNTRY.COUNTRY_ - override def field3: Field[LocalDateTime] = Country.COUNTRY.LAST_UPDATE - override def component1: Long = getCountryId - override def component2: String = getCountry - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getCountryId - override def value2: String = getCountry - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): CountryRecord = { - setCountryId(value) - this - } - - override def value2(value: String): CountryRecord = { - setCountry(value) - this - } - - override def value3(value: LocalDateTime): CountryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : LocalDateTime): CountryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised CountryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala index 2ffd3a6..4fe8d8b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerListRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.lang.String -import org.jooq.Field -import org.jooq.Record9 -import org.jooq.Row9 import org.jooq.demo.skala.db.tables.CustomerList import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class CustomerListRecord extends TableRecordImpl[CustomerListRecord](CustomerList.CUSTOMER_LIST) with Record9[Long, String, String, String, String, String, String, String, Long] { +class CustomerListRecord extends TableRecordImpl[CustomerListRecord](CustomerList.CUSTOMER_LIST) { /** * Setter for public.customer_list.id. @@ -127,99 +124,6 @@ class CustomerListRecord extends TableRecordImpl[CustomerListRecord](CustomerLis */ def getSid: Long = get(8).asInstanceOf[Long] - // ------------------------------------------------------------------------- - // Record9 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row9[Long, String, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row9[Long, String, String, String, String, String, String, String, Long] ] - - override def valuesRow: Row9[Long, String, String, String, String, String, String, String, Long] = super.valuesRow.asInstanceOf[ Row9[Long, String, String, String, String, String, String, String, Long] ] - override def field1: Field[Long] = CustomerList.CUSTOMER_LIST.ID - override def field2: Field[String] = CustomerList.CUSTOMER_LIST.NAME - override def field3: Field[String] = CustomerList.CUSTOMER_LIST.ADDRESS - override def field4: Field[String] = CustomerList.CUSTOMER_LIST.ZIP_CODE - override def field5: Field[String] = CustomerList.CUSTOMER_LIST.PHONE - override def field6: Field[String] = CustomerList.CUSTOMER_LIST.CITY - override def field7: Field[String] = CustomerList.CUSTOMER_LIST.COUNTRY - override def field8: Field[String] = CustomerList.CUSTOMER_LIST.NOTES - override def field9: Field[Long] = CustomerList.CUSTOMER_LIST.SID - override def component1: Long = getId - override def component2: String = getName - override def component3: String = getAddress - override def component4: String = getZipCode - override def component5: String = getPhone - override def component6: String = getCity - override def component7: String = getCountry - override def component8: String = getNotes - override def component9: Long = getSid - override def value1: Long = getId - override def value2: String = getName - override def value3: String = getAddress - override def value4: String = getZipCode - override def value5: String = getPhone - override def value6: String = getCity - override def value7: String = getCountry - override def value8: String = getNotes - override def value9: Long = getSid - - override def value1(value: Long): CustomerListRecord = { - setId(value) - this - } - - override def value2(value: String): CustomerListRecord = { - setName(value) - this - } - - override def value3(value: String): CustomerListRecord = { - setAddress(value) - this - } - - override def value4(value: String): CustomerListRecord = { - setZipCode(value) - this - } - - override def value5(value: String): CustomerListRecord = { - setPhone(value) - this - } - - override def value6(value: String): CustomerListRecord = { - setCity(value) - this - } - - override def value7(value: String): CustomerListRecord = { - setCountry(value) - this - } - - override def value8(value: String): CustomerListRecord = { - setNotes(value) - this - } - - override def value9(value: Long): CustomerListRecord = { - setSid(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : String, value6 : String, value7 : String, value8 : String, value9 : Long): CustomerListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this - } - /** * Create a detached, initialised CustomerListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala index 253c289..92d342c 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/CustomerRecord.scala @@ -11,10 +11,7 @@ import java.lang.String import java.time.LocalDate import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record10 -import org.jooq.Row10 import org.jooq.demo.skala.db.tables.Customer import org.jooq.impl.UpdatableRecordImpl @@ -22,7 +19,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class CustomerRecord extends UpdatableRecordImpl[CustomerRecord](Customer.CUSTOMER) with Record10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] { +class CustomerRecord extends UpdatableRecordImpl[CustomerRecord](Customer.CUSTOMER) { /** * Setter for public.customer.customer_id. @@ -150,108 +147,6 @@ class CustomerRecord extends UpdatableRecordImpl[CustomerRecord](Customer.CUSTOM override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record10 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.fieldsRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] - - override def valuesRow: Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] = super.valuesRow.asInstanceOf[ Row10[Long, Long, String, String, String, Long, Boolean, LocalDate, LocalDateTime, Integer] ] - override def field1: Field[Long] = Customer.CUSTOMER.CUSTOMER_ID - override def field2: Field[Long] = Customer.CUSTOMER.STORE_ID - override def field3: Field[String] = Customer.CUSTOMER.FIRST_NAME - override def field4: Field[String] = Customer.CUSTOMER.LAST_NAME - override def field5: Field[String] = Customer.CUSTOMER.EMAIL - override def field6: Field[Long] = Customer.CUSTOMER.ADDRESS_ID - override def field7: Field[Boolean] = Customer.CUSTOMER.ACTIVEBOOL - override def field8: Field[LocalDate] = Customer.CUSTOMER.CREATE_DATE - override def field9: Field[LocalDateTime] = Customer.CUSTOMER.LAST_UPDATE - override def field10: Field[Integer] = Customer.CUSTOMER.ACTIVE - override def component1: Long = getCustomerId - override def component2: Long = getStoreId - override def component3: String = getFirstName - override def component4: String = getLastName - override def component5: String = getEmail - override def component6: Long = getAddressId - override def component7: Boolean = getActivebool - override def component8: LocalDate = getCreateDate - override def component9: LocalDateTime = getLastUpdate - override def component10: Integer = getActive - override def value1: Long = getCustomerId - override def value2: Long = getStoreId - override def value3: String = getFirstName - override def value4: String = getLastName - override def value5: String = getEmail - override def value6: Long = getAddressId - override def value7: Boolean = getActivebool - override def value8: LocalDate = getCreateDate - override def value9: LocalDateTime = getLastUpdate - override def value10: Integer = getActive - - override def value1(value: Long): CustomerRecord = { - setCustomerId(value) - this - } - - override def value2(value: Long): CustomerRecord = { - setStoreId(value) - this - } - - override def value3(value: String): CustomerRecord = { - setFirstName(value) - this - } - - override def value4(value: String): CustomerRecord = { - setLastName(value) - this - } - - override def value5(value: String): CustomerRecord = { - setEmail(value) - this - } - - override def value6(value: Long): CustomerRecord = { - setAddressId(value) - this - } - - override def value7(value: Boolean): CustomerRecord = { - setActivebool(value) - this - } - - override def value8(value: LocalDate): CustomerRecord = { - setCreateDate(value) - this - } - - override def value9(value: LocalDateTime): CustomerRecord = { - setLastUpdate(value) - this - } - - override def value10(value: Integer): CustomerRecord = { - setActive(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : String, value4 : String, value5 : String, value6 : Long, value7 : Boolean, value8 : LocalDate, value9 : LocalDateTime, value10 : Integer): CustomerRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this - } - /** * Create a detached, initialised CustomerRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala index d181015..b1d14e6 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmActorRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.FilmActor import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class FilmActorRecord extends UpdatableRecordImpl[FilmActorRecord](FilmActor.FILM_ACTOR) with Record3[Long, Long, LocalDateTime] { +class FilmActorRecord extends UpdatableRecordImpl[FilmActorRecord](FilmActor.FILM_ACTOR) { /** * Setter for public.film_actor.actor_id. @@ -62,45 +59,6 @@ class FilmActorRecord extends UpdatableRecordImpl[FilmActorRecord](FilmActor.FIL override def key: Record2[Long, Long] = super.key.asInstanceOf[ Record2[Long, Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - - override def valuesRow: Row3[Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - override def field1: Field[Long] = FilmActor.FILM_ACTOR.ACTOR_ID - override def field2: Field[Long] = FilmActor.FILM_ACTOR.FILM_ID - override def field3: Field[LocalDateTime] = FilmActor.FILM_ACTOR.LAST_UPDATE - override def component1: Long = getActorId - override def component2: Long = getFilmId - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getActorId - override def value2: Long = getFilmId - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): FilmActorRecord = { - setActorId(value) - this - } - - override def value2(value: Long): FilmActorRecord = { - setFilmId(value) - this - } - - override def value3(value: LocalDateTime): FilmActorRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : LocalDateTime): FilmActorRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised FilmActorRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala index c050ed3..419cf0f 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmCategoryRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record2 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.FilmCategory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class FilmCategoryRecord extends UpdatableRecordImpl[FilmCategoryRecord](FilmCategory.FILM_CATEGORY) with Record3[Long, Long, LocalDateTime] { +class FilmCategoryRecord extends UpdatableRecordImpl[FilmCategoryRecord](FilmCategory.FILM_CATEGORY) { /** * Setter for public.film_category.film_id. @@ -62,45 +59,6 @@ class FilmCategoryRecord extends UpdatableRecordImpl[FilmCategoryRecord](FilmCat override def key: Record2[Long, Long] = super.key.asInstanceOf[ Record2[Long, Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - - override def valuesRow: Row3[Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, Long, LocalDateTime] ] - override def field1: Field[Long] = FilmCategory.FILM_CATEGORY.FILM_ID - override def field2: Field[Long] = FilmCategory.FILM_CATEGORY.CATEGORY_ID - override def field3: Field[LocalDateTime] = FilmCategory.FILM_CATEGORY.LAST_UPDATE - override def component1: Long = getFilmId - override def component2: Long = getCategoryId - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getFilmId - override def value2: Long = getCategoryId - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): FilmCategoryRecord = { - setFilmId(value) - this - } - - override def value2(value: Long): FilmCategoryRecord = { - setCategoryId(value) - this - } - - override def value3(value: LocalDateTime): FilmCategoryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : LocalDateTime): FilmCategoryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised FilmCategoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala index 91ec834..633dbb5 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmInStockRecord.scala @@ -6,9 +6,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Integer -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.skala.db.tables.FilmInStock import org.jooq.impl.TableRecordImpl @@ -16,7 +13,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class FilmInStockRecord extends TableRecordImpl[FilmInStockRecord](FilmInStock.FILM_IN_STOCK) with Record1[Integer] { +class FilmInStockRecord extends TableRecordImpl[FilmInStockRecord](FilmInStock.FILM_IN_STOCK) { /** * Setter for public.film_in_stock.p_film_count. @@ -30,27 +27,6 @@ class FilmInStockRecord extends TableRecordImpl[FilmInStockRecord](FilmInStock.F */ def getPFilmCount: Integer = get(0).asInstanceOf[Integer] - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] - - override def valuesRow: Row1[Integer] = super.valuesRow.asInstanceOf[ Row1[Integer] ] - override def field1: Field[Integer] = FilmInStock.FILM_IN_STOCK.P_FILM_COUNT - override def component1: Integer = getPFilmCount - override def value1: Integer = getPFilmCount - - override def value1(value: Integer): FilmInStockRecord = { - setPFilmCount(value) - this - } - - override def values(value1 : Integer): FilmInStockRecord = { - this.value1(value1) - this - } - /** * Create a detached, initialised FilmInStockRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala index 953fea0..3843ecb 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmListRecord.scala @@ -9,9 +9,6 @@ import java.lang.Short import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.FilmList import org.jooq.impl.TableRecordImpl @@ -20,7 +17,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class FilmListRecord extends TableRecordImpl[FilmListRecord](FilmList.FILM_LIST) with Record8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] { +class FilmListRecord extends TableRecordImpl[FilmListRecord](FilmList.FILM_LIST) { /** * Setter for public.film_list.fid. @@ -118,90 +115,6 @@ class FilmListRecord extends TableRecordImpl[FilmListRecord](FilmList.FILM_LIST) */ def getActors: String = get(7).asInstanceOf[String] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - - override def valuesRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - override def field1: Field[Long] = FilmList.FILM_LIST.FID - override def field2: Field[String] = FilmList.FILM_LIST.TITLE - override def field3: Field[String] = FilmList.FILM_LIST.DESCRIPTION - override def field4: Field[String] = FilmList.FILM_LIST.CATEGORY - override def field5: Field[BigDecimal] = FilmList.FILM_LIST.PRICE - override def field6: Field[Short] = FilmList.FILM_LIST.LENGTH - override def field7: Field[MpaaRating] = FilmList.FILM_LIST.RATING - override def field8: Field[String] = FilmList.FILM_LIST.ACTORS - override def component1: Long = getFid - override def component2: String = getTitle - override def component3: String = getDescription - override def component4: String = getCategory - override def component5: BigDecimal = getPrice - override def component6: Short = getLength - override def component7: MpaaRating = getRating - override def component8: String = getActors - override def value1: Long = getFid - override def value2: String = getTitle - override def value3: String = getDescription - override def value4: String = getCategory - override def value5: BigDecimal = getPrice - override def value6: Short = getLength - override def value7: MpaaRating = getRating - override def value8: String = getActors - - override def value1(value: Long): FilmListRecord = { - setFid(value) - this - } - - override def value2(value: String): FilmListRecord = { - setTitle(value) - this - } - - override def value3(value: String): FilmListRecord = { - setDescription(value) - this - } - - override def value4(value: String): FilmListRecord = { - setCategory(value) - this - } - - override def value5(value: BigDecimal): FilmListRecord = { - setPrice(value) - this - } - - override def value6(value: Short): FilmListRecord = { - setLength(value) - this - } - - override def value7(value: MpaaRating): FilmListRecord = { - setRating(value) - this - } - - override def value8(value: String): FilmListRecord = { - setActors(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : BigDecimal, value6 : Short, value7 : MpaaRating, value8 : String): FilmListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised FilmListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala index 224b1ae..eab119b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmNotInStockRecord.scala @@ -6,9 +6,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Integer -import org.jooq.Field -import org.jooq.Record1 -import org.jooq.Row1 import org.jooq.demo.skala.db.tables.FilmNotInStock import org.jooq.impl.TableRecordImpl @@ -16,7 +13,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class FilmNotInStockRecord extends TableRecordImpl[FilmNotInStockRecord](FilmNotInStock.FILM_NOT_IN_STOCK) with Record1[Integer] { +class FilmNotInStockRecord extends TableRecordImpl[FilmNotInStockRecord](FilmNotInStock.FILM_NOT_IN_STOCK) { /** * Setter for public.film_not_in_stock.p_film_count. @@ -30,27 +27,6 @@ class FilmNotInStockRecord extends TableRecordImpl[FilmNotInStockRecord](FilmNot */ def getPFilmCount: Integer = get(0).asInstanceOf[Integer] - // ------------------------------------------------------------------------- - // Record1 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row1[Integer] = super.fieldsRow.asInstanceOf[ Row1[Integer] ] - - override def valuesRow: Row1[Integer] = super.valuesRow.asInstanceOf[ Row1[Integer] ] - override def field1: Field[Integer] = FilmNotInStock.FILM_NOT_IN_STOCK.P_FILM_COUNT - override def component1: Integer = getPFilmCount - override def value1: Integer = getPFilmCount - - override def value1(value: Integer): FilmNotInStockRecord = { - setPFilmCount(value) - this - } - - override def values(value1 : Integer): FilmNotInStockRecord = { - this.value1(value1) - this - } - /** * Create a detached, initialised FilmNotInStockRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala index c25a032..b0fa5ef 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/FilmRecord.scala @@ -13,10 +13,7 @@ import java.lang.String import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record14 -import org.jooq.Row14 import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.Film import org.jooq.impl.UpdatableRecordImpl @@ -27,7 +24,7 @@ import scala.Array /** * This class is generated by jOOQ. */ -class FilmRecord extends UpdatableRecordImpl[FilmRecord](Film.FILM) with Record14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] { +class FilmRecord extends UpdatableRecordImpl[FilmRecord](Film.FILM) { /** * Setter for public.film.film_id. @@ -213,180 +210,6 @@ class FilmRecord extends UpdatableRecordImpl[FilmRecord](Film.FILM) with Record1 override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record14 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] = super.fieldsRow.asInstanceOf[ Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] ] - - override def valuesRow: Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] = super.valuesRow.asInstanceOf[ Row14[Long, String, String, Integer, Long, Long, Short, BigDecimal, Short, BigDecimal, MpaaRating, LocalDateTime, Array[String], Object] ] - override def field1: Field[Long] = Film.FILM.FILM_ID - override def field2: Field[String] = Film.FILM.TITLE - override def field3: Field[String] = Film.FILM.DESCRIPTION - override def field4: Field[Integer] = Film.FILM.RELEASE_YEAR - override def field5: Field[Long] = Film.FILM.LANGUAGE_ID - override def field6: Field[Long] = Film.FILM.ORIGINAL_LANGUAGE_ID - override def field7: Field[Short] = Film.FILM.RENTAL_DURATION - override def field8: Field[BigDecimal] = Film.FILM.RENTAL_RATE - override def field9: Field[Short] = Film.FILM.LENGTH - override def field10: Field[BigDecimal] = Film.FILM.REPLACEMENT_COST - override def field11: Field[MpaaRating] = Film.FILM.RATING - override def field12: Field[LocalDateTime] = Film.FILM.LAST_UPDATE - override def field13: Field[Array[String]] = Film.FILM.SPECIAL_FEATURES - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def field14: Field[Object] = Film.FILM.FULLTEXT - override def component1: Long = getFilmId - override def component2: String = getTitle - override def component3: String = getDescription - override def component4: Integer = getReleaseYear - override def component5: Long = getLanguageId - override def component6: Long = getOriginalLanguageId - override def component7: Short = getRentalDuration - override def component8: BigDecimal = getRentalRate - override def component9: Short = getLength - override def component10: BigDecimal = getReplacementCost - override def component11: MpaaRating = getRating - override def component12: LocalDateTime = getLastUpdate - override def component13: Array[String] = getSpecialFeatures - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def component14: Object = getFulltext - override def value1: Long = getFilmId - override def value2: String = getTitle - override def value3: String = getDescription - override def value4: Integer = getReleaseYear - override def value5: Long = getLanguageId - override def value6: Long = getOriginalLanguageId - override def value7: Short = getRentalDuration - override def value8: BigDecimal = getRentalRate - override def value9: Short = getLength - override def value10: BigDecimal = getReplacementCost - override def value11: MpaaRating = getRating - override def value12: LocalDateTime = getLastUpdate - override def value13: Array[String] = getSpecialFeatures - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def value14: Object = getFulltext - - override def value1(value: Long): FilmRecord = { - setFilmId(value) - this - } - - override def value2(value: String): FilmRecord = { - setTitle(value) - this - } - - override def value3(value: String): FilmRecord = { - setDescription(value) - this - } - - override def value4(value: Integer): FilmRecord = { - setReleaseYear(value) - this - } - - override def value5(value: Long): FilmRecord = { - setLanguageId(value) - this - } - - override def value6(value: Long): FilmRecord = { - setOriginalLanguageId(value) - this - } - - override def value7(value: Short): FilmRecord = { - setRentalDuration(value) - this - } - - override def value8(value: BigDecimal): FilmRecord = { - setRentalRate(value) - this - } - - override def value9(value: Short): FilmRecord = { - setLength(value) - this - } - - override def value10(value: BigDecimal): FilmRecord = { - setReplacementCost(value) - this - } - - override def value11(value: MpaaRating): FilmRecord = { - setRating(value) - this - } - - override def value12(value: LocalDateTime): FilmRecord = { - setLastUpdate(value) - this - } - - override def value13(value: Array[String]): FilmRecord = { - setSpecialFeatures(value) - this - } - - - /** - * @deprecated Unknown data type. If this is a qualified, user-defined type, - * it may have been excluded from code generation. If this is a built-in type, - * you can define an explicit {@link org.jooq.Binding} to specify how this - * type should be handled. Deprecation can be turned off using {@literal - * } in your code generator configuration. - */ - @Deprecated - override def value14(value: Object): FilmRecord = { - setFulltext(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : Integer, value5 : Long, value6 : Long, value7 : Short, value8 : BigDecimal, value9 : Short, value10 : BigDecimal, value11 : MpaaRating, value12 : LocalDateTime, value13 : Array[String], value14 : Object): FilmRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this.value12(value12) - this.value13(value13) - this.value14(value14) - this - } - /** * Create a detached, initialised FilmRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala index cdcbe28..72cd016 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/InventoryRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record4 -import org.jooq.Row4 import org.jooq.demo.skala.db.tables.Inventory import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class InventoryRecord extends UpdatableRecordImpl[InventoryRecord](Inventory.INVENTORY) with Record4[Long, Long, Long, LocalDateTime] { +class InventoryRecord extends UpdatableRecordImpl[InventoryRecord](Inventory.INVENTORY) { /** * Setter for public.inventory.inventory_id. @@ -74,54 +71,6 @@ class InventoryRecord extends UpdatableRecordImpl[InventoryRecord](Inventory.INV override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record4 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row4[Long, Long, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] - - override def valuesRow: Row4[Long, Long, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row4[Long, Long, Long, LocalDateTime] ] - override def field1: Field[Long] = Inventory.INVENTORY.INVENTORY_ID - override def field2: Field[Long] = Inventory.INVENTORY.FILM_ID - override def field3: Field[Long] = Inventory.INVENTORY.STORE_ID - override def field4: Field[LocalDateTime] = Inventory.INVENTORY.LAST_UPDATE - override def component1: Long = getInventoryId - override def component2: Long = getFilmId - override def component3: Long = getStoreId - override def component4: LocalDateTime = getLastUpdate - override def value1: Long = getInventoryId - override def value2: Long = getFilmId - override def value3: Long = getStoreId - override def value4: LocalDateTime = getLastUpdate - - override def value1(value: Long): InventoryRecord = { - setInventoryId(value) - this - } - - override def value2(value: Long): InventoryRecord = { - setFilmId(value) - this - } - - override def value3(value: Long): InventoryRecord = { - setStoreId(value) - this - } - - override def value4(value: LocalDateTime): InventoryRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : LocalDateTime): InventoryRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this - } - /** * Create a detached, initialised InventoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala index 0a7a568..b717510 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/LanguageRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.Language import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class LanguageRecord extends UpdatableRecordImpl[LanguageRecord](Language.LANGUAGE) with Record3[Long, String, LocalDateTime] { +class LanguageRecord extends UpdatableRecordImpl[LanguageRecord](Language.LANGUAGE) { /** * Setter for public.language.language_id. @@ -63,45 +60,6 @@ class LanguageRecord extends UpdatableRecordImpl[LanguageRecord](Language.LANGUA override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[Long, String, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - - override def valuesRow: Row3[Long, String, LocalDateTime] = super.valuesRow.asInstanceOf[ Row3[Long, String, LocalDateTime] ] - override def field1: Field[Long] = Language.LANGUAGE.LANGUAGE_ID - override def field2: Field[String] = Language.LANGUAGE.NAME - override def field3: Field[LocalDateTime] = Language.LANGUAGE.LAST_UPDATE - override def component1: Long = getLanguageId - override def component2: String = getName - override def component3: LocalDateTime = getLastUpdate - override def value1: Long = getLanguageId - override def value2: String = getName - override def value3: LocalDateTime = getLastUpdate - - override def value1(value: Long): LanguageRecord = { - setLanguageId(value) - this - } - - override def value2(value: String): LanguageRecord = { - setName(value) - this - } - - override def value3(value: LocalDateTime): LanguageRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : LocalDateTime): LanguageRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised LanguageRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala index 382d050..900d056 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/NicerButSlowerFilmListRecord.scala @@ -9,9 +9,6 @@ import java.lang.Short import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.enums.MpaaRating import org.jooq.demo.skala.db.tables.NicerButSlowerFilmList import org.jooq.impl.TableRecordImpl @@ -20,7 +17,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class NicerButSlowerFilmListRecord extends TableRecordImpl[NicerButSlowerFilmListRecord](NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST) with Record8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] { +class NicerButSlowerFilmListRecord extends TableRecordImpl[NicerButSlowerFilmListRecord](NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST) { /** * Setter for public.nicer_but_slower_film_list.fid. @@ -118,90 +115,6 @@ class NicerButSlowerFilmListRecord extends TableRecordImpl[NicerButSlowerFilmLis */ def getActors: String = get(7).asInstanceOf[String] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - - override def valuesRow: Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, BigDecimal, Short, MpaaRating, String] ] - override def field1: Field[Long] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.FID - override def field2: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.TITLE - override def field3: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.DESCRIPTION - override def field4: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.CATEGORY - override def field5: Field[BigDecimal] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.PRICE - override def field6: Field[Short] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.LENGTH - override def field7: Field[MpaaRating] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.RATING - override def field8: Field[String] = NicerButSlowerFilmList.NICER_BUT_SLOWER_FILM_LIST.ACTORS - override def component1: Long = getFid - override def component2: String = getTitle - override def component3: String = getDescription - override def component4: String = getCategory - override def component5: BigDecimal = getPrice - override def component6: Short = getLength - override def component7: MpaaRating = getRating - override def component8: String = getActors - override def value1: Long = getFid - override def value2: String = getTitle - override def value3: String = getDescription - override def value4: String = getCategory - override def value5: BigDecimal = getPrice - override def value6: Short = getLength - override def value7: MpaaRating = getRating - override def value8: String = getActors - - override def value1(value: Long): NicerButSlowerFilmListRecord = { - setFid(value) - this - } - - override def value2(value: String): NicerButSlowerFilmListRecord = { - setTitle(value) - this - } - - override def value3(value: String): NicerButSlowerFilmListRecord = { - setDescription(value) - this - } - - override def value4(value: String): NicerButSlowerFilmListRecord = { - setCategory(value) - this - } - - override def value5(value: BigDecimal): NicerButSlowerFilmListRecord = { - setPrice(value) - this - } - - override def value6(value: Short): NicerButSlowerFilmListRecord = { - setLength(value) - this - } - - override def value7(value: MpaaRating): NicerButSlowerFilmListRecord = { - setRating(value) - this - } - - override def value8(value: String): NicerButSlowerFilmListRecord = { - setActors(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : BigDecimal, value6 : Short, value7 : MpaaRating, value8 : String): NicerButSlowerFilmListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised NicerButSlowerFilmListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala index 0e5d0a5..c8702dd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_01Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_01 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_01Record extends TableRecordImpl[PaymentP2007_01Record](PaymentP2007_01.PAYMENT_P2007_01) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_01Record extends TableRecordImpl[PaymentP2007_01Record](PaymentP2007_01.PAYMENT_P2007_01) { /** * Setter for public.payment_p2007_01.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_01Record extends TableRecordImpl[PaymentP2007_01Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.STAFF_ID - override def field4: Field[Long] = PaymentP2007_01.PAYMENT_P2007_01.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_01.PAYMENT_P2007_01.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_01.PAYMENT_P2007_01.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_01Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_01Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_01Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_01Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_01Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_01Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_01Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_01Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala index 9c30363..597f53a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_02Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_02 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_02Record extends TableRecordImpl[PaymentP2007_02Record](PaymentP2007_02.PAYMENT_P2007_02) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_02Record extends TableRecordImpl[PaymentP2007_02Record](PaymentP2007_02.PAYMENT_P2007_02) { /** * Setter for public.payment_p2007_02.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_02Record extends TableRecordImpl[PaymentP2007_02Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.STAFF_ID - override def field4: Field[Long] = PaymentP2007_02.PAYMENT_P2007_02.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_02.PAYMENT_P2007_02.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_02.PAYMENT_P2007_02.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_02Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_02Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_02Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_02Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_02Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_02Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_02Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_02Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala index e1f16d3..29be5a1 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_03Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_03 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_03Record extends TableRecordImpl[PaymentP2007_03Record](PaymentP2007_03.PAYMENT_P2007_03) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_03Record extends TableRecordImpl[PaymentP2007_03Record](PaymentP2007_03.PAYMENT_P2007_03) { /** * Setter for public.payment_p2007_03.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_03Record extends TableRecordImpl[PaymentP2007_03Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.STAFF_ID - override def field4: Field[Long] = PaymentP2007_03.PAYMENT_P2007_03.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_03.PAYMENT_P2007_03.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_03.PAYMENT_P2007_03.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_03Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_03Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_03Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_03Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_03Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_03Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_03Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_03Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala index 5f3ae04..17f4407 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_04Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_04 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_04Record extends TableRecordImpl[PaymentP2007_04Record](PaymentP2007_04.PAYMENT_P2007_04) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_04Record extends TableRecordImpl[PaymentP2007_04Record](PaymentP2007_04.PAYMENT_P2007_04) { /** * Setter for public.payment_p2007_04.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_04Record extends TableRecordImpl[PaymentP2007_04Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.STAFF_ID - override def field4: Field[Long] = PaymentP2007_04.PAYMENT_P2007_04.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_04.PAYMENT_P2007_04.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_04.PAYMENT_P2007_04.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_04Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_04Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_04Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_04Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_04Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_04Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_04Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_04Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala index d9231fd..48c35a0 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_05Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_05 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_05Record extends TableRecordImpl[PaymentP2007_05Record](PaymentP2007_05.PAYMENT_P2007_05) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_05Record extends TableRecordImpl[PaymentP2007_05Record](PaymentP2007_05.PAYMENT_P2007_05) { /** * Setter for public.payment_p2007_05.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_05Record extends TableRecordImpl[PaymentP2007_05Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.STAFF_ID - override def field4: Field[Long] = PaymentP2007_05.PAYMENT_P2007_05.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_05.PAYMENT_P2007_05.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_05.PAYMENT_P2007_05.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_05Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_05Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_05Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_05Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_05Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_05Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_05Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_05Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala index 8cfbaff..eec6993 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentP2007_06Record.scala @@ -8,9 +8,6 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.PaymentP2007_06 import org.jooq.impl.TableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentP2007_06Record extends TableRecordImpl[PaymentP2007_06Record](PaymentP2007_06.PAYMENT_P2007_06) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentP2007_06Record extends TableRecordImpl[PaymentP2007_06Record](PaymentP2007_06.PAYMENT_P2007_06) { /** * Setter for public.payment_p2007_06.payment_id. @@ -92,72 +89,6 @@ class PaymentP2007_06Record extends TableRecordImpl[PaymentP2007_06Record](Payme */ def getPaymentDate: LocalDateTime = get(5).asInstanceOf[LocalDateTime] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_ID - override def field2: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.CUSTOMER_ID - override def field3: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.STAFF_ID - override def field4: Field[Long] = PaymentP2007_06.PAYMENT_P2007_06.RENTAL_ID - override def field5: Field[BigDecimal] = PaymentP2007_06.PAYMENT_P2007_06.AMOUNT - override def field6: Field[LocalDateTime] = PaymentP2007_06.PAYMENT_P2007_06.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentP2007_06Record = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentP2007_06Record = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentP2007_06Record = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentP2007_06Record = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentP2007_06Record = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentP2007_06Record = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentP2007_06Record = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentP2007_06Record */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala index 2d40d10..15ee713 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/PaymentRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.math.BigDecimal import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record6 -import org.jooq.Row6 import org.jooq.demo.skala.db.tables.Payment import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class PaymentRecord extends UpdatableRecordImpl[PaymentRecord](Payment.PAYMENT) with Record6[Long, Long, Long, Long, BigDecimal, LocalDateTime] { +class PaymentRecord extends UpdatableRecordImpl[PaymentRecord](Payment.PAYMENT) { /** * Setter for public.payment.payment_id. @@ -99,72 +96,6 @@ class PaymentRecord extends UpdatableRecordImpl[PaymentRecord](Payment.PAYMENT) override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record6 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - - override def valuesRow: Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] = super.valuesRow.asInstanceOf[ Row6[Long, Long, Long, Long, BigDecimal, LocalDateTime] ] - override def field1: Field[Long] = Payment.PAYMENT.PAYMENT_ID - override def field2: Field[Long] = Payment.PAYMENT.CUSTOMER_ID - override def field3: Field[Long] = Payment.PAYMENT.STAFF_ID - override def field4: Field[Long] = Payment.PAYMENT.RENTAL_ID - override def field5: Field[BigDecimal] = Payment.PAYMENT.AMOUNT - override def field6: Field[LocalDateTime] = Payment.PAYMENT.PAYMENT_DATE - override def component1: Long = getPaymentId - override def component2: Long = getCustomerId - override def component3: Long = getStaffId - override def component4: Long = getRentalId - override def component5: BigDecimal = getAmount - override def component6: LocalDateTime = getPaymentDate - override def value1: Long = getPaymentId - override def value2: Long = getCustomerId - override def value3: Long = getStaffId - override def value4: Long = getRentalId - override def value5: BigDecimal = getAmount - override def value6: LocalDateTime = getPaymentDate - - override def value1(value: Long): PaymentRecord = { - setPaymentId(value) - this - } - - override def value2(value: Long): PaymentRecord = { - setCustomerId(value) - this - } - - override def value3(value: Long): PaymentRecord = { - setStaffId(value) - this - } - - override def value4(value: Long): PaymentRecord = { - setRentalId(value) - this - } - - override def value5(value: BigDecimal): PaymentRecord = { - setAmount(value) - this - } - - override def value6(value: LocalDateTime): PaymentRecord = { - setPaymentDate(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : Long, value5 : BigDecimal, value6 : LocalDateTime): PaymentRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this - } - /** * Create a detached, initialised PaymentRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala index 1cef15b..b85916a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/RentalRecord.scala @@ -7,10 +7,7 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record7 -import org.jooq.Row7 import org.jooq.demo.skala.db.tables.Rental import org.jooq.impl.UpdatableRecordImpl @@ -18,7 +15,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class RentalRecord extends UpdatableRecordImpl[RentalRecord](Rental.RENTAL) with Record7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] { +class RentalRecord extends UpdatableRecordImpl[RentalRecord](Rental.RENTAL) { /** * Setter for public.rental.rental_id. @@ -110,81 +107,6 @@ class RentalRecord extends UpdatableRecordImpl[RentalRecord](Rental.RENTAL) with override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record7 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] = super.fieldsRow.asInstanceOf[ Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] ] - - override def valuesRow: Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] = super.valuesRow.asInstanceOf[ Row7[Long, LocalDateTime, Long, Long, LocalDateTime, Long, LocalDateTime] ] - override def field1: Field[Long] = Rental.RENTAL.RENTAL_ID - override def field2: Field[LocalDateTime] = Rental.RENTAL.RENTAL_DATE - override def field3: Field[Long] = Rental.RENTAL.INVENTORY_ID - override def field4: Field[Long] = Rental.RENTAL.CUSTOMER_ID - override def field5: Field[LocalDateTime] = Rental.RENTAL.RETURN_DATE - override def field6: Field[Long] = Rental.RENTAL.STAFF_ID - override def field7: Field[LocalDateTime] = Rental.RENTAL.LAST_UPDATE - override def component1: Long = getRentalId - override def component2: LocalDateTime = getRentalDate - override def component3: Long = getInventoryId - override def component4: Long = getCustomerId - override def component5: LocalDateTime = getReturnDate - override def component6: Long = getStaffId - override def component7: LocalDateTime = getLastUpdate - override def value1: Long = getRentalId - override def value2: LocalDateTime = getRentalDate - override def value3: Long = getInventoryId - override def value4: Long = getCustomerId - override def value5: LocalDateTime = getReturnDate - override def value6: Long = getStaffId - override def value7: LocalDateTime = getLastUpdate - - override def value1(value: Long): RentalRecord = { - setRentalId(value) - this - } - - override def value2(value: LocalDateTime): RentalRecord = { - setRentalDate(value) - this - } - - override def value3(value: Long): RentalRecord = { - setInventoryId(value) - this - } - - override def value4(value: Long): RentalRecord = { - setCustomerId(value) - this - } - - override def value5(value: LocalDateTime): RentalRecord = { - setReturnDate(value) - this - } - - override def value6(value: Long): RentalRecord = { - setStaffId(value) - this - } - - override def value7(value: LocalDateTime): RentalRecord = { - setLastUpdate(value) - this - } - - override def values(value1 : Long, value2 : LocalDateTime, value3 : Long, value4 : Long, value5 : LocalDateTime, value6 : Long, value7 : LocalDateTime): RentalRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this - } - /** * Create a detached, initialised RentalRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala index 98e2adc..b3a1547 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByFilmCategoryRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record2 -import org.jooq.Row2 import org.jooq.demo.skala.db.tables.SalesByFilmCategory import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class SalesByFilmCategoryRecord extends TableRecordImpl[SalesByFilmCategoryRecord](SalesByFilmCategory.SALES_BY_FILM_CATEGORY) with Record2[String, BigDecimal] { +class SalesByFilmCategoryRecord extends TableRecordImpl[SalesByFilmCategoryRecord](SalesByFilmCategory.SALES_BY_FILM_CATEGORY) { /** * Setter for public.sales_by_film_category.category. @@ -43,36 +40,6 @@ class SalesByFilmCategoryRecord extends TableRecordImpl[SalesByFilmCategoryRecor */ def getTotalSales: BigDecimal = get(1).asInstanceOf[BigDecimal] - // ------------------------------------------------------------------------- - // Record2 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row2[String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row2[String, BigDecimal] ] - - override def valuesRow: Row2[String, BigDecimal] = super.valuesRow.asInstanceOf[ Row2[String, BigDecimal] ] - override def field1: Field[String] = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.CATEGORY - override def field2: Field[BigDecimal] = SalesByFilmCategory.SALES_BY_FILM_CATEGORY.TOTAL_SALES - override def component1: String = getCategory - override def component2: BigDecimal = getTotalSales - override def value1: String = getCategory - override def value2: BigDecimal = getTotalSales - - override def value1(value: String): SalesByFilmCategoryRecord = { - setCategory(value) - this - } - - override def value2(value: BigDecimal): SalesByFilmCategoryRecord = { - setTotalSales(value) - this - } - - override def values(value1 : String, value2 : BigDecimal): SalesByFilmCategoryRecord = { - this.value1(value1) - this.value2(value2) - this - } - /** * Create a detached, initialised SalesByFilmCategoryRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala index a0d47b3..0c7019a 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/SalesByStoreRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.String import java.math.BigDecimal -import org.jooq.Field -import org.jooq.Record3 -import org.jooq.Row3 import org.jooq.demo.skala.db.tables.SalesByStore import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class SalesByStoreRecord extends TableRecordImpl[SalesByStoreRecord](SalesByStore.SALES_BY_STORE) with Record3[String, String, BigDecimal] { +class SalesByStoreRecord extends TableRecordImpl[SalesByStoreRecord](SalesByStore.SALES_BY_STORE) { /** * Setter for public.sales_by_store.store. @@ -55,45 +52,6 @@ class SalesByStoreRecord extends TableRecordImpl[SalesByStoreRecord](SalesByStor */ def getTotalSales: BigDecimal = get(2).asInstanceOf[BigDecimal] - // ------------------------------------------------------------------------- - // Record3 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row3[String, String, BigDecimal] = super.fieldsRow.asInstanceOf[ Row3[String, String, BigDecimal] ] - - override def valuesRow: Row3[String, String, BigDecimal] = super.valuesRow.asInstanceOf[ Row3[String, String, BigDecimal] ] - override def field1: Field[String] = SalesByStore.SALES_BY_STORE.STORE - override def field2: Field[String] = SalesByStore.SALES_BY_STORE.MANAGER - override def field3: Field[BigDecimal] = SalesByStore.SALES_BY_STORE.TOTAL_SALES - override def component1: String = getStore - override def component2: String = getManager - override def component3: BigDecimal = getTotalSales - override def value1: String = getStore - override def value2: String = getManager - override def value3: BigDecimal = getTotalSales - - override def value1(value: String): SalesByStoreRecord = { - setStore(value) - this - } - - override def value2(value: String): SalesByStoreRecord = { - setManager(value) - this - } - - override def value3(value: BigDecimal): SalesByStoreRecord = { - setTotalSales(value) - this - } - - override def values(value1 : String, value2 : String, value3 : BigDecimal): SalesByStoreRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this - } - /** * Create a detached, initialised SalesByStoreRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala index 526bc20..16546a9 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffListRecord.scala @@ -7,9 +7,6 @@ package org.jooq.demo.skala.db.tables.records import java.lang.Long import java.lang.String -import org.jooq.Field -import org.jooq.Record8 -import org.jooq.Row8 import org.jooq.demo.skala.db.tables.StaffList import org.jooq.impl.TableRecordImpl @@ -17,7 +14,7 @@ import org.jooq.impl.TableRecordImpl /** * This class is generated by jOOQ. */ -class StaffListRecord extends TableRecordImpl[StaffListRecord](StaffList.STAFF_LIST) with Record8[Long, String, String, String, String, String, String, Long] { +class StaffListRecord extends TableRecordImpl[StaffListRecord](StaffList.STAFF_LIST) { /** * Setter for public.staff_list.id. @@ -115,90 +112,6 @@ class StaffListRecord extends TableRecordImpl[StaffListRecord](StaffList.STAFF_L */ def getSid: Long = get(7).asInstanceOf[Long] - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row8[Long, String, String, String, String, String, String, Long] = super.fieldsRow.asInstanceOf[ Row8[Long, String, String, String, String, String, String, Long] ] - - override def valuesRow: Row8[Long, String, String, String, String, String, String, Long] = super.valuesRow.asInstanceOf[ Row8[Long, String, String, String, String, String, String, Long] ] - override def field1: Field[Long] = StaffList.STAFF_LIST.ID - override def field2: Field[String] = StaffList.STAFF_LIST.NAME - override def field3: Field[String] = StaffList.STAFF_LIST.ADDRESS - override def field4: Field[String] = StaffList.STAFF_LIST.ZIP_CODE - override def field5: Field[String] = StaffList.STAFF_LIST.PHONE - override def field6: Field[String] = StaffList.STAFF_LIST.CITY - override def field7: Field[String] = StaffList.STAFF_LIST.COUNTRY - override def field8: Field[Long] = StaffList.STAFF_LIST.SID - override def component1: Long = getId - override def component2: String = getName - override def component3: String = getAddress - override def component4: String = getZipCode - override def component5: String = getPhone - override def component6: String = getCity - override def component7: String = getCountry - override def component8: Long = getSid - override def value1: Long = getId - override def value2: String = getName - override def value3: String = getAddress - override def value4: String = getZipCode - override def value5: String = getPhone - override def value6: String = getCity - override def value7: String = getCountry - override def value8: Long = getSid - - override def value1(value: Long): StaffListRecord = { - setId(value) - this - } - - override def value2(value: String): StaffListRecord = { - setName(value) - this - } - - override def value3(value: String): StaffListRecord = { - setAddress(value) - this - } - - override def value4(value: String): StaffListRecord = { - setZipCode(value) - this - } - - override def value5(value: String): StaffListRecord = { - setPhone(value) - this - } - - override def value6(value: String): StaffListRecord = { - setCity(value) - this - } - - override def value7(value: String): StaffListRecord = { - setCountry(value) - this - } - - override def value8(value: Long): StaffListRecord = { - setSid(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : String, value5 : String, value6 : String, value7 : String, value8 : Long): StaffListRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this - } - /** * Create a detached, initialised StaffListRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala index 8850b4d..7a4d2ae 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StaffRecord.scala @@ -9,10 +9,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record13 -import org.jooq.Row13 import org.jooq.demo.skala.db.tables.Staff import org.jooq.impl.UpdatableRecordImpl @@ -23,7 +20,7 @@ import scala.Byte /** * This class is generated by jOOQ. */ -class StaffRecord extends UpdatableRecordImpl[StaffRecord](Staff.STAFF) with Record13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] { +class StaffRecord extends UpdatableRecordImpl[StaffRecord](Staff.STAFF) { /** * Setter for public.staff.staff_id. @@ -187,135 +184,6 @@ class StaffRecord extends UpdatableRecordImpl[StaffRecord](Staff.STAFF) with Rec override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record13 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] = super.fieldsRow.asInstanceOf[ Row13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] ] - - override def valuesRow: Row13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] = super.valuesRow.asInstanceOf[ Row13[Long, String, String, Long, String, Long, Boolean, String, String, LocalDateTime, Array[Byte], String, String] ] - override def field1: Field[Long] = Staff.STAFF.STAFF_ID - override def field2: Field[String] = Staff.STAFF.FIRST_NAME - override def field3: Field[String] = Staff.STAFF.LAST_NAME - override def field4: Field[Long] = Staff.STAFF.ADDRESS_ID - override def field5: Field[String] = Staff.STAFF.EMAIL - override def field6: Field[Long] = Staff.STAFF.STORE_ID - override def field7: Field[Boolean] = Staff.STAFF.ACTIVE - override def field8: Field[String] = Staff.STAFF.USERNAME - override def field9: Field[String] = Staff.STAFF.PASSWORD - override def field10: Field[LocalDateTime] = Staff.STAFF.LAST_UPDATE - override def field11: Field[Array[Byte]] = Staff.STAFF.PICTURE - override def field12: Field[String] = Staff.STAFF.FULL_ADDRESS - override def field13: Field[String] = Staff.STAFF.FULL_NAME - override def component1: Long = getStaffId - override def component2: String = getFirstName - override def component3: String = getLastName - override def component4: Long = getAddressId - override def component5: String = getEmail - override def component6: Long = getStoreId - override def component7: Boolean = getActive - override def component8: String = getUsername - override def component9: String = getPassword - override def component10: LocalDateTime = getLastUpdate - override def component11: Array[Byte] = getPicture - override def component12: String = getFullAddress - override def component13: String = getFullName - override def value1: Long = getStaffId - override def value2: String = getFirstName - override def value3: String = getLastName - override def value4: Long = getAddressId - override def value5: String = getEmail - override def value6: Long = getStoreId - override def value7: Boolean = getActive - override def value8: String = getUsername - override def value9: String = getPassword - override def value10: LocalDateTime = getLastUpdate - override def value11: Array[Byte] = getPicture - override def value12: String = getFullAddress - override def value13: String = getFullName - - override def value1(value: Long): StaffRecord = { - setStaffId(value) - this - } - - override def value2(value: String): StaffRecord = { - setFirstName(value) - this - } - - override def value3(value: String): StaffRecord = { - setLastName(value) - this - } - - override def value4(value: Long): StaffRecord = { - setAddressId(value) - this - } - - override def value5(value: String): StaffRecord = { - setEmail(value) - this - } - - override def value6(value: Long): StaffRecord = { - setStoreId(value) - this - } - - override def value7(value: Boolean): StaffRecord = { - setActive(value) - this - } - - override def value8(value: String): StaffRecord = { - setUsername(value) - this - } - - override def value9(value: String): StaffRecord = { - setPassword(value) - this - } - - override def value10(value: LocalDateTime): StaffRecord = { - setLastUpdate(value) - this - } - - override def value11(value: Array[Byte]): StaffRecord = { - setPicture(value) - this - } - - override def value12(value: String): StaffRecord = { - setFullAddress(value) - this - } - - override def value13(value: String): StaffRecord = { - setFullName(value) - this - } - - override def values(value1 : Long, value2 : String, value3 : String, value4 : Long, value5 : String, value6 : Long, value7 : Boolean, value8 : String, value9 : String, value10 : LocalDateTime, value11 : Array[Byte], value12 : String, value13 : String): StaffRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this.value6(value6) - this.value7(value7) - this.value8(value8) - this.value9(value9) - this.value10(value10) - this.value11(value11) - this.value12(value12) - this.value13(value13) - this - } - /** * Create a detached, initialised StaffRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala index c124d43..bbcbebd 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/main/scala/org/jooq/demo/skala/db/tables/records/StoreRecord.scala @@ -8,10 +8,7 @@ import java.lang.Long import java.lang.String import java.time.LocalDateTime -import org.jooq.Field import org.jooq.Record1 -import org.jooq.Record5 -import org.jooq.Row5 import org.jooq.demo.skala.db.tables.Store import org.jooq.impl.UpdatableRecordImpl @@ -19,7 +16,7 @@ import org.jooq.impl.UpdatableRecordImpl /** * This class is generated by jOOQ. */ -class StoreRecord extends UpdatableRecordImpl[StoreRecord](Store.STORE) with Record5[Long, Long, Long, LocalDateTime, String] { +class StoreRecord extends UpdatableRecordImpl[StoreRecord](Store.STORE) { /** * Setter for public.store.store_id. @@ -87,63 +84,6 @@ class StoreRecord extends UpdatableRecordImpl[StoreRecord](Store.STORE) with Rec override def key: Record1[Long] = super.key.asInstanceOf[ Record1[Long] ] - // ------------------------------------------------------------------------- - // Record5 type implementation - // ------------------------------------------------------------------------- - - override def fieldsRow: Row5[Long, Long, Long, LocalDateTime, String] = super.fieldsRow.asInstanceOf[ Row5[Long, Long, Long, LocalDateTime, String] ] - - override def valuesRow: Row5[Long, Long, Long, LocalDateTime, String] = super.valuesRow.asInstanceOf[ Row5[Long, Long, Long, LocalDateTime, String] ] - override def field1: Field[Long] = Store.STORE.STORE_ID - override def field2: Field[Long] = Store.STORE.MANAGER_STAFF_ID - override def field3: Field[Long] = Store.STORE.ADDRESS_ID - override def field4: Field[LocalDateTime] = Store.STORE.LAST_UPDATE - override def field5: Field[String] = Store.STORE.FULL_ADDRESS - override def component1: Long = getStoreId - override def component2: Long = getManagerStaffId - override def component3: Long = getAddressId - override def component4: LocalDateTime = getLastUpdate - override def component5: String = getFullAddress - override def value1: Long = getStoreId - override def value2: Long = getManagerStaffId - override def value3: Long = getAddressId - override def value4: LocalDateTime = getLastUpdate - override def value5: String = getFullAddress - - override def value1(value: Long): StoreRecord = { - setStoreId(value) - this - } - - override def value2(value: Long): StoreRecord = { - setManagerStaffId(value) - this - } - - override def value3(value: Long): StoreRecord = { - setAddressId(value) - this - } - - override def value4(value: LocalDateTime): StoreRecord = { - setLastUpdate(value) - this - } - - override def value5(value: String): StoreRecord = { - setFullAddress(value) - this - } - - override def values(value1 : Long, value2 : Long, value3 : Long, value4 : LocalDateTime, value5 : String): StoreRecord = { - this.value1(value1) - this.value2(value2) - this.value3(value3) - this.value4(value4) - this.value5(value5) - this - } - /** * Create a detached, initialised StoreRecord */ diff --git a/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala b/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala index 3f4ce5f..8212699 100644 --- a/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala +++ b/jOOQ-demo-pro/jOOQ-demo-scala/src/test/scala/org/jooq/demo/skala/Demo14Mocking.scala @@ -27,7 +27,10 @@ class Demo14Mocking extends AbstractDemo { // A MockDataProvider is a database simulation that can intercept all database calls at the JDBC level val p: MockDataProvider = c => Array[MockResult]( if (c.sql.contains("select")) - new MockResult(ctx.newRecord(ACTOR).values(1L, "A", "A", null)) + new MockResult(ctx.newRecord(ACTOR) + .`with`(ACTOR.ACTOR_ID, java.lang.Long.valueOf(1L)) + .`with`(ACTOR.FIRST_NAME, "A") + .`with`(ACTOR.LAST_NAME, "A")) else new MockResult(0) ) diff --git a/jOOQ-demo-pro/jOOQ-demo-utils/pom.xml b/jOOQ-demo-pro/jOOQ-demo-utils/pom.xml index d44a86f..3e9585b 100644 --- a/jOOQ-demo-pro/jOOQ-demo-utils/pom.xml +++ b/jOOQ-demo-pro/jOOQ-demo-utils/pom.xml @@ -6,7 +6,7 @@ org.jooq.trial jooq-demo - 3.18.7 + 3.19.1 jooq-demo-utils diff --git a/jOOQ-demo-pro/pom.xml b/jOOQ-demo-pro/pom.xml index 9c8e201..34ba094 100644 --- a/jOOQ-demo-pro/pom.xml +++ b/jOOQ-demo-pro/pom.xml @@ -5,7 +5,7 @@ org.jooq.trial jooq-demo - 3.18.7 + 3.19.1 jOOQ Demo (Trial Edition) pom @@ -20,7 +20,7 @@ UTF-8 - 3.18.7 + 3.19.1 8.5.11 42.4.3 2.17.1