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 extends Condition> 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 super Long, ? super String, ? super String, ? super LocalDateTime, ? extends U> 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 super Long, ? super String, ? super String, ? super LocalDateTime, ? extends U> 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 extends Condition> 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 super Long, ? super String, ? super String, ? super String, ? extends U> 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 super Long, ? super String, ? super String, ? super String, ? extends U> 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 extends Condition> 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 super Long, ? super String, ? super String, ? super String, ? super Long, ? super String, ? super String, ? super LocalDateTime, ? extends U> 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 super Long, ? super String, ? super String, ? super String, ? super Long, ? super String, ? super String, ? super LocalDateTime, ? extends U> 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 extends 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(Function3 super Long, ? super String, ? super LocalDateTime, ? extends U> 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 super Long, ? super String, ? super LocalDateTime, ? extends U> 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 extends Condition> 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 super Long, ? super String, ? super Long, ? super LocalDateTime, ? extends U> 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 super Long, ? super String, ? super Long, ? super LocalDateTime, ? extends U> 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 extends 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(Function3 super Long, ? super String, ? super LocalDateTime, ? extends U> 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 super Long, ? super String, ? super LocalDateTime, ? extends U> 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 extends 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(Function10 super Long, ? super Long, ? super String, ? super String, ? super String, ? super Long, ? super Boolean, ? super LocalDate, ? super LocalDateTime, ? super Integer, ? extends U> 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 super Long, ? super Long, ? super String, ? super String, ? super String, ? super Long, ? super Boolean, ? super LocalDate, ? super LocalDateTime, ? super Integer, ? extends U> 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 extends Condition> 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 super Long, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super Long, ? extends U> 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 super Long, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super String, ? super Long, ? extends U> 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 extends Condition> 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 super Long, ? super String, ? super String, ? super Integer, ? super Long, ? super Long, ? super Short, ? super BigDecimal, ? super Short, ? super BigDecimal, ? super MpaaRating, ? super LocalDateTime, ? super String[], ? super Object, ? extends U> 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 super Long, ? super String, ? super String, ? super Integer, ? super Long, ? super Long, ? super Short, ? super BigDecimal, ? super Short, ? super BigDecimal, ? super MpaaRating, ? super LocalDateTime, ? super String[], ? super Object, ? extends U> 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 extends Condition> 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 super Long, ? super Long, ? super LocalDateTime, ? extends U> 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 super Long, ? super Long, ? super LocalDateTime, ? extends U> 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