[#6094] Support Oracle's PARTITION BY prefixed OUTER JOIN

This commit is contained in:
lukaseder 2017-04-21 12:09:14 +02:00
parent cc77a2746d
commit ad6e0975dc
2 changed files with 18 additions and 3 deletions

View File

@ -69,6 +69,15 @@ import org.jooq.impl.DSL;
*/
public interface TableOuterJoinStep<R extends Record> {
/**
* Join a table to this table using a {@link JoinType}.
* <p>
* Only {@link JoinType#LEFT_OUTER_JOIN}, {@link JoinType#RIGHT_OUTER_JOIN},
* and {@link JoinType#FULL_OUTER_JOIN} are allowed.
*/
@Support
TableOnStep<Record> join(TableLike<?> table, JoinType type);
/**
* <code>LEFT OUTER JOIN</code> a table to this table.
* <p>

View File

@ -42,6 +42,7 @@ import static org.jooq.impl.DSL.table;
import java.util.Collection;
import org.jooq.Field;
import org.jooq.JoinType;
import org.jooq.Name;
import org.jooq.QueryPart;
import org.jooq.Record;
@ -64,6 +65,11 @@ final class PartitionJoinTable implements TableOuterJoinStep<Record> {
this.lhsPartitionBy = lhsPartitionBy;
}
@Override
public final TableOnStep<Record> join(TableLike<?> table, JoinType type) {
return new JoinTable(lhs, table, type, lhsPartitionBy);
}
@Override
public final TableOnStep<Record> leftJoin(TableLike<?> table) {
return leftOuterJoin(table);
@ -96,7 +102,7 @@ final class PartitionJoinTable implements TableOuterJoinStep<Record> {
@Override
public final TableOnStep<Record> leftOuterJoin(TableLike<?> table) {
return new JoinTable(lhs, table, LEFT_OUTER_JOIN, lhsPartitionBy);
return join(table, LEFT_OUTER_JOIN);
}
@Override
@ -156,7 +162,7 @@ final class PartitionJoinTable implements TableOuterJoinStep<Record> {
@Override
public final TableOnStep<Record> rightOuterJoin(TableLike<?> table) {
return new JoinTable(lhs, table, RIGHT_OUTER_JOIN, lhsPartitionBy);
return join(table, RIGHT_OUTER_JOIN);
}
@Override
@ -216,7 +222,7 @@ final class PartitionJoinTable implements TableOuterJoinStep<Record> {
@Override
public final TableOnStep<Record> fullOuterJoin(TableLike<?> table) {
return new JoinTable(lhs, table, FULL_OUTER_JOIN, lhsPartitionBy);
return join(table, FULL_OUTER_JOIN);
}
@Override