diff --git a/jOOQ/src/main/java/org/jooq/impl/And.java b/jOOQ/src/main/java/org/jooq/impl/And.java index f8a8c627ce..a770ea4a01 100644 --- a/jOOQ/src/main/java/org/jooq/impl/And.java +++ b/jOOQ/src/main/java/org/jooq/impl/And.java @@ -120,28 +120,6 @@ implements } } - /** - * @deprecated - This will be implemented using QOM.replace, instead. - */ - @Deprecated - final Condition transform(java.util.function.Function function) { - Condition t1 = arg1 instanceof And - ? ((And) arg1).transform(function) - : arg1 instanceof Or - ? ((And) arg1).transform(function) - : function.apply(arg1); - Condition t2 = arg2 instanceof And - ? ((And) arg2).transform(function) - : arg2 instanceof Or - ? ((Or) arg2).transform(function) - : function.apply(arg2); - - if (t1 == arg1 && t2 == arg2) - return this; - else - return DSL.and(t1, t2); - } - @Override final boolean isNullable() { return ((AbstractCondition) arg1).isNullable() || ((AbstractCondition) arg2).isNullable(); diff --git a/jOOQ/src/main/java/org/jooq/impl/Or.java b/jOOQ/src/main/java/org/jooq/impl/Or.java index 7e6b644c9b..f237584762 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Or.java +++ b/jOOQ/src/main/java/org/jooq/impl/Or.java @@ -120,28 +120,6 @@ implements } } - /** - * @deprecated - This will be implemented using QOM.replace, instead. - */ - @Deprecated - final Condition transform(java.util.function.Function function) { - Condition t1 = arg1 instanceof And - ? ((And) arg1).transform(function) - : arg1 instanceof Or - ? ((And) arg1).transform(function) - : function.apply(arg1); - Condition t2 = arg2 instanceof And - ? ((And) arg2).transform(function) - : arg2 instanceof Or - ? ((Or) arg2).transform(function) - : function.apply(arg2); - - if (t1 == arg1 && t2 == arg2) - return this; - else - return DSL.or(t1, t2); - } - @Override final boolean isNullable() { return ((AbstractCondition) arg1).isNullable() || ((AbstractCondition) arg2).isNullable(); diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java index 51caca256d..ec46ad904a 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java @@ -1223,6 +1223,13 @@ final class SelectQueryImpl extends AbstractResultQuery imp + + + + + + + @@ -2946,6 +2953,8 @@ final class SelectQueryImpl extends AbstractResultQuery imp + + diff --git a/jOOQ/src/main/java/org/jooq/impl/Transform.java b/jOOQ/src/main/java/org/jooq/impl/Transform.java deleted file mode 100644 index c97da36c82..0000000000 --- a/jOOQ/src/main/java/org/jooq/impl/Transform.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 - * - * http://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: http://www.jooq.org/licenses - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - */ -package org.jooq.impl; - -import java.util.function.Function; - -import org.jooq.Condition; -import org.jooq.Field; -import org.jooq.QueryPart; -import org.jooq.impl.QOM.CombinedCondition; -import org.jooq.impl.QOM.CompareCondition; - -/** - * A simple, preliminary pattern matching implementation for {@link Condition} - * matching. - *

- * [#8800] Has been implemented to support transforming ANSI join to pre-ANSI - * join syntax. For outer join support, the {@link Condition} model needs to be - * transformed to yield {@link Field#plus()} expressions where applicable. - *

- * A future jOOQ version will refactor this implementation in favour of much - * more generic (and efficient) pattern matching of the {@link QueryPart} - * expression tree. - * - * @author Lukas Eder - */ -final class Transform { - - final Function, Field> fieldTransformer; - - Transform(Function, Field> fieldTransformer) { - this.fieldTransformer = fieldTransformer; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - Condition transform(Condition condition) { - if (condition instanceof ConditionProviderImpl) - return transform(((ConditionProviderImpl) condition).getWhere()); - else if (condition instanceof CombinedCondition) - return transform((Condition) ((CombinedCondition) condition).$arg1()).and(transform((Condition) ((CombinedCondition) condition).$arg2())); - else if (condition instanceof CompareCondition) - return fieldTransformer.apply((Field) ((CompareCondition) condition).$arg1()).eq((Field) fieldTransformer.apply((Field) ((CompareCondition) condition).$arg2())); - else - return condition; - } -}