Class SqlPredicates

java.lang.Object
com.atlassian.jira.database.SqlPredicates

public class SqlPredicates extends Object
Additional query predicates not provided directly by QueryDSL
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximum number of parameters SQL Server allows in a single query
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <D> com.querydsl.core.types.Predicate
    inAny(com.querydsl.core.types.dsl.SimpleExpression<D> left, Iterable<? extends List<? extends D>> lists)
    Create a left in right or... expression for each list This method can be removed once we upgrade to QueryDSL 3.6.0 or above, when QueryDSL introduces ExpressionUtils.inAny()
    <D> com.querydsl.core.types.Predicate
    partitionedIn(com.querydsl.core.types.dsl.SimpleExpression<D> left, Collection<? extends D> right)
    Create a SQL IN clause, if necessary partitioning to account for Oracle's maximum of 1000 parameters for each IN clause.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_SQL_SERVER_PARAMETER_LIMIT

      public static final int MAX_SQL_SERVER_PARAMETER_LIMIT
      The maximum number of parameters SQL Server allows in a single query
      See Also:
  • Constructor Details

  • Method Details

    • partitionedIn

      public <D> com.querydsl.core.types.Predicate partitionedIn(com.querydsl.core.types.dsl.SimpleExpression<D> left, Collection<? extends D> right)
      Create a SQL IN clause, if necessary partitioning to account for Oracle's maximum of 1000 parameters for each IN clause.

      For Oracle, where the collection has greater than 1000 parameters, the clause will be partitioned into multiple IN...OR...IN clauses.

      For other databases, a standard IN clause will be created.

      This method can be removed once we upgrade to QueryDSL 3.6.0 or above, when QueryDSL will split large IN clauses for us. See https://github.com/querydsl/querydsl/issues/1022
      Parameters:
      left - left value
      right - right collection
      Returns:
      the IN clause(s)
    • inAny

      public <D> com.querydsl.core.types.Predicate inAny(com.querydsl.core.types.dsl.SimpleExpression<D> left, Iterable<? extends List<? extends D>> lists)
      Create a left in right or... expression for each list This method can be removed once we upgrade to QueryDSL 3.6.0 or above, when QueryDSL introduces ExpressionUtils.inAny()
      Type Parameters:
      D - expression type
      D -
      Parameters:
      left - expression
      lists -
      Returns:
      a left in right or... expression