diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractField.java b/jOOQ/src/main/java/org/jooq/impl/AbstractField.java index 49e6754974..0b4c138566 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractField.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractField.java @@ -524,7 +524,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { return falseCondition(); } else { - return new InCondition(this, nullSafe(values), InOperator.IN); + return new InCondition(this, nullSafe(values), SubqueryOperator.IN); } } @@ -541,7 +541,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition in(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.IN); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.IN); } @Override @@ -556,7 +556,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition notIn(Field... values) { - return new InCondition(this, nullSafe(values), InOperator.NOT_IN); + return new InCondition(this, nullSafe(values), SubqueryOperator.NOT_IN); } @Override @@ -572,8 +572,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition notIn(Select> query) { - return new SelectQueryAsSubQueryCondition( - query, this, SubQueryOperator.NOT_IN); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.NOT_IN); } @Override @@ -798,7 +797,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition equal(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.EQUALS); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.EQUALS); } @Override @@ -828,7 +827,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition notEqual(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.NOT_EQUALS); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.NOT_EQUALS); } @Override @@ -848,7 +847,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition lessThan(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.LESS); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.LESS); } @Override @@ -868,7 +867,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition lessOrEqual(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.LESS_OR_EQUAL); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.LESS_OR_EQUAL); } @Override @@ -888,7 +887,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition greaterThan(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.GREATER); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.GREATER); } @Override @@ -908,7 +907,7 @@ abstract class AbstractField extends AbstractQueryPart implements Field { @Override public final Condition greaterOrEqual(Select> query) { - return new SelectQueryAsSubQueryCondition(query, this, SubQueryOperator.GREATER_OR_EQUAL); + return new SelectQueryAsSubQueryCondition(query, this, SubqueryOperator.GREATER_OR_EQUAL); } @Override diff --git a/jOOQ/src/main/java/org/jooq/impl/InCondition.java b/jOOQ/src/main/java/org/jooq/impl/InCondition.java index eb543bdd64..7fe248b968 100644 --- a/jOOQ/src/main/java/org/jooq/impl/InCondition.java +++ b/jOOQ/src/main/java/org/jooq/impl/InCondition.java @@ -48,14 +48,14 @@ import org.jooq.RenderContext; */ class InCondition extends AbstractCondition { - private static final long serialVersionUID = -1653924248576930761L; - private static final int IN_LIMIT = 1000; + private static final long serialVersionUID = -1653924248576930761L; + private static final int IN_LIMIT = 1000; - private final Field field; - private final Field[] values; - private final InOperator operator; + private final Field field; + private final Field[] values; + private final SubqueryOperator operator; - InCondition(Field field, Field[] values, InOperator operator) { + InCondition(Field field, Field[] values, SubqueryOperator operator) { this.field = field; this.values = values; this.operator = operator; @@ -87,7 +87,7 @@ class InCondition extends AbstractCondition { // [#1515] The connector depends on the IN / NOT IN // operator - if (operator == InOperator.IN) { + if (operator == SubqueryOperator.IN) { context.formatSeparator() .keyword("or "); } diff --git a/jOOQ/src/main/java/org/jooq/impl/InOperator.java b/jOOQ/src/main/java/org/jooq/impl/InOperator.java deleted file mode 100644 index 147924449c..0000000000 --- a/jOOQ/src/main/java/org/jooq/impl/InOperator.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2009-2012, Lukas Eder, lukas.eder@gmail.com - * All rights reserved. - * - * This software is licensed to you under the Apache License, Version 2.0 - * (the "License"); You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * . Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * . Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * . Neither the name "jOOQ" nor the names of its contributors may be - * used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ -package org.jooq.impl; - -/** - * A comparator to be used in in conditions - * - * @author Lukas Eder - */ -enum InOperator { - - /** - * IN - */ - IN("in"), - - /** - * NOT IN - */ - NOT_IN("not in"); - - private final String sql; - - private InOperator(String sql) { - this.sql = sql; - } - - public String toSQL() { - return sql; - } -} diff --git a/jOOQ/src/main/java/org/jooq/impl/RowImpl.java b/jOOQ/src/main/java/org/jooq/impl/RowImpl.java index 882af43f38..f5c4832650 100644 --- a/jOOQ/src/main/java/org/jooq/impl/RowImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/RowImpl.java @@ -52,7 +52,7 @@ import static org.jooq.SQLDialect.SQLITE; import static org.jooq.SQLDialect.SQLSERVER; import static org.jooq.SQLDialect.SYBASE; import static org.jooq.impl.Factory.row; -import static org.jooq.impl.InOperator.NOT_IN; +import static org.jooq.impl.SubqueryOperator.NOT_IN; import java.util.ArrayList; import java.util.Arrays; @@ -846,20 +846,20 @@ implements @Override public final Condition in(Collection rows) { QueryPartList> list = new QueryPartList>(rows); - return new InRows(list, InOperator.IN); + return new InRows(list, SubqueryOperator.IN); } @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public final Condition notIn(Collection rows) { QueryPartList> list = new QueryPartList>(rows); - return new InRows(list, InOperator.NOT_IN); + return new InRows(list, SubqueryOperator.NOT_IN); } @SuppressWarnings("rawtypes") @Override public final Condition equal(Select select) { - return new Subquery(select, SubQueryOperator.EQUALS); + return new Subquery(select, SubqueryOperator.EQUALS); } @SuppressWarnings("rawtypes") @@ -871,7 +871,7 @@ implements @SuppressWarnings("rawtypes") @Override public final Condition notEqual(Select select) { - return new Subquery(select, SubQueryOperator.NOT_EQUALS); + return new Subquery(select, SubqueryOperator.NOT_EQUALS); } @SuppressWarnings("rawtypes") @@ -883,13 +883,13 @@ implements @SuppressWarnings("rawtypes") @Override public final Condition in(Select select) { - return new Subquery(select, SubQueryOperator.IN); + return new Subquery(select, SubqueryOperator.IN); } @SuppressWarnings("rawtypes") @Override public final Condition notIn(Select select) { - return new Subquery(select, SubQueryOperator.NOT_IN); + return new Subquery(select, SubqueryOperator.NOT_IN); } // ------------------------------------------------------------------------ @@ -1099,9 +1099,9 @@ implements private static final long serialVersionUID = -1806139685201770706L; private final QueryPartList> other; - private final InOperator operator; + private final SubqueryOperator operator; - InRows(QueryPartList> other, InOperator operator) { + InRows(QueryPartList> other, SubqueryOperator operator) { this.other = other; this.operator = operator; } @@ -1169,9 +1169,9 @@ implements private static final long serialVersionUID = -1806139685201770706L; private final Select other; - private final SubQueryOperator operator; + private final SubqueryOperator operator; - Subquery(Select other, SubQueryOperator operator) { + Subquery(Select other, SubqueryOperator operator) { this.other = other; this.operator = operator; } diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectQueryAsSubQueryCondition.java b/jOOQ/src/main/java/org/jooq/impl/SelectQueryAsSubQueryCondition.java index 7c8cfacfe7..f9f7984fee 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectQueryAsSubQueryCondition.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectQueryAsSubQueryCondition.java @@ -50,9 +50,9 @@ class SelectQueryAsSubQueryCondition extends AbstractCondition { private final Select query; private final Field field; - private final SubQueryOperator operator; + private final SubqueryOperator operator; - SelectQueryAsSubQueryCondition(Select query, Field field, SubQueryOperator operator) { + SelectQueryAsSubQueryCondition(Select query, Field field, SubqueryOperator operator) { this.query = query; this.field = field; this.operator = operator; diff --git a/jOOQ/src/main/java/org/jooq/impl/SubQueryOperator.java b/jOOQ/src/main/java/org/jooq/impl/SubqueryOperator.java similarity index 97% rename from jOOQ/src/main/java/org/jooq/impl/SubQueryOperator.java rename to jOOQ/src/main/java/org/jooq/impl/SubqueryOperator.java index fa340b6791..84f628bfd6 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SubQueryOperator.java +++ b/jOOQ/src/main/java/org/jooq/impl/SubqueryOperator.java @@ -41,7 +41,7 @@ package org.jooq.impl; * * @author Lukas Eder */ -enum SubQueryOperator { +enum SubqueryOperator { IN("in"), NOT_IN("not in"), @@ -56,7 +56,7 @@ enum SubQueryOperator { private final String sql; - private SubQueryOperator(String sql) { + private SubqueryOperator(String sql) { this.sql = sql; }