[#4676] Add SelectFromStep.from(Name) and similar convenience methods

This commit is contained in:
lukaseder 2015-10-18 17:16:57 +02:00
parent 2e0b9d4588
commit 433129e614
8 changed files with 498 additions and 5 deletions

View File

@ -50,7 +50,6 @@ import static org.jooq.impl.DSL.max;
import static org.jooq.impl.DSL.name;
import static org.jooq.impl.DSL.select;
import static org.jooq.impl.DSL.selectOne;
import static org.jooq.impl.DSL.table;
import static org.jooq.impl.DSL.upper;
import static org.jooq.impl.DSL.val;
import static org.jooq.util.postgres.PostgresDSL.arrayAppend;
@ -499,7 +498,7 @@ public class PostgresDatabase extends AbstractDatabase {
.when(c.CONSRC.isNull(), src)
.otherwise(arrayAppend(src, c.CONSRC))
)
.from(table(name("domains")))
.from(name("domains"))
.join(d)
.on(field(name("domains", d.TYPBASETYPE.getName())).eq(oid(d)))
.leftJoin(c)
@ -514,7 +513,7 @@ public class PostgresDatabase extends AbstractDatabase {
b.TYPLEN,
src)
.from(d)
.join(table(name("domains")))
.join(name("domains"))
.on(field(name("domains", "typbasetype")).eq(0))
.and(field(name("domains", "domain_id")).eq(oid(d)))
.join(b)

View File

@ -166,6 +166,14 @@ public interface SelectFromStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> from(String sql, QueryPart... parts);
/**
* Add a <code>FROM</code> clause to the query.
*
* @see DSL#table(Name)
*/
@Support
SelectJoinStep<R> from(Name name);
/**
* Add an Oracle-style hint to the preceding select clause.
* <p>

View File

@ -213,6 +213,21 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectOnStep<R> join(String sql, QueryPart... parts);
/**
* Convenience method to <code>INNER JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using
* {@link Table#join(Name)}.
* <p>
* A synonym for {@link #innerJoin(Name)}.
*
* @see DSL#table(Name)
* @see Table#join(Name)
* @see #innerJoin(Name)
*/
@Support
@PlainSQL
SelectOnStep<R> join(Name name);
/**
* Convenience method to <code>INNER JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using {@link Table#join(TableLike)}.
@ -292,6 +307,17 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectOnStep<R> innerJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>INNER JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using
* {@link Table#join(Name)}.
*
* @see DSL#table(Name)
* @see Table#innerJoin(Name)
*/
@Support
SelectOnStep<R> innerJoin(Name name);
/**
* Convenience method to <code>CROSS JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using
@ -409,6 +435,24 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> crossJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>CROSS JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using
* {@link Table#crossJoin(Name)}
* <p>
* If this syntax is unavailable, it is emulated with a regular
* <code>INNER JOIN</code>. The following two constructs are equivalent:
* <code><pre>
* A cross join B
* A join B on 1 = 1
* </pre></code>
*
* @see DSL#table(Name)
* @see Table#crossJoin(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
SelectJoinStep<R> crossJoin(Name name);
/**
* Convenience method to <code>LEFT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
@ -506,6 +550,20 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinPartitionByStep<R> leftJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>LEFT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
* {@link Table#leftOuterJoin(Name)}.
* <p>
* A synonym for {@link #leftOuterJoin(Name)}.
*
* @see DSL#table(Name)
* @see Table#leftOuterJoin(Name)
* @see #leftOuterJoin(Name)
*/
@Support
SelectJoinPartitionByStep<R> leftJoin(Name name);
/**
* Convenience method to <code>LEFT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
@ -588,6 +646,17 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinPartitionByStep<R> leftOuterJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>LEFT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
* {@link Table#leftOuterJoin(Name)}
*
* @see DSL#table(Name)
* @see Table#leftOuterJoin(Name)
*/
@Support
SelectJoinPartitionByStep<R> leftOuterJoin(Name name);
/**
* Convenience method to <code>RIGHT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
@ -695,6 +764,22 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinPartitionByStep<R> rightJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>RIGHT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
* {@link Table#rightOuterJoin(Name)}.
* <p>
* A synonym for {@link #rightOuterJoin(Name)}.
* <p>
* This is only possible where the underlying RDBMS supports it
*
* @see DSL#table(Name)
* @see Table#rightOuterJoin(Name)
* @see #rightOuterJoin(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
SelectJoinPartitionByStep<R> rightJoin(Name name);
/**
* Convenience method to <code>RIGHT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
@ -787,6 +872,19 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinPartitionByStep<R> rightOuterJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>RIGHT OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
* {@link Table#rightOuterJoin(Name)}
* <p>
* This is only possible where the underlying RDBMS supports it
*
* @see DSL#table(Name)
* @see Table#rightOuterJoin(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
SelectJoinPartitionByStep<R> rightOuterJoin(Name name);
/**
* Convenience method to <code>FULL OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
@ -879,6 +977,19 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectOnStep<R> fullOuterJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>FULL OUTER JOIN</code> a tableto the last
* table added to the <code>FROM</code> clause using
* {@link Table#fullOuterJoin(Name)}
* <p>
* This is only possible where the underlying RDBMS supports it
*
* @see DSL#table(Name)
* @see Table#fullOuterJoin(Name)
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
SelectOnStep<R> fullOuterJoin(Name name);
/**
* Convenience method to <code>NATURAL JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using
@ -976,6 +1087,20 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> naturalJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>NATURAL JOIN</code> a table to the last table
* added to the <code>FROM</code> clause using
* {@link Table#naturalJoin(Name)}
* <p>
* Natural joins are supported by most RDBMS. If they aren't supported, they
* are emulated if jOOQ has enough information.
*
* @see DSL#table(Name)
* @see Table#naturalJoin(Name)
*/
@Support
SelectJoinStep<R> naturalJoin(Name name);
/**
* Convenience method to <code>NATURAL LEFT OUTER JOIN</code> a table to the
* last table added to the <code>FROM</code> clause using
@ -1073,6 +1198,20 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> naturalLeftOuterJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>NATURAL LEFT OUTER JOIN</code> a table to the
* last table added to the <code>FROM</code> clause using
* {@link Table#naturalLeftOuterJoin(Name)}
* <p>
* Natural joins are supported by most RDBMS. If they aren't supported, they
* are emulated if jOOQ has enough information.
*
* @see DSL#table(Name)
* @see Table#naturalLeftOuterJoin(Name)
*/
@Support
SelectJoinStep<R> naturalLeftOuterJoin(Name name);
/**
* Convenience method to <code>NATURAL RIGHT OUTER JOIN</code> a table to
* the last table added to the <code>FROM</code> clause using
@ -1170,6 +1309,20 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> naturalRightOuterJoin(String sql, QueryPart... parts);
/**
* Convenience method to <code>NATURAL RIGHT OUTER JOIN</code> a table to
* the last table added to the <code>FROM</code> clause using
* {@link Table#naturalRightOuterJoin(Name)}
* <p>
* Natural joins are supported by most RDBMS. If they aren't supported, they
* are emulated if jOOQ has enough information.
*
* @see DSL#table(Name)
* @see Table#naturalRightOuterJoin(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
SelectJoinStep<R> naturalRightOuterJoin(Name name);
// -------------------------------------------------------------------------
// XXX: SEMI and ANTI JOIN
// -------------------------------------------------------------------------
@ -1296,6 +1449,15 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> crossApply(String sql, QueryPart... parts);
/**
* <code>CROSS APPLY</code> a table to this table.
*
* @see DSL#table(Name)
* @see Table#crossApply(Name)
*/
@Support({ POSTGRES_9_3 })
SelectJoinStep<R> crossApply(Name name);
/**
* <code>OUTER APPLY</code> a table to this table.
*
@ -1368,6 +1530,15 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@PlainSQL
SelectJoinStep<R> outerApply(String sql, QueryPart... parts);
/**
* <code>OUTER APPLY</code> a table to this table.
*
* @see DSL#table(Name)
* @see Table#outerApply(Name)
*/
@Support({ POSTGRES_9_3 })
SelectJoinStep<R> outerApply(Name name);
/**
* <code>STRAIGHT_JOIN</code> a table to this table.
*
@ -1403,4 +1574,13 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
*/
@Support({ MYSQL })
SelectOnStep<R> straightJoin(String sql, QueryPart... parts);
/**
* <code>STRAIGHT_JOIN</code> a table to this table.
*
* @see DSL#table(Name)
* @see Table#straightJoin(Name)
*/
@Support({ MYSQL })
SelectOnStep<R> straightJoin(Name name);
}

View File

@ -431,6 +431,18 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TableOnStep<Record> join(String sql, QueryPart... parts);
/**
* <code>INNER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #innerJoin(Name)}.
*
* @see DSL#table(Name)
* @see #innerJoin(Name)
*/
@Support
@PlainSQL
TableOnStep<Record> join(Name name);
/**
* <code>INNER JOIN</code> a table to this table.
*/
@ -497,6 +509,14 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TableOnStep<Record> innerJoin(String sql, QueryPart... parts);
/**
* <code>INNER JOIN</code> a table to this table.
*
* @see DSL#table(Name)
*/
@Support
TableOnStep<Record> innerJoin(Name name);
/**
* <code>LEFT OUTER JOIN</code> a table to this table.
* <p>
@ -579,6 +599,17 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TablePartitionByStep<Record> leftJoin(String sql, QueryPart... parts);
/**
* <code>LEFT OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #leftOuterJoin(Name)}.
*
* @see DSL#table(Name)
* @see #leftOuterJoin(Name)
*/
@Support
TablePartitionByStep<Record> leftJoin(Name name);
/**
* <code>LEFT OUTER JOIN</code> a table to this table.
*/
@ -645,6 +676,15 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TablePartitionByStep<Record> leftOuterJoin(String sql, QueryPart... parts);
/**
* <code>LEFT OUTER JOIN</code> a table to this table.
*
* @see DSL#table(Name)
* @see SQL
*/
@Support
TablePartitionByStep<Record> leftOuterJoin(Name name);
/**
* <code>RIGHT OUTER JOIN</code> a table to this table.
* <p>
@ -737,6 +777,19 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TablePartitionByStep<Record> rightJoin(String sql, QueryPart... parts);
/**
* <code>RIGHT OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #rightOuterJoin(Name)}.
* <p>
* This is only possible where the underlying RDBMS supports it
*
* @see DSL#table(Name)
* @see #rightOuterJoin(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
TablePartitionByStep<Record> rightJoin(Name name);
/**
* <code>RIGHT OUTER JOIN</code> a table to this table.
* <p>
@ -813,6 +866,16 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TablePartitionByStep<Record> rightOuterJoin(String sql, QueryPart... parts);
/**
* <code>RIGHT OUTER JOIN</code> a table to this table.
* <p>
* This is only possible where the underlying RDBMS supports it
*
* @see DSL#table(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
TablePartitionByStep<Record> rightOuterJoin(Name name);
/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
@ -889,6 +952,16 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TableOnStep<Record> fullOuterJoin(String sql, QueryPart... parts);
/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* This is only possible where the underlying RDBMS supports it
*
* @see DSL#table(Name)
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
TableOnStep<Record> fullOuterJoin(Name name);
/**
* <code>CROSS JOIN</code> a table to this table.
* <p>
@ -990,6 +1063,21 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
Table<Record> crossJoin(String sql, QueryPart... parts);
/**
* <code>CROSS JOIN</code> a table to this table.
* <p>
* If this syntax is unavailable, it is emulated with a regular
* <code>INNER JOIN</code>. The following two constructs are equivalent:
* <code><pre>
* A cross join B
* A join B on 1 = 1
* </pre></code>
*
* @see DSL#table(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
Table<Record> crossJoin(Name name);
/**
* <code>NATURAL JOIN</code> a table to this table.
* <p>
@ -1053,6 +1141,17 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
Table<Record> naturalJoin(String sql, Object... bindings);
/**
* <code>NATURAL JOIN</code> a table to this table.
* <p>
* If this is not supported by your RDBMS, then jOOQ will try to emulate
* this behaviour using the information provided in this query.
*
* @see DSL#table(Name)
*/
@Support
Table<Record> naturalJoin(Name name);
/**
* <code>NATURAL JOIN</code> a table to this table.
* <p>
@ -1152,6 +1251,18 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
Table<Record> naturalLeftOuterJoin(String sql, QueryPart... parts);
/**
* <code>NATURAL LEFT OUTER JOIN</code> a table to this table.
* <p>
* If this is not supported by your RDBMS, then jOOQ will try to emulate
* this behaviour using the information provided in this query.
*
* @see DSL#table(Name)
*/
@Support
@PlainSQL
Table<Record> naturalLeftOuterJoin(Name name);
/**
* <code>NATURAL RIGHT OUTER JOIN</code> a table to this table.
* <p>
@ -1233,6 +1344,17 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
Table<Record> naturalRightOuterJoin(String sql, QueryPart... parts);
/**
* <code>NATURAL RIGHT OUTER JOIN</code> a table to this table.
* <p>
* If this is not supported by your RDBMS, then jOOQ will try to emulate
* this behaviour using the information provided in this query.
*
* @see DSL#table(Name)
*/
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
Table<Record> naturalRightOuterJoin(Name name);
// -------------------------------------------------------------------------
// XXX: APPLY clauses on tables
// -------------------------------------------------------------------------
@ -1303,6 +1425,14 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
Table<Record> crossApply(String sql, QueryPart... parts);
/**
* <code>CROSS APPLY</code> a table to this table.
*
* @see DSL#table(Name)
*/
@Support({ POSTGRES_9_3 })
Table<Record> crossApply(Name name);
/**
* <code>OUTER APPLY</code> a table to this table.
*/
@ -1369,6 +1499,14 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
Table<Record> outerApply(String sql, QueryPart... parts);
/**
* <code>OUTER APPLY</code> a table to this table.
*
* @see DSL#table(Name)
*/
@Support({ POSTGRES_9_3 })
Table<Record> outerApply(Name name);
/**
* <code>STRAIGHT_JOIN</code> a table to this table.
*/
@ -1435,6 +1573,15 @@ public interface Table<R extends Record> extends TableLike<R> {
@PlainSQL
TableOnStep<Record> straightJoin(String sql, QueryPart... parts);
/**
* <code>STRAIGHT_JOIN</code> a table to this table.
*
* @see DSL#table(Name)
*/
@Support({ MYSQL })
@PlainSQL
TableOnStep<Record> straightJoin(Name name);
// -------------------------------------------------------------------------
// XXX: Exotic and vendor-specific clauses on tables
// -------------------------------------------------------------------------

View File

@ -144,4 +144,12 @@ public interface UpdateFromStep<R extends Record> extends UpdateWhereStep<R> {
@Support({ POSTGRES })
@PlainSQL
UpdateWhereStep<R> from(String sql, QueryPart... parts);
/**
* Add a <code>FROM</code> clause to the query.
*
* @see DSL#table(Name)
*/
@Support({ POSTGRES })
UpdateWhereStep<R> from(Name name);
}

View File

@ -708,6 +708,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return innerJoin(sql, parts);
}
@Override
public final TableOnStep<Record> join(Name name) {
return innerJoin(table(name));
}
@Override
public final TableOnStep<Record> innerJoin(TableLike<?> table) {
return join(table, JOIN);
@ -733,6 +738,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return innerJoin(table(sql, parts));
}
@Override
public final TableOnStep<Record> innerJoin(Name name) {
return innerJoin(table(name));
}
@Override
public final TablePartitionByStep<Record> leftJoin(TableLike<?> table) {
return leftOuterJoin(table);
@ -758,6 +768,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return leftOuterJoin(sql, parts);
}
@Override
public final TablePartitionByStep<Record> leftJoin(Name name) {
return leftOuterJoin(table(name));
}
@Override
public final TablePartitionByStep<Record> leftOuterJoin(TableLike<?> table) {
return join(table, LEFT_OUTER_JOIN);
@ -783,6 +798,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return leftOuterJoin(table(sql, parts));
}
@Override
public final TablePartitionByStep<Record> leftOuterJoin(Name name) {
return leftOuterJoin(table(name));
}
@Override
public final TablePartitionByStep<Record> rightJoin(TableLike<?> table) {
return rightOuterJoin(table);
@ -808,6 +828,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return rightOuterJoin(sql, parts);
}
@Override
public final TablePartitionByStep<Record> rightJoin(Name name) {
return rightOuterJoin(table(name));
}
@Override
public final TablePartitionByStep<Record> rightOuterJoin(TableLike<?> table) {
return join(table, RIGHT_OUTER_JOIN);
@ -833,6 +858,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return rightOuterJoin(table(sql, parts));
}
@Override
public final TablePartitionByStep<Record> rightOuterJoin(Name name) {
return rightOuterJoin(table(name));
}
@Override
public final TableOnStep<Record> fullOuterJoin(TableLike<?> table) {
return join(table, FULL_OUTER_JOIN);
@ -858,6 +888,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return fullOuterJoin(table(sql, parts));
}
@Override
public final TableOnStep<Record> fullOuterJoin(Name name) {
return fullOuterJoin(table(name));
}
@Override
public final Table<Record> crossJoin(TableLike<?> table) {
return join(table, CROSS_JOIN);
@ -883,6 +918,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return crossJoin(table(sql, parts));
}
@Override
public final Table<Record> crossJoin(Name name) {
return crossJoin(table(name));
}
@Override
public final Table<Record> naturalJoin(TableLike<?> table) {
return join(table, NATURAL_JOIN);
@ -908,6 +948,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return naturalJoin(table(sql, parts));
}
@Override
public final Table<Record> naturalJoin(Name name) {
return naturalJoin(table(name));
}
@Override
public final Table<Record> naturalLeftOuterJoin(TableLike<?> table) {
return join(table, NATURAL_LEFT_OUTER_JOIN);
@ -933,6 +978,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return naturalLeftOuterJoin(table(sql, parts));
}
@Override
public final Table<Record> naturalLeftOuterJoin(Name name) {
return naturalLeftOuterJoin(table(name));
}
@Override
public final Table<Record> naturalRightOuterJoin(TableLike<?> table) {
return join(table, NATURAL_RIGHT_OUTER_JOIN);
@ -958,6 +1008,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return naturalRightOuterJoin(table(sql, parts));
}
@Override
public final Table<Record> naturalRightOuterJoin(Name name) {
return naturalRightOuterJoin(table(name));
}
@Override
public final Table<Record> crossApply(TableLike<?> table) {
return join(table, CROSS_APPLY);
@ -983,6 +1038,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return crossApply(table(sql, parts));
}
@Override
public final Table<Record> crossApply(Name name) {
return crossApply(table(name));
}
@Override
public final Table<Record> outerApply(TableLike<?> table) {
return join(table, OUTER_APPLY);
@ -1008,6 +1068,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return outerApply(table(sql, parts));
}
@Override
public final Table<Record> outerApply(Name name) {
return outerApply(table(name));
}
@Override
public final TableOptionalOnStep<Record> straightJoin(TableLike<?> table) {
return join(table, STRAIGHT_JOIN);
@ -1033,6 +1098,11 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
return straightJoin(table(sql, parts));
}
@Override
public final TableOptionalOnStep<Record> straightJoin(Name name) {
return straightJoin(table(name));
}
// ------------------------------------------------------------------------
// XXX: Object API
// ------------------------------------------------------------------------

View File

@ -327,6 +327,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return from(table(sql, parts));
}
@Override
public final SelectJoinStep<R> from(Name name) {
return from(table(name));
}
@Override
public final SelectImpl where(Condition... conditions) {
conditionStep = ConditionStep.WHERE;
@ -2149,7 +2154,7 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
}
@Override
public final SelectOnStep<R> fullOuterJoin(TableLike<?> table) {
public final SelectImpl fullOuterJoin(TableLike<?> table) {
return join(table, JoinType.FULL_OUTER_JOIN);
}
@ -2183,7 +2188,7 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
}
@Override
public final SelectJoinStep<R> crossJoin(TableLike<?> table) {
public final SelectImpl crossJoin(TableLike<?> table) {
return join(table, JoinType.CROSS_JOIN);
}
@ -2247,6 +2252,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return innerJoin(sql, parts);
}
@Override
public final SelectImpl join(Name name) {
return innerJoin(table(name));
}
@Override
public final SelectImpl innerJoin(SQL sql) {
return innerJoin(table(sql));
@ -2267,6 +2277,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return innerJoin(table(sql, parts));
}
@Override
public final SelectImpl innerJoin(Name name) {
return innerJoin(table(name));
}
@Override
public final SelectImpl leftJoin(SQL sql) {
return leftOuterJoin(sql);
@ -2287,6 +2302,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return leftOuterJoin(sql, parts);
}
@Override
public final SelectImpl leftJoin(Name name) {
return leftOuterJoin(table(name));
}
@Override
public final SelectImpl leftOuterJoin(SQL sql) {
return leftOuterJoin(table(sql));
@ -2307,6 +2327,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return leftOuterJoin(table(sql, parts));
}
@Override
public final SelectImpl leftOuterJoin(Name name) {
return leftOuterJoin(table(name));
}
@Override
public final SelectImpl rightJoin(SQL sql) {
return rightOuterJoin(sql);
@ -2327,6 +2352,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return rightOuterJoin(sql, parts);
}
@Override
public final SelectImpl rightJoin(Name name) {
return rightOuterJoin(table(name));
}
@Override
public final SelectImpl rightOuterJoin(SQL sql) {
return rightOuterJoin(table(sql));
@ -2347,6 +2377,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return rightOuterJoin(table(sql, parts));
}
@Override
public final SelectImpl rightOuterJoin(Name name) {
return rightOuterJoin(table(name));
}
@Override
public final SelectOnStep<R> fullOuterJoin(SQL sql) {
return fullOuterJoin(table(sql));
@ -2367,6 +2402,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return fullOuterJoin(table(sql, parts));
}
@Override
public final SelectImpl fullOuterJoin(Name name) {
return fullOuterJoin(table(name));
}
@Override
public final SelectJoinStep<R> crossJoin(SQL sql) {
return crossJoin(table(sql));
@ -2387,6 +2427,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return crossJoin(table(sql, parts));
}
@Override
public final SelectImpl crossJoin(Name name) {
return crossJoin(table(name));
}
@Override
public final SelectImpl naturalJoin(SQL sql) {
return naturalJoin(table(sql));
@ -2407,6 +2452,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return naturalJoin(table(sql, parts));
}
@Override
public final SelectImpl naturalJoin(Name name) {
return naturalJoin(table(name));
}
@Override
public final SelectImpl naturalLeftOuterJoin(SQL sql) {
return naturalLeftOuterJoin(table(sql));
@ -2427,6 +2477,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return naturalLeftOuterJoin(table(sql, parts));
}
@Override
public final SelectImpl naturalLeftOuterJoin(Name name) {
return naturalLeftOuterJoin(table(name));
}
@Override
public final SelectImpl naturalRightOuterJoin(SQL sql) {
return naturalRightOuterJoin(table(sql));
@ -2447,6 +2502,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return naturalRightOuterJoin(table(sql, parts));
}
@Override
public final SelectImpl naturalRightOuterJoin(Name name) {
return naturalRightOuterJoin(table(name));
}
@Override
public final SelectImpl crossApply(SQL sql) {
return crossApply(table(sql));
@ -2467,6 +2527,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return crossApply(table(sql, parts));
}
@Override
public final SelectImpl crossApply(Name name) {
return crossApply(table(name));
}
@Override
public final SelectImpl outerApply(SQL sql) {
return outerApply(table(sql));
@ -2487,6 +2552,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return outerApply(table(sql, parts));
}
@Override
public final SelectImpl outerApply(Name name) {
return outerApply(table(name));
}
/* [pro] xx
xxxxxxxxx
@ -2512,6 +2582,11 @@ class SelectImpl<R extends Record, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11,
return straightJoin(table(sql, parts));
}
@Override
public final SelectImpl straightJoin(Name name) {
return straightJoin(table(name));
}
@Override
public final ResultQuery<R> maxRows(int rows) {
return getDelegate().maxRows(rows);

View File

@ -54,6 +54,7 @@ import javax.annotation.Generated;
import org.jooq.Condition;
import org.jooq.Configuration;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.Operator;
import org.jooq.QueryPart;
import org.jooq.Record;
@ -531,6 +532,11 @@ final class UpdateImpl<R extends Record>
return from(table(sql, parts));
}
@Override
public final UpdateWhereStep<R> from(Name name) {
return from(table(name));
}
@Override
public final UpdateImpl<R> where(Condition... conditions) {
getDelegate().addConditions(conditions);