org.mybatis.dynamic.sql.SqlBuilder Maven / Gradle / Ivy
Show all versions of mybatis-dynamic-sql Show documentation
/*
* Copyright 2016-2024 the original author or authors.
*
* 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.
*/
package org.mybatis.dynamic.sql;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.function.Supplier;
import org.mybatis.dynamic.sql.delete.DeleteDSL;
import org.mybatis.dynamic.sql.delete.DeleteModel;
import org.mybatis.dynamic.sql.insert.BatchInsertDSL;
import org.mybatis.dynamic.sql.insert.GeneralInsertDSL;
import org.mybatis.dynamic.sql.insert.InsertDSL;
import org.mybatis.dynamic.sql.insert.InsertSelectDSL;
import org.mybatis.dynamic.sql.insert.MultiRowInsertDSL;
import org.mybatis.dynamic.sql.select.ColumnSortSpecification;
import org.mybatis.dynamic.sql.select.CountDSL;
import org.mybatis.dynamic.sql.select.HavingDSL;
import org.mybatis.dynamic.sql.select.MultiSelectDSL;
import org.mybatis.dynamic.sql.select.QueryExpressionDSL.FromGatherer;
import org.mybatis.dynamic.sql.select.SelectDSL;
import org.mybatis.dynamic.sql.select.SelectModel;
import org.mybatis.dynamic.sql.select.SimpleSortSpecification;
import org.mybatis.dynamic.sql.select.aggregate.Avg;
import org.mybatis.dynamic.sql.select.aggregate.Count;
import org.mybatis.dynamic.sql.select.aggregate.CountAll;
import org.mybatis.dynamic.sql.select.aggregate.CountDistinct;
import org.mybatis.dynamic.sql.select.aggregate.Max;
import org.mybatis.dynamic.sql.select.aggregate.Min;
import org.mybatis.dynamic.sql.select.aggregate.Sum;
import org.mybatis.dynamic.sql.select.caseexpression.SearchedCaseDSL;
import org.mybatis.dynamic.sql.select.caseexpression.SimpleCaseDSL;
import org.mybatis.dynamic.sql.select.function.Add;
import org.mybatis.dynamic.sql.select.function.Cast;
import org.mybatis.dynamic.sql.select.function.Concat;
import org.mybatis.dynamic.sql.select.function.Concatenate;
import org.mybatis.dynamic.sql.select.function.Divide;
import org.mybatis.dynamic.sql.select.function.Lower;
import org.mybatis.dynamic.sql.select.function.Multiply;
import org.mybatis.dynamic.sql.select.function.OperatorFunction;
import org.mybatis.dynamic.sql.select.function.Substring;
import org.mybatis.dynamic.sql.select.function.Subtract;
import org.mybatis.dynamic.sql.select.function.Upper;
import org.mybatis.dynamic.sql.select.join.EqualTo;
import org.mybatis.dynamic.sql.select.join.EqualToValue;
import org.mybatis.dynamic.sql.select.join.JoinCondition;
import org.mybatis.dynamic.sql.select.join.JoinCriterion;
import org.mybatis.dynamic.sql.update.UpdateDSL;
import org.mybatis.dynamic.sql.update.UpdateModel;
import org.mybatis.dynamic.sql.util.Buildable;
import org.mybatis.dynamic.sql.where.WhereDSL;
import org.mybatis.dynamic.sql.where.condition.IsBetween;
import org.mybatis.dynamic.sql.where.condition.IsEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsEqualToColumn;
import org.mybatis.dynamic.sql.where.condition.IsEqualToWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThan;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanColumn;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualToColumn;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanOrEqualToWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsGreaterThanWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsIn;
import org.mybatis.dynamic.sql.where.condition.IsInCaseInsensitive;
import org.mybatis.dynamic.sql.where.condition.IsInCaseInsensitiveWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsInWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsInWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsLessThan;
import org.mybatis.dynamic.sql.where.condition.IsLessThanColumn;
import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualToColumn;
import org.mybatis.dynamic.sql.where.condition.IsLessThanOrEqualToWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsLessThanWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsLike;
import org.mybatis.dynamic.sql.where.condition.IsLikeCaseInsensitive;
import org.mybatis.dynamic.sql.where.condition.IsNotBetween;
import org.mybatis.dynamic.sql.where.condition.IsNotEqualTo;
import org.mybatis.dynamic.sql.where.condition.IsNotEqualToColumn;
import org.mybatis.dynamic.sql.where.condition.IsNotEqualToWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsNotIn;
import org.mybatis.dynamic.sql.where.condition.IsNotInCaseInsensitive;
import org.mybatis.dynamic.sql.where.condition.IsNotInCaseInsensitiveWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsNotInWhenPresent;
import org.mybatis.dynamic.sql.where.condition.IsNotInWithSubselect;
import org.mybatis.dynamic.sql.where.condition.IsNotLike;
import org.mybatis.dynamic.sql.where.condition.IsNotLikeCaseInsensitive;
import org.mybatis.dynamic.sql.where.condition.IsNotNull;
import org.mybatis.dynamic.sql.where.condition.IsNull;
public interface SqlBuilder {
// statements
/**
* Renders as select count(distinct column) from table...
*
* @param column
* the column to count
*
* @return the next step in the DSL
*/
static CountDSL.FromGatherer countDistinctColumn(BasicColumn column) {
return CountDSL.countDistinct(column);
}
/**
* Renders as select count(column) from table...
*
* @param column
* the column to count
*
* @return the next step in the DSL
*/
static CountDSL.FromGatherer countColumn(BasicColumn column) {
return CountDSL.count(column);
}
/**
* Renders as select count(*) from table...
*
* @param table
* the table to count
*
* @return the next step in the DSL
*/
static CountDSL countFrom(SqlTable table) {
return CountDSL.countFrom(table);
}
static DeleteDSL deleteFrom(SqlTable table) {
return DeleteDSL.deleteFrom(table);
}
static DeleteDSL deleteFrom(SqlTable table, String tableAlias) {
return DeleteDSL.deleteFrom(table, tableAlias);
}
static InsertDSL.IntoGatherer insert(T row) {
return InsertDSL.insert(row);
}
/**
* Insert a Batch of records. The model object is structured to support bulk inserts with JDBC batch support.
*
* @param records
* records to insert
* @param
* the type of record to insert
*
* @return the next step in the DSL
*/
@SafeVarargs
static BatchInsertDSL.IntoGatherer insertBatch(T... records) {
return BatchInsertDSL.insert(records);
}
/**
* Insert a Batch of records. The model object is structured to support bulk inserts with JDBC batch support.
*
* @param records
* records to insert
* @param
* the type of record to insert
*
* @return the next step in the DSL
*/
static BatchInsertDSL.IntoGatherer insertBatch(Collection records) {
return BatchInsertDSL.insert(records);
}
/**
* Insert multiple records in a single statement. The model object is structured as a single insert statement with
* multiple values clauses. This statement is suitable for use with a small number of records. It is not suitable
* for large bulk inserts as it is possible to exceed the limit of parameter markers in a prepared statement.
*
* For large bulk inserts, see {@link SqlBuilder#insertBatch(Object[])}
* @param records
* records to insert
* @param
* the type of record to insert
*
* @return the next step in the DSL
*/
@SafeVarargs
static MultiRowInsertDSL.IntoGatherer insertMultiple(T... records) {
return MultiRowInsertDSL.insert(records);
}
/**
* Insert multiple records in a single statement. The model object is structured as a single insert statement with
* multiple values clauses. This statement is suitable for use with a small number of records. It is not suitable
* for large bulk inserts as it is possible to exceed the limit of parameter markers in a prepared statement.
*
* For large bulk inserts, see {@link SqlBuilder#insertBatch(Collection)}
* @param records
* records to insert
* @param
* the type of record to insert
*
* @return the next step in the DSL
*/
static MultiRowInsertDSL.IntoGatherer insertMultiple(Collection records) {
return MultiRowInsertDSL.insert(records);
}
static InsertIntoNextStep insertInto(SqlTable table) {
return new InsertIntoNextStep(table);
}
static FromGatherer select(BasicColumn... selectList) {
return SelectDSL.select(selectList);
}
static FromGatherer select(Collection extends BasicColumn> selectList) {
return SelectDSL.select(selectList);
}
static FromGatherer selectDistinct(BasicColumn... selectList) {
return SelectDSL.selectDistinct(selectList);
}
static FromGatherer selectDistinct(Collection extends BasicColumn> selectList) {
return SelectDSL.selectDistinct(selectList);
}
static MultiSelectDSL multiSelect(Buildable selectModelBuilder) {
return new MultiSelectDSL(selectModelBuilder);
}
static UpdateDSL update(SqlTable table) {
return UpdateDSL.update(table);
}
static UpdateDSL update(SqlTable table, String tableAlias) {
return UpdateDSL.update(table, tableAlias);
}
static WhereDSL.StandaloneWhereFinisher where() {
return new WhereDSL().where();
}
static WhereDSL.StandaloneWhereFinisher where(BindableColumn column, VisitableCondition condition,
AndOrCriteriaGroup... subCriteria) {
return new WhereDSL().where(column, condition, subCriteria);
}
static WhereDSL.StandaloneWhereFinisher where(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return new WhereDSL().where(initialCriterion, subCriteria);
}
static WhereDSL.StandaloneWhereFinisher where(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return new WhereDSL().where(existsPredicate, subCriteria);
}
static HavingDSL.StandaloneHavingFinisher having(BindableColumn column, VisitableCondition condition,
AndOrCriteriaGroup... subCriteria) {
return new HavingDSL().having(column, condition, subCriteria);
}
static HavingDSL.StandaloneHavingFinisher having(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return new HavingDSL().having(initialCriterion, subCriteria);
}
// where condition connectors
static CriteriaGroup group(BindableColumn column, VisitableCondition condition,
AndOrCriteriaGroup... subCriteria) {
return group(column, condition, Arrays.asList(subCriteria));
}
static CriteriaGroup group(BindableColumn column, VisitableCondition condition,
List subCriteria) {
return new CriteriaGroup.Builder()
.withInitialCriterion(new ColumnAndConditionCriterion.Builder().withColumn(column)
.withCondition(condition).build())
.withSubCriteria(subCriteria)
.build();
}
static CriteriaGroup group(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return group(existsPredicate, Arrays.asList(subCriteria));
}
static CriteriaGroup group(ExistsPredicate existsPredicate, List subCriteria) {
return new CriteriaGroup.Builder()
.withInitialCriterion(new ExistsCriterion.Builder()
.withExistsPredicate(existsPredicate).build())
.withSubCriteria(subCriteria)
.build();
}
static CriteriaGroup group(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return group(initialCriterion, Arrays.asList(subCriteria));
}
static CriteriaGroup group(SqlCriterion initialCriterion, List subCriteria) {
return new CriteriaGroup.Builder()
.withInitialCriterion(initialCriterion)
.withSubCriteria(subCriteria)
.build();
}
static CriteriaGroup group(List subCriteria) {
return new CriteriaGroup.Builder()
.withSubCriteria(subCriteria)
.build();
}
static NotCriterion not(BindableColumn column, VisitableCondition condition,
AndOrCriteriaGroup... subCriteria) {
return not(column, condition, Arrays.asList(subCriteria));
}
static NotCriterion not(BindableColumn column, VisitableCondition condition,
List subCriteria) {
return new NotCriterion.Builder()
.withInitialCriterion(new ColumnAndConditionCriterion.Builder().withColumn(column)
.withCondition(condition).build())
.withSubCriteria(subCriteria)
.build();
}
static NotCriterion not(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return not(existsPredicate, Arrays.asList(subCriteria));
}
static NotCriterion not(ExistsPredicate existsPredicate, List subCriteria) {
return new NotCriterion.Builder()
.withInitialCriterion(new ExistsCriterion.Builder()
.withExistsPredicate(existsPredicate).build())
.withSubCriteria(subCriteria)
.build();
}
static NotCriterion not(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return not(initialCriterion, Arrays.asList(subCriteria));
}
static NotCriterion not(SqlCriterion initialCriterion, List subCriteria) {
return new NotCriterion.Builder()
.withInitialCriterion(initialCriterion)
.withSubCriteria(subCriteria)
.build();
}
static NotCriterion not(List subCriteria) {
return new NotCriterion.Builder()
.withSubCriteria(subCriteria)
.build();
}
static AndOrCriteriaGroup or(BindableColumn column, VisitableCondition condition,
AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(ColumnAndConditionCriterion.withColumn(column)
.withCondition(condition)
.build())
.withConnector("or") //$NON-NLS-1$
.withSubCriteria(Arrays.asList(subCriteria))
.build();
}
static AndOrCriteriaGroup or(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(new ExistsCriterion.Builder()
.withExistsPredicate(existsPredicate).build())
.withConnector("or") //$NON-NLS-1$
.withSubCriteria(Arrays.asList(subCriteria))
.build();
}
static AndOrCriteriaGroup or(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withConnector("or") //$NON-NLS-1$
.withInitialCriterion(initialCriterion)
.withSubCriteria(Arrays.asList(subCriteria))
.build();
}
static AndOrCriteriaGroup or(List subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withConnector("or") //$NON-NLS-1$
.withSubCriteria(subCriteria)
.build();
}
static AndOrCriteriaGroup and(BindableColumn column, VisitableCondition condition,
AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(ColumnAndConditionCriterion.withColumn(column)
.withCondition(condition)
.build())
.withConnector("and") //$NON-NLS-1$
.withSubCriteria(Arrays.asList(subCriteria))
.build();
}
static AndOrCriteriaGroup and(ExistsPredicate existsPredicate, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withInitialCriterion(new ExistsCriterion.Builder()
.withExistsPredicate(existsPredicate).build())
.withConnector("and") //$NON-NLS-1$
.withSubCriteria(Arrays.asList(subCriteria))
.build();
}
static AndOrCriteriaGroup and(SqlCriterion initialCriterion, AndOrCriteriaGroup... subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withConnector("and") //$NON-NLS-1$
.withInitialCriterion(initialCriterion)
.withSubCriteria(Arrays.asList(subCriteria))
.build();
}
static AndOrCriteriaGroup and(List subCriteria) {
return new AndOrCriteriaGroup.Builder()
.withConnector("and") //$NON-NLS-1$
.withSubCriteria(subCriteria)
.build();
}
// join support
static JoinCriterion and(BindableColumn joinColumn, JoinCondition joinCondition) {
return new JoinCriterion.Builder()
.withConnector("and") //$NON-NLS-1$
.withJoinColumn(joinColumn)
.withJoinCondition(joinCondition)
.build();
}
static JoinCriterion on(BindableColumn joinColumn, JoinCondition joinCondition) {
return new JoinCriterion.Builder()
.withConnector("on") //$NON-NLS-1$
.withJoinColumn(joinColumn)
.withJoinCondition(joinCondition)
.build();
}
// case expressions
@SuppressWarnings("java:S100")
static SimpleCaseDSL case_(BindableColumn column) {
return SimpleCaseDSL.simpleCase(column);
}
@SuppressWarnings("java:S100")
static SearchedCaseDSL case_() {
return SearchedCaseDSL.searchedCase();
}
static EqualTo equalTo(BindableColumn column) {
return new EqualTo<>(column);
}
static EqualToValue equalTo(T value) {
return new EqualToValue<>(value);
}
// aggregate support
static CountAll count() {
return new CountAll();
}
static Count count(BasicColumn column) {
return Count.of(column);
}
static CountDistinct countDistinct(BasicColumn column) {
return CountDistinct.of(column);
}
static Max max(BindableColumn column) {
return Max.of(column);
}
static Min min(BindableColumn column) {
return Min.of(column);
}
static Avg avg(BindableColumn column) {
return Avg.of(column);
}
static Sum sum(BindableColumn column) {
return Sum.of(column);
}
static Sum sum(BindableColumn column, VisitableCondition condition) {
return Sum.of(column, condition);
}
// constants
static Constant constant(String constant) {
return Constant.of(constant);
}
static StringConstant stringConstant(String constant) {
return StringConstant.of(constant);
}
static BoundValue value(T value) {
return BoundValue.of(value);
}
// functions
static Add add(BindableColumn firstColumn, BasicColumn secondColumn,
BasicColumn... subsequentColumns) {
return Add.of(firstColumn, secondColumn, subsequentColumns);
}
static Divide divide(BindableColumn firstColumn, BasicColumn secondColumn,
BasicColumn... subsequentColumns) {
return Divide.of(firstColumn, secondColumn, subsequentColumns);
}
static Multiply multiply(BindableColumn firstColumn, BasicColumn secondColumn,
BasicColumn... subsequentColumns) {
return Multiply.of(firstColumn, secondColumn, subsequentColumns);
}
static Subtract subtract(BindableColumn firstColumn, BasicColumn secondColumn,
BasicColumn... subsequentColumns) {
return Subtract.of(firstColumn, secondColumn, subsequentColumns);
}
static CastFinisher cast(String value) {
return cast(stringConstant(value));
}
static CastFinisher cast(Double value) {
return cast(constant(value.toString()));
}
static CastFinisher cast(BasicColumn column) {
return new CastFinisher(column);
}
/**
* Concatenate function that renders as "(x || y || z)". This will not work on some
* databases like MySql. In that case, use {@link SqlBuilder#concat(BindableColumn, BasicColumn...)}
*
* @param firstColumn first column
* @param secondColumn second column
* @param subsequentColumns subsequent columns
* @param type of column
* @return a Concatenate instance
*/
static Concatenate concatenate(BindableColumn firstColumn, BasicColumn secondColumn,
BasicColumn... subsequentColumns) {
return Concatenate.concatenate(firstColumn, secondColumn, subsequentColumns);
}
/**
* Concatenate function that renders as "concat(x, y, z)". This version works on more databases
* than {@link SqlBuilder#concatenate(BindableColumn, BasicColumn, BasicColumn...)}
*
* @param firstColumn first column
* @param subsequentColumns subsequent columns
* @param type of column
* @return a Concat instance
*/
static Concat concat(BindableColumn firstColumn, BasicColumn... subsequentColumns) {
return Concat.concat(firstColumn, subsequentColumns);
}
static OperatorFunction applyOperator(String operator, BindableColumn firstColumn,
BasicColumn secondColumn, BasicColumn... subsequentColumns) {
return OperatorFunction.of(operator, firstColumn, secondColumn, subsequentColumns);
}
static Lower lower(BindableColumn column) {
return Lower.of(column);
}
static Substring substring(BindableColumn column, int offset, int length) {
return Substring.of(column, offset, length);
}
static Upper upper(BindableColumn column) {
return Upper.of(column);
}
// conditions for all data types
static ExistsPredicate exists(Buildable selectModelBuilder) {
return ExistsPredicate.exists(selectModelBuilder);
}
static ExistsPredicate notExists(Buildable selectModelBuilder) {
return ExistsPredicate.notExists(selectModelBuilder);
}
static IsNull isNull() {
return new IsNull<>();
}
static IsNotNull isNotNull() {
return new IsNotNull<>();
}
static IsEqualTo isEqualTo(T value) {
return IsEqualTo.of(value);
}
static IsEqualTo isEqualTo(Supplier valueSupplier) {
return isEqualTo(valueSupplier.get());
}
static IsEqualToWithSubselect isEqualTo(Buildable selectModelBuilder) {
return IsEqualToWithSubselect.of(selectModelBuilder);
}
static IsEqualToColumn isEqualTo(BasicColumn column) {
return IsEqualToColumn.of(column);
}
static IsEqualTo isEqualToWhenPresent(T value) {
return IsEqualTo.of(value).filter(Objects::nonNull);
}
static IsEqualTo isEqualToWhenPresent(Supplier valueSupplier) {
return isEqualToWhenPresent(valueSupplier.get());
}
static IsNotEqualTo isNotEqualTo(T value) {
return IsNotEqualTo.of(value);
}
static IsNotEqualTo isNotEqualTo(Supplier valueSupplier) {
return isNotEqualTo(valueSupplier.get());
}
static IsNotEqualToWithSubselect isNotEqualTo(Buildable selectModelBuilder) {
return IsNotEqualToWithSubselect.of(selectModelBuilder);
}
static IsNotEqualToColumn isNotEqualTo(BasicColumn column) {
return IsNotEqualToColumn.of(column);
}
static IsNotEqualTo isNotEqualToWhenPresent(T value) {
return IsNotEqualTo.of(value).filter(Objects::nonNull);
}
static IsNotEqualTo isNotEqualToWhenPresent(Supplier valueSupplier) {
return isNotEqualToWhenPresent(valueSupplier.get());
}
static IsGreaterThan isGreaterThan(T value) {
return IsGreaterThan.of(value);
}
static IsGreaterThan isGreaterThan(Supplier valueSupplier) {
return isGreaterThan(valueSupplier.get());
}
static IsGreaterThanWithSubselect isGreaterThan(Buildable selectModelBuilder) {
return IsGreaterThanWithSubselect.of(selectModelBuilder);
}
static IsGreaterThanColumn isGreaterThan(BasicColumn column) {
return IsGreaterThanColumn.of(column);
}
static IsGreaterThan isGreaterThanWhenPresent(T value) {
return IsGreaterThan.of(value).filter(Objects::nonNull);
}
static IsGreaterThan isGreaterThanWhenPresent(Supplier valueSupplier) {
return isGreaterThanWhenPresent(valueSupplier.get());
}
static IsGreaterThanOrEqualTo isGreaterThanOrEqualTo(T value) {
return IsGreaterThanOrEqualTo.of(value);
}
static IsGreaterThanOrEqualTo isGreaterThanOrEqualTo(Supplier valueSupplier) {
return isGreaterThanOrEqualTo(valueSupplier.get());
}
static IsGreaterThanOrEqualToWithSubselect isGreaterThanOrEqualTo(
Buildable selectModelBuilder) {
return IsGreaterThanOrEqualToWithSubselect.of(selectModelBuilder);
}
static IsGreaterThanOrEqualToColumn isGreaterThanOrEqualTo(BasicColumn column) {
return IsGreaterThanOrEqualToColumn.of(column);
}
static IsGreaterThanOrEqualTo isGreaterThanOrEqualToWhenPresent(T value) {
return IsGreaterThanOrEqualTo.of(value).filter(Objects::nonNull);
}
static IsGreaterThanOrEqualTo isGreaterThanOrEqualToWhenPresent(Supplier valueSupplier) {
return isGreaterThanOrEqualToWhenPresent(valueSupplier.get());
}
static IsLessThan isLessThan(T value) {
return IsLessThan.of(value);
}
static IsLessThan isLessThan(Supplier valueSupplier) {
return isLessThan(valueSupplier.get());
}
static IsLessThanWithSubselect isLessThan(Buildable selectModelBuilder) {
return IsLessThanWithSubselect.of(selectModelBuilder);
}
static IsLessThanColumn isLessThan(BasicColumn column) {
return IsLessThanColumn.of(column);
}
static IsLessThan isLessThanWhenPresent(T value) {
return IsLessThan.of(value).filter(Objects::nonNull);
}
static IsLessThan isLessThanWhenPresent(Supplier valueSupplier) {
return isLessThanWhenPresent(valueSupplier.get());
}
static IsLessThanOrEqualTo isLessThanOrEqualTo(T value) {
return IsLessThanOrEqualTo.of(value);
}
static IsLessThanOrEqualTo isLessThanOrEqualTo(Supplier valueSupplier) {
return isLessThanOrEqualTo(valueSupplier.get());
}
static IsLessThanOrEqualToWithSubselect isLessThanOrEqualTo(Buildable selectModelBuilder) {
return IsLessThanOrEqualToWithSubselect.of(selectModelBuilder);
}
static IsLessThanOrEqualToColumn isLessThanOrEqualTo(BasicColumn column) {
return IsLessThanOrEqualToColumn.of(column);
}
static IsLessThanOrEqualTo isLessThanOrEqualToWhenPresent(T value) {
return IsLessThanOrEqualTo.of(value).filter(Objects::nonNull);
}
static IsLessThanOrEqualTo isLessThanOrEqualToWhenPresent(Supplier valueSupplier) {
return isLessThanOrEqualToWhenPresent(valueSupplier.get());
}
@SafeVarargs
static IsIn isIn(T... values) {
return IsIn.of(values);
}
static IsIn isIn(Collection values) {
return IsIn.of(values);
}
static IsInWithSubselect isIn(Buildable selectModelBuilder) {
return IsInWithSubselect.of(selectModelBuilder);
}
@SafeVarargs
static IsInWhenPresent isInWhenPresent(T... values) {
return IsInWhenPresent.of(values);
}
static IsInWhenPresent isInWhenPresent(Collection values) {
return values == null ? IsInWhenPresent.empty() : IsInWhenPresent.of(values);
}
@SafeVarargs
static IsNotIn isNotIn(T... values) {
return IsNotIn.of(values);
}
static IsNotIn isNotIn(Collection values) {
return IsNotIn.of(values);
}
static IsNotInWithSubselect