Class JPAExpressions

java.lang.Object
com.querydsl.jpa.JPAExpressions

public final class JPAExpressions extends Object
JPAExpressions provides factory methods for JPQL specific operations elements.
Author:
tiwe
  • Method Details

    • select

      public static <T> JPQLQuery<T> select(Expression<T> expr)
      Create a new detached JPQLQuery instance with the given projection
      Type Parameters:
      T -
      Parameters:
      expr - projection
      Returns:
      select(expr)
    • select

      public static JPQLQuery<Tuple> select(Expression<?>... exprs)
      Create a new detached JPQLQuery instance with the given projection
      Parameters:
      exprs - projection
      Returns:
      select(exprs)
    • selectDistinct

      public static <T> JPQLQuery<T> selectDistinct(Expression<T> expr)
      Create a new detached JPQLQuery instance with the given projection
      Type Parameters:
      T -
      Parameters:
      expr - projection
      Returns:
      select(distinct expr)
    • selectDistinct

      public static JPQLQuery<Tuple> selectDistinct(Expression<?>... exprs)
      Create a new detached JPQLQuery instance with the given projection
      Parameters:
      exprs - projection
      Returns:
      select(distinct expr)
    • selectZero

      public static JPQLQuery<Integer> selectZero()
      Create a new detached JPQLQuery instance with the projection zero
      Returns:
      select(0)
    • selectOne

      public static JPQLQuery<Integer> selectOne()
      Create a new detached JPQLQuery instance with the projection one
      Returns:
      select(1)
    • selectFrom

      public static <T> JPQLQuery<T> selectFrom(EntityPath<T> expr)
      Create a new detached JPQLQuery instance with the given projection
      Type Parameters:
      T -
      Parameters:
      expr - projection and source
      Returns:
      select(expr).from(expr)
    • treat

      public static <U extends BeanPath<? extends T>, T> U treat(BeanPath<? extends T> path, Class<U> subtype)
      Create a JPA 2.1 treated path.
      Type Parameters:
      U - the subtype class
      T - the expression type
      Parameters:
      path - The path to apply the treat operation on
      subtype - subtype class
      Returns:
      subtype instance with the same identity
    • avg

      public static <A extends Comparable<? super A>> ComparableExpression<A> avg(CollectionExpression<?,A> col)
      Create a avg(col) expression
      Parameters:
      col - collection
      Returns:
      avg(col)
    • max

      public static <A extends Comparable<? super A>> ComparableExpression<A> max(CollectionExpression<?,A> left)
      Create a max(col) expression
      Parameters:
      left - collection
      Returns:
      max(col)
    • min

      public static <A extends Comparable<? super A>> ComparableExpression<A> min(CollectionExpression<?,A> left)
      Create a min(col) expression
      Parameters:
      left - collection
      Returns:
      min(col)
    • type

      public static StringExpression type(EntityPath<?> path)
      Create a type(path) expression
      Parameters:
      path - entity
      Returns:
      type(path)