Class ConditionFactory

java.lang.Object
com.landawn.abacus.condition.ConditionFactory
Direct Known Subclasses:
ConditionFactory.CF

public class ConditionFactory extends Object
A factory for creating Condition objects.
Since:
0.8
Author:
Haiyang Li
  • Field Details

  • Method Details

    • alwaysTrue

      public static Expression alwaysTrue()
      Returns:
    • alwaysFalse

      @Deprecated public static Expression alwaysFalse()
      Deprecated.
      Returns:
    • namedProperty

      public static NamedProperty namedProperty(String propName)
      Parameters:
      propName -
      Returns:
    • expr

      public static Expression expr(String literal)
      Parameters:
      literal -
      Returns:
    • binary

      public static Binary binary(String propName, Operator operator, Object propValue)
      Parameters:
      propName -
      operator -
      propValue -
      Returns:
    • equal

      public static Equal equal(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • equal

      public static Equal equal(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • eq

      public static Equal eq(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • eq

      public static Equal eq(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • eqOr

      @SafeVarargs public static Or eqOr(String propName, Object... propValues)
      Parameters:
      propName -
      propValues -
      Returns:
    • eqOr

      public static Or eqOr(String propName, Collection<?> propValues)
      Parameters:
      propName -
      propValues -
      Returns:
    • eqOr

      public static Or eqOr(Map<String,?> props)
      Parameters:
      props -
      Returns:
    • eqOr

      public static Or eqOr(Object entity)
      Parameters:
      entity -
      Returns:
    • eqOr

      public static Or eqOr(Object entity, Collection<String> selectPropNames)
      Parameters:
      entity -
      selectPropNames -
      Returns:
    • eqOr

      public static Or eqOr(String propName1, Object propValue1, String propName2, Object propValue2)
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      Returns:
    • eqOr

      public static Or eqOr(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      propName3 -
      propValue3 -
      Returns:
    • eqAnd

      public static And eqAnd(Map<String,?> props)
      Parameters:
      props -
      Returns:
    • eqAnd

      public static And eqAnd(Object entity)
      Parameters:
      entity -
      Returns:
    • eqAnd

      public static And eqAnd(Object entity, Collection<String> selectPropNames)
      Parameters:
      entity -
      selectPropNames -
      Returns:
    • eqAnd

      public static And eqAnd(String propName1, Object propValue1, String propName2, Object propValue2)
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      Returns:
    • eqAnd

      public static And eqAnd(String propName1, Object propValue1, String propName2, Object propValue2, String propName3, Object propValue3)
      Parameters:
      propName1 -
      propValue1 -
      propName2 -
      propValue2 -
      propName3 -
      propValue3 -
      Returns:
    • eqAndOr

      @Beta public static Or eqAndOr(List<? extends Map<String,?>> propsList)
      Eq and or.
      Parameters:
      propsList -
      Returns:
    • eqAndOr

      @Beta public static Or eqAndOr(Collection<?> entities)
      Eq and or.
      Parameters:
      entities -
      Returns:
    • eqAndOr

      @Beta public static Or eqAndOr(Collection<?> entities, Collection<String> selectPropNames)
      Eq and or.
      Parameters:
      entities -
      selectPropNames -
      Returns:
    • gtAndLt

      public static And gtAndLt(String propName, Object minValue, Object maxValue)
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • gtAndLt

      public static And gtAndLt(String propName)
      Parameters:
      propName -
      Returns:
    • geAndLt

      public static And geAndLt(String propName, Object minValue, Object maxValue)
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • geAndLt

      public static And geAndLt(String propName)
      Parameters:
      propName -
      Returns:
    • geAndLe

      public static And geAndLe(String propName, Object minValue, Object maxValue)
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • geAndLe

      public static And geAndLe(String propName)
      Parameters:
      propName -
      Returns:
    • gtAndLe

      public static And gtAndLe(String propName, Object minValue, Object maxValue)
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • gtAndLe

      public static And gtAndLe(String propName)
      Parameters:
      propName -
      Returns:
    • id2Cond

      public static And id2Cond(com.landawn.abacus.util.EntityId entityId)
      Parameters:
      entityId -
      Returns:
    • id2Cond

      public static Or id2Cond(Collection<? extends com.landawn.abacus.util.EntityId> entityIds)
      Parameters:
      entityIds -
      Returns:
    • notEqual

      public static NotEqual notEqual(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • notEqual

      public static NotEqual notEqual(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • ne

      public static NotEqual ne(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • ne

      public static NotEqual ne(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • greaterThan

      public static GreaterThan greaterThan(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • greaterThan

      public static GreaterThan greaterThan(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • gt

      public static GreaterThan gt(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • gt

      public static GreaterThan gt(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • greaterEqual

      public static GreaterEqual greaterEqual(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • greaterEqual

      public static GreaterEqual greaterEqual(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • ge

      public static GreaterEqual ge(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • ge

      public static GreaterEqual ge(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • lessThan

      public static LessThan lessThan(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • lessThan

      public static LessThan lessThan(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • lt

      public static LessThan lt(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • lt

      public static LessThan lt(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • lessEqual

      public static LessEqual lessEqual(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • lessEqual

      public static LessEqual lessEqual(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • le

      public static LessEqual le(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • le

      public static LessEqual le(String propName)
      It's for parameterized SQL with question mark or named parameters.
      Parameters:
      propName -
      Returns:
      See Also:
    • between

      public static Between between(String propName, Object minValue, Object maxValue)
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • between

      public static Between between(String propName)
      Parameters:
      propName -
      Returns:
    • bt

      @Deprecated public static Between bt(String propName, Object minValue, Object maxValue)
      Deprecated.
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • bt

      @Deprecated public static Between bt(String propName)
      Deprecated.
      please use between(String)
      Parameters:
      propName -
      Returns:
    • notBetween

      public static NotBetween notBetween(String propName, Object minValue, Object maxValue)
      Parameters:
      propName -
      minValue -
      maxValue -
      Returns:
    • notBetween

      public static NotBetween notBetween(String propName)
      Parameters:
      propName -
      Returns:
    • like

      public static Like like(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • like

      public static Like like(String propName)
      Parameters:
      propName -
      Returns:
    • notLike

      public static NotLike notLike(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • notLike

      public static NotLike notLike(String propName)
      Parameters:
      propName -
      Returns:
    • contains

      public static Like contains(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • notContains

      public static NotLike notContains(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • startsWith

      public static Like startsWith(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • notStartsWith

      public static NotLike notStartsWith(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • endsWith

      public static Like endsWith(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • notEndsWith

      public static NotLike notEndsWith(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • isNull

      public static IsNull isNull(String propName)
      Checks if is null.
      Parameters:
      propName -
      Returns:
    • isEmpty

      @Beta public static Or isEmpty(String propName)
      Checks if is null or empty.
      Parameters:
      propName -
      Returns:
    • isNullOrZero

      @Beta public static Or isNullOrZero(String propName)
      Checks if is null or zero.
      Parameters:
      propName -
      Returns:
    • isNotNull

      public static IsNotNull isNotNull(String propName)
      Checks if is not null.
      Parameters:
      propName -
      Returns:
    • isNaN

      public static IsNaN isNaN(String propName)
      Checks if is na N.
      Parameters:
      propName -
      Returns:
    • isNotNaN

      public static IsNotNaN isNotNaN(String propName)
      Checks if is not na N.
      Parameters:
      propName -
      Returns:
    • isInfinite

      public static IsInfinite isInfinite(String propName)
      Checks if is infinite.
      Parameters:
      propName -
      Returns:
    • isNotInfinite

      public static IsNotInfinite isNotInfinite(String propName)
      Checks if is not infinite.
      Parameters:
      propName -
      Returns:
    • is

      public static Is is(String propName, Object propValue)
      Checks if is.
      Parameters:
      propName -
      propValue -
      Returns:
    • isNot

      public static IsNot isNot(String propName, Object propValue)
      Checks if is not.
      Parameters:
      propName -
      propValue -
      Returns:
    • xor

      public static XOR xor(String propName, Object propValue)
      Parameters:
      propName -
      propValue -
      Returns:
    • or

      @SafeVarargs public static Or or(Condition... conditions)
      Parameters:
      conditions -
      Returns:
    • or

      public static Or or(Collection<? extends Condition> conditions)
      Parameters:
      conditions -
      Returns:
    • and

      @SafeVarargs public static And and(Condition... conditions)
      Parameters:
      conditions -
      Returns:
    • and

      public static And and(Collection<? extends Condition> conditions)
      Parameters:
      conditions -
      Returns:
    • junction

      @Beta @SafeVarargs public static Junction junction(Operator operator, Condition... conditions)
      Parameters:
      operator -
      conditions -
      Returns:
    • junction

      @Beta public static Junction junction(Operator operator, Collection<? extends Condition> conditions)
      Parameters:
      operator -
      conditions -
      Returns:
    • where

      public static Where where(Condition condition)
      Parameters:
      condition -
      Returns:
    • where

      public static Where where(String condition)
      Parameters:
      condition -
      Returns:
    • groupBy

      @SafeVarargs public static GroupBy groupBy(String... propNames)
      Parameters:
      propNames -
      Returns:
    • groupBy

      public static GroupBy groupBy(Collection<String> propNames)
      Parameters:
      propNames -
      Returns:
    • groupBy

      public static GroupBy groupBy(Collection<String> propNames, SortDirection direction)
      Parameters:
      propNames -
      direction -
      Returns:
    • groupBy

      public static GroupBy groupBy(String propName, SortDirection direction)
      Parameters:
      propName -
      direction -
      Returns:
    • groupBy

      public static GroupBy groupBy(String propNameA, SortDirection directionA, String propNameB, SortDirection directionB)
      Parameters:
      propNameA -
      directionA -
      propNameB -
      directionB -
      Returns:
    • groupBy

      public static GroupBy groupBy(String propNameA, SortDirection directionA, String propNameB, SortDirection directionB, String propNameC, SortDirection directionC)
      Parameters:
      propNameA -
      directionA -
      propNameB -
      directionB -
      propNameC -
      directionC -
      Returns:
    • groupBy

      public static GroupBy groupBy(Map<String,SortDirection> orders)
      Parameters:
      orders - should be a LinkedHashMap
      Returns:
    • groupBy

      public static GroupBy groupBy(Condition condition)
      Parameters:
      condition -
      Returns:
    • having

      public static Having having(Condition condition)
      Parameters:
      condition -
      Returns:
    • having

      public static Having having(String condition)
      Parameters:
      condition -
      Returns:
    • orderBy

      @SafeVarargs public static OrderBy orderBy(String... propNames)
      Parameters:
      propNames -
      Returns:
    • orderByAsc

      @SafeVarargs public static OrderBy orderByAsc(String... propNames)
      Parameters:
      propNames -
      Returns:
    • orderByAsc

      public static OrderBy orderByAsc(Collection<String> propNames)
      Parameters:
      propNames -
      Returns:
    • orderByDesc

      @SafeVarargs public static OrderBy orderByDesc(String... propNames)
      Parameters:
      propNames -
      Returns:
    • orderByDesc

      public static OrderBy orderByDesc(Collection<String> propNames)
      Parameters:
      propNames -
      Returns:
    • orderBy

      public static OrderBy orderBy(Collection<String> propNames)
      Parameters:
      propNames -
      Returns:
    • orderBy

      public static OrderBy orderBy(Collection<String> propNames, SortDirection direction)
      Parameters:
      propNames -
      direction -
      Returns:
    • orderBy

      public static OrderBy orderBy(String propName, SortDirection direction)
      Parameters:
      propName -
      direction -
      Returns:
    • orderBy

      public static OrderBy orderBy(String propNameA, SortDirection directionA, String propNameB, SortDirection directionB)
      Parameters:
      propNameA -
      directionA -
      propNameB -
      directionB -
      Returns:
    • orderBy

      public static OrderBy orderBy(String propNameA, SortDirection directionA, String propNameB, SortDirection directionB, String propNameC, SortDirection directionC)
      Parameters:
      propNameA -
      directionA -
      propNameB -
      directionB -
      propNameC -
      directionC -
      Returns:
    • orderBy

      public static OrderBy orderBy(Map<String,SortDirection> orders)
      Parameters:
      orders - should be a LinkedHashMap
      Returns:
    • orderBy

      public static OrderBy orderBy(Condition condition)
      Parameters:
      condition -
      Returns:
    • on

      public static On on(Condition condition)
      Parameters:
      condition -
      Returns:
    • on

      public static On on(String condition)
      Parameters:
      condition -
      Returns:
    • on

      public static On on(String propName, String anoPropName)
      Parameters:
      propName -
      anoPropName -
      Returns:
    • on

      public static On on(Map<String,String> propNamePair)
      Parameters:
      propNamePair -
      Returns:
    • using

      @Deprecated @SafeVarargs public static Using using(String... columnNames)
      Deprecated.
      It's recommended to use On, instead of Using.
      Parameters:
      columnNames -
      Returns:
    • using

      @Deprecated public static Using using(Collection<String> columnNames)
      Deprecated.
      It's recommended to use On, instead of Using.
      Parameters:
      columnNames -
      Returns:
    • join

      public static Join join(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • join

      public static Join join(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • join

      public static Join join(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • leftJoin

      public static LeftJoin leftJoin(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • leftJoin

      public static LeftJoin leftJoin(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • leftJoin

      public static LeftJoin leftJoin(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • rightJoin

      public static RightJoin rightJoin(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • rightJoin

      public static RightJoin rightJoin(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • rightJoin

      public static RightJoin rightJoin(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • crossJoin

      public static CrossJoin crossJoin(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • crossJoin

      public static CrossJoin crossJoin(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • crossJoin

      public static CrossJoin crossJoin(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • fullJoin

      public static FullJoin fullJoin(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • fullJoin

      public static FullJoin fullJoin(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • fullJoin

      public static FullJoin fullJoin(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • innerJoin

      public static InnerJoin innerJoin(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • innerJoin

      public static InnerJoin innerJoin(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • innerJoin

      public static InnerJoin innerJoin(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • naturalJoin

      public static NaturalJoin naturalJoin(String joinEntity)
      Parameters:
      joinEntity -
      Returns:
    • naturalJoin

      public static NaturalJoin naturalJoin(String joinEntity, Condition condition)
      Parameters:
      joinEntity -
      condition -
      Returns:
    • naturalJoin

      public static NaturalJoin naturalJoin(Collection<String> joinEntities, Condition condition)
      Parameters:
      joinEntities -
      condition -
      Returns:
    • in

      public static In in(String propName, int[] values)
      Parameters:
      propName -
      values -
      Returns:
    • in

      public static In in(String propName, long[] values)
      Parameters:
      propName -
      values -
      Returns:
    • in

      public static In in(String propName, double[] values)
      Parameters:
      propName -
      values -
      Returns:
    • in

      public static In in(String propName, Object[] values)
      Parameters:
      propName -
      values -
      Returns:
    • in

      public static In in(String propName, Collection<?> values)
      Parameters:
      propName -
      values -
      Returns:
    • in

      public static InSubQuery in(String propName, SubQuery subQuery)
      Parameters:
      propName -
      subQuery -
      Returns:
    • in

      public static InSubQuery in(Collection<String> propNames, SubQuery subQuery)
      Parameters:
      propNames -
      subQuery -
      Returns:
    • notIn

      public static NotIn notIn(String propName, int[] values)
      Parameters:
      propName -
      values -
      Returns:
    • notIn

      public static NotIn notIn(String propName, long[] values)
      Parameters:
      propName -
      values -
      Returns:
    • notIn

      public static NotIn notIn(String propName, double[] values)
      Parameters:
      propName -
      values -
      Returns:
    • notIn

      public static NotIn notIn(String propName, Object[] values)
      Parameters:
      propName -
      values -
      Returns:
    • notIn

      public static NotIn notIn(String propName, Collection<?> values)
      Parameters:
      propName -
      values -
      Returns:
    • notIn

      public static NotInSubQuery notIn(String propName, SubQuery subQuery)
      Parameters:
      propName -
      subQuery -
      Returns:
    • notIn

      public static NotInSubQuery notIn(Collection<String> propNames, SubQuery subQuery)
      Parameters:
      propNames -
      subQuery -
      Returns:
    • all

      public static All all(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • any

      public static Any any(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • some

      public static Some some(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • exists

      public static Exists exists(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • notExists

      public static Not notExists(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • union

      public static Union union(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • unionAll

      public static UnionAll unionAll(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • except

      public static Except except(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • intersect

      public static Intersect intersect(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • minus

      public static Minus minus(SubQuery condition)
      Parameters:
      condition -
      Returns:
    • cell

      @Beta public static Cell cell(Operator operator, Condition condition)
      Parameters:
      operator -
      condition -
      Returns:
    • subQuery

      public static SubQuery subQuery(Class<?> entityClass, Collection<String> propNames, Condition condition)
      Parameters:
      entityClass -
      propNames -
      condition -
      Returns:
    • subQuery

      public static SubQuery subQuery(String entityName, Collection<String> propNames, Condition condition)
      Parameters:
      entityName -
      propNames -
      condition -
      Returns:
    • subQuery

      public static SubQuery subQuery(String entityName, Collection<String> propNames, String condition)
      Parameters:
      entityName -
      propNames -
      condition -
      Returns:
    • subQuery

      @Deprecated public static SubQuery subQuery(String entityName, String sql)
      Deprecated.
      replaced by subQuery(String)
      Parameters:
      entityName -
      sql -
      Returns:
      See Also:
    • subQuery

      public static SubQuery subQuery(String sql)
      Parameters:
      sql -
      Returns:
    • limit

      public static Limit limit(int count)
      Parameters:
      count -
      Returns:
    • limit

      public static Limit limit(int offset, int count)
      Parameters:
      offset -
      count -
      Returns:
    • limit

      public static Limit limit(String expr)
      Parameters:
      expr -
      Returns:
    • criteria

      public static Criteria criteria()
      Returns: