Skip to content

Commit

Permalink
[#5924] Add the Table.fullJoin() and SelectJoinStep.fullJoin() aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Mar 12, 2017
1 parent 66edc06 commit 190ec66
Show file tree
Hide file tree
Showing 4 changed files with 220 additions and 4 deletions.
84 changes: 84 additions & 0 deletions jOOQ/src/main/java/org/jooq/SelectJoinStep.java
Expand Up @@ -894,6 +894,90 @@ public interface SelectJoinStep<R extends Record> extends SelectWhereStep<R> {
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
SelectJoinPartitionByStep<R> rightOuterJoin(Name name); 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
* {@link Table#fullOuterJoin(TableLike)}.
* <p>
* A synonym for {@link #fullOuterJoin(TableLike)}.
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
SelectOnStep<R> fullJoin(TableLike<?> table);

/**
* Convenience method to <code>FULL OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
* {@link Table#fullOuterJoin(String)}.
* <p>
* A synonym for {@link #fullOuterJoin(SQL)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
SelectOnStep<R> fullJoin(SQL sql);

/**
* Convenience method to <code>FULL OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using
* {@link Table#fullOuterJoin(String)}.
* <p>
* A synonym for {@link #fullOuterJoin(String)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
SelectOnStep<R> fullJoin(String sql);

/**
* Convenience method to <code>FULL OUTER JOIN</code> a tableto the last
* table added to the <code>FROM</code> clause using
* {@link Table#fullOuterJoin(String, Object...)}.
* <p>
* A synonym for {@link #fullOuterJoin(String, Object...)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
SelectOnStep<R> fullJoin(String sql, Object... bindings);

/**
* Convenience method to <code>FULL OUTER JOIN</code> a tableto the last
* table added to the <code>FROM</code> clause using
* {@link Table#fullOuterJoin(String, QueryPart...)}.
* <p>
* A synonym for {@link #fullOuterJoin(String, QueryPart...)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
SelectOnStep<R> fullJoin(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>
* A synonym for {@link #fullOuterJoin(Name)}.
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
SelectOnStep<R> fullJoin(Name name);

/** /**
* Convenience method to <code>FULL OUTER JOIN</code> a table to the last * Convenience method to <code>FULL OUTER JOIN</code> a table to the last
* table added to the <code>FROM</code> clause using * table added to the <code>FROM</code> clause using
Expand Down
72 changes: 72 additions & 0 deletions jOOQ/src/main/java/org/jooq/Table.java
Expand Up @@ -1000,6 +1000,78 @@ public interface Table<R extends Record> extends TableLike<R> {
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES }) @Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
TablePartitionByStep<Record> rightOuterJoin(Name name); TablePartitionByStep<Record> rightOuterJoin(Name name);


/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #fullOuterJoin(TableLike)}.
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
TableOnStep<Record> fullJoin(TableLike<?> table);

/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #fullOuterJoin(SQL)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
TableOnStep<Record> fullJoin(SQL sql);

/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #fullOuterJoin(String)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
TableOnStep<Record> fullJoin(String sql);

/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #fullOuterJoin(String, Object...)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
TableOnStep<Record> fullJoin(String sql, Object... bindings);

/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #fullOuterJoin(String, QueryPart...)}.
* <p>
* <b>NOTE</b>: When inserting plain SQL into jOOQ objects, you must
* guarantee syntax integrity. You may also create the possibility of
* malicious SQL injection. Be sure to properly use bind variables and/or
* escape literals when concatenated into SQL clauses!
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
@PlainSQL
TableOnStep<Record> fullJoin(String sql, QueryPart... parts);

/**
* <code>FULL OUTER JOIN</code> a table to this table.
* <p>
* A synonym for {@link #fullOuterJoin(Name)}.
*/
@Support({ FIREBIRD, HSQLDB, POSTGRES })
TableOnStep<Record> fullJoin(Name name);

/** /**
* <code>FULL OUTER JOIN</code> a table to this table. * <code>FULL OUTER JOIN</code> a table to this table.
* <p> * <p>
Expand Down
30 changes: 30 additions & 0 deletions jOOQ/src/main/java/org/jooq/impl/AbstractTable.java
Expand Up @@ -1001,6 +1001,36 @@ public final TableOnStep<Record> fullOuterJoin(Name name) {
return fullOuterJoin(table(name)); return fullOuterJoin(table(name));
} }


@Override
public final TableOnStep<Record> fullJoin(TableLike<?> table) {
return fullOuterJoin(table);
}

@Override
public final TableOnStep<Record> fullJoin(SQL sql) {
return fullOuterJoin(sql);
}

@Override
public final TableOnStep<Record> fullJoin(String sql) {
return fullOuterJoin(sql);
}

@Override
public final TableOnStep<Record> fullJoin(String sql, Object... bindings) {
return fullOuterJoin(sql, bindings);
}

@Override
public final TableOnStep<Record> fullJoin(String sql, QueryPart... parts) {
return fullOuterJoin(sql, parts);
}

@Override
public final TableOnStep<Record> fullJoin(Name name) {
return fullOuterJoin(name);
}

@Override @Override
public final Table<Record> crossJoin(TableLike<?> table) { public final Table<Record> crossJoin(TableLike<?> table) {
return join(table, CROSS_JOIN); return join(table, CROSS_JOIN);
Expand Down
38 changes: 34 additions & 4 deletions jOOQ/src/main/java/org/jooq/impl/SelectImpl.java
Expand Up @@ -2193,6 +2193,11 @@ public final SelectImpl rightOuterJoin(TableLike<?> table) {
return join(table, JoinType.RIGHT_OUTER_JOIN); return join(table, JoinType.RIGHT_OUTER_JOIN);
} }


@Override
public final SelectOnStep<R> fullJoin(TableLike<?> table) {
return fullOuterJoin(table);
}

@Override @Override
public final SelectImpl fullOuterJoin(TableLike<?> table) { public final SelectImpl fullOuterJoin(TableLike<?> table) {
return join(table, JoinType.FULL_OUTER_JOIN); return join(table, JoinType.FULL_OUTER_JOIN);
Expand Down Expand Up @@ -2423,22 +2428,47 @@ public final SelectImpl rightOuterJoin(Name name) {
} }


@Override @Override
public final SelectOnStep<R> fullOuterJoin(SQL sql) { public final SelectImpl fullJoin(SQL sql) {
return fullOuterJoin(sql);
}

@Override
public final SelectImpl fullJoin(String sql) {
return fullOuterJoin(sql);
}

@Override
public final SelectImpl fullJoin(String sql, Object... bindings) {
return fullOuterJoin(sql, bindings);
}

@Override
public final SelectImpl fullJoin(String sql, QueryPart... parts) {
return fullOuterJoin(sql, parts);
}

@Override
public final SelectImpl fullJoin(Name name) {
return fullOuterJoin(name);
}

@Override
public final SelectImpl fullOuterJoin(SQL sql) {
return fullOuterJoin(table(sql)); return fullOuterJoin(table(sql));
} }


@Override @Override
public final SelectOnStep<R> fullOuterJoin(String sql) { public final SelectImpl fullOuterJoin(String sql) {
return fullOuterJoin(table(sql)); return fullOuterJoin(table(sql));
} }


@Override @Override
public final SelectOnStep<R> fullOuterJoin(String sql, Object... bindings) { public final SelectImpl fullOuterJoin(String sql, Object... bindings) {
return fullOuterJoin(table(sql, bindings)); return fullOuterJoin(table(sql, bindings));
} }


@Override @Override
public final SelectOnStep<R> fullOuterJoin(String sql, QueryPart... parts) { public final SelectImpl fullOuterJoin(String sql, QueryPart... parts) {
return fullOuterJoin(table(sql, parts)); return fullOuterJoin(table(sql, parts));
} }


Expand Down

0 comments on commit 190ec66

Please sign in to comment.