From 8d110ef11700961e49b9e938cede7f201ff483af Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Tue, 15 Nov 2022 15:18:37 +0100 Subject: [PATCH] [jOOQ/jOOQ#13640] Added QOM.JoinTable etc --- .../main/java/org/jooq/impl/CrossApply.java | 78 ++++++++++++++++++ .../main/java/org/jooq/impl/CrossJoin.java | 78 ++++++++++++++++++ .../src/main/java/org/jooq/impl/FullJoin.java | 79 ++++++++++++++++++ jOOQ/src/main/java/org/jooq/impl/Join.java | 78 ++++++++++++++++++ .../main/java/org/jooq/impl/LeftAntiJoin.java | 78 ++++++++++++++++++ .../src/main/java/org/jooq/impl/LeftJoin.java | 79 ++++++++++++++++++ .../main/java/org/jooq/impl/LeftSemiJoin.java | 78 ++++++++++++++++++ .../java/org/jooq/impl/NaturalFullJoin.java | 81 +++++++++++++++++++ .../main/java/org/jooq/impl/NaturalJoin.java | 78 ++++++++++++++++++ .../java/org/jooq/impl/NaturalLeftJoin.java | 81 +++++++++++++++++++ .../java/org/jooq/impl/NaturalRightJoin.java | 81 +++++++++++++++++++ .../main/java/org/jooq/impl/OuterApply.java | 78 ++++++++++++++++++ .../main/java/org/jooq/impl/RightJoin.java | 79 ++++++++++++++++++ .../main/java/org/jooq/impl/StraightJoin.java | 78 ++++++++++++++++++ 14 files changed, 1104 insertions(+) create mode 100644 jOOQ/src/main/java/org/jooq/impl/CrossApply.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/CrossJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/FullJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/Join.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/LeftAntiJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/LeftJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/LeftSemiJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/NaturalFullJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/NaturalJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/NaturalLeftJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/NaturalRightJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/OuterApply.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/RightJoin.java create mode 100644 jOOQ/src/main/java/org/jooq/impl/StraightJoin.java diff --git a/jOOQ/src/main/java/org/jooq/impl/CrossApply.java b/jOOQ/src/main/java/org/jooq/impl/CrossApply.java new file mode 100644 index 0000000000..3663b5e6e3 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/CrossApply.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class CrossApply +extends + JoinTable +implements + QOM.CrossApply +{ + + CrossApply(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.CROSS_APPLY); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + CrossApply construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return new CrossApply(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/CrossJoin.java b/jOOQ/src/main/java/org/jooq/impl/CrossJoin.java new file mode 100644 index 0000000000..950f017c1e --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/CrossJoin.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class CrossJoin +extends + JoinTable +implements + QOM.CrossJoin +{ + + CrossJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.CROSS_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + CrossJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return new CrossJoin(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/FullJoin.java b/jOOQ/src/main/java/org/jooq/impl/FullJoin.java new file mode 100644 index 0000000000..605b400faf --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/FullJoin.java @@ -0,0 +1,79 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class FullJoin +extends + JoinTable +implements + QOM.FullJoin +{ + + FullJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.FULL_OUTER_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + FullJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + // [#6116] [#11687] TODO: Partition by clauses + return o != null ? new FullJoin(table1, table2).on(o) : new FullJoin(table1, table2).using(u); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/Join.java b/jOOQ/src/main/java/org/jooq/impl/Join.java new file mode 100644 index 0000000000..2f2fab8cca --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/Join.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class Join +extends + JoinTable +implements + QOM.Join +{ + + Join(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + Join construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return o != null ? new Join(table1, table2).on(o) : new Join(table1, table2).using(u); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/LeftAntiJoin.java b/jOOQ/src/main/java/org/jooq/impl/LeftAntiJoin.java new file mode 100644 index 0000000000..653419a081 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/LeftAntiJoin.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class LeftAntiJoin +extends + JoinTable +implements + QOM.LeftAntiJoin +{ + + LeftAntiJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.LEFT_ANTI_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + LeftAntiJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return o != null ? new LeftAntiJoin(table1, table2).on(o) : new LeftAntiJoin(table1, table2).using(u); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/LeftJoin.java b/jOOQ/src/main/java/org/jooq/impl/LeftJoin.java new file mode 100644 index 0000000000..904e22b71d --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/LeftJoin.java @@ -0,0 +1,79 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class LeftJoin +extends + JoinTable +implements + QOM.LeftJoin +{ + + LeftJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.LEFT_OUTER_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + LeftJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + // [#6116] [#11687] TODO: Partition by clauses + return o != null ? new LeftJoin(table1, table2).on(o) : new LeftJoin(table1, table2).using(u); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/LeftSemiJoin.java b/jOOQ/src/main/java/org/jooq/impl/LeftSemiJoin.java new file mode 100644 index 0000000000..5c4e272e17 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/LeftSemiJoin.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class LeftSemiJoin +extends + JoinTable +implements + QOM.LeftSemiJoin +{ + + LeftSemiJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.LEFT_SEMI_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + LeftSemiJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return o != null ? new LeftSemiJoin(table1, table2).on(o) : new LeftSemiJoin(table1, table2).using(u); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/NaturalFullJoin.java b/jOOQ/src/main/java/org/jooq/impl/NaturalFullJoin.java new file mode 100644 index 0000000000..16c90e3295 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/NaturalFullJoin.java @@ -0,0 +1,81 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static java.util.Collections.emptyList; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class NaturalFullJoin +extends + JoinTable +implements + QOM.NaturalFullJoin +{ + + NaturalFullJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.NATURAL_FULL_OUTER_JOIN, emptyList()); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + NaturalFullJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + // [#6116] [#11687] TODO: Partition by clauses + return new NaturalFullJoin(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/NaturalJoin.java b/jOOQ/src/main/java/org/jooq/impl/NaturalJoin.java new file mode 100644 index 0000000000..b0b8282fbc --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/NaturalJoin.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class NaturalJoin +extends + JoinTable +implements + QOM.NaturalJoin +{ + + NaturalJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.NATURAL_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + NaturalJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return new NaturalJoin(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/NaturalLeftJoin.java b/jOOQ/src/main/java/org/jooq/impl/NaturalLeftJoin.java new file mode 100644 index 0000000000..cc49b94b4d --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/NaturalLeftJoin.java @@ -0,0 +1,81 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static java.util.Collections.emptyList; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class NaturalLeftJoin +extends + JoinTable +implements + QOM.NaturalLeftJoin +{ + + NaturalLeftJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.NATURAL_LEFT_OUTER_JOIN, emptyList()); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + NaturalLeftJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + // [#6116] [#11687] TODO: Partition by clauses + return new NaturalLeftJoin(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/NaturalRightJoin.java b/jOOQ/src/main/java/org/jooq/impl/NaturalRightJoin.java new file mode 100644 index 0000000000..7344296425 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/NaturalRightJoin.java @@ -0,0 +1,81 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static java.util.Collections.emptyList; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class NaturalRightJoin +extends + JoinTable +implements + QOM.NaturalRightJoin +{ + + NaturalRightJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.NATURAL_RIGHT_OUTER_JOIN, emptyList()); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + NaturalRightJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + // [#6116] [#11687] TODO: Partition by clauses + return new NaturalRightJoin(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/OuterApply.java b/jOOQ/src/main/java/org/jooq/impl/OuterApply.java new file mode 100644 index 0000000000..7fb3db0f35 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/OuterApply.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class OuterApply +extends + JoinTable +implements + QOM.OuterApply +{ + + OuterApply(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.OUTER_APPLY); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + OuterApply construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return new OuterApply(table1, table2); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/RightJoin.java b/jOOQ/src/main/java/org/jooq/impl/RightJoin.java new file mode 100644 index 0000000000..13129bf7cb --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/RightJoin.java @@ -0,0 +1,79 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class RightJoin +extends + JoinTable +implements + QOM.RightJoin +{ + + RightJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.RIGHT_OUTER_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + RightJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + // [#6116] [#11687] TODO: Partition by clauses + return o != null ? new RightJoin(table1, table2).on(o) : new RightJoin(table1, table2).using(u); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/StraightJoin.java b/jOOQ/src/main/java/org/jooq/impl/StraightJoin.java new file mode 100644 index 0000000000..3a91165763 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/StraightJoin.java @@ -0,0 +1,78 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import java.util.Collection; + +import org.jooq.Condition; +import org.jooq.Field; +import org.jooq.JoinType; +import org.jooq.Record; +import org.jooq.Table; +import org.jooq.TableLike; + +/** + * @author Lukas Eder + */ +final class StraightJoin +extends + JoinTable +implements + QOM.StraightJoin +{ + + StraightJoin(TableLike lhs, TableLike rhs) { + super(lhs, rhs, JoinType.STRAIGHT_JOIN); + } + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + StraightJoin construct( + Table table1, + Collection> partitionBy1, + Collection> partitionBy2, + Table table2, + Condition o, + Collection> u + ) { + return o != null ? new StraightJoin(table1, table2).on(o) : new StraightJoin(table1, table2).using(u); + } +}