Class JPAExpressions


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

      • select

        public static <T> JPQLSubQuery<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 JPQLSubQuery<Tuple> select​(Expression<?>... exprs)
        Create a new detached JPQLQuery instance with the given projection
        Parameters:
        exprs - projection
        Returns:
        select(exprs)
      • selectDistinct

        public static <T> JPQLSubQuery<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 JPQLSubQuery<Tuple> selectDistinct​(Expression<?>... exprs)
        Create a new detached JPQLQuery instance with the given projection
        Parameters:
        exprs - projection
        Returns:
        select(distinct expr)
      • selectZero

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

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

        public static <T> JPQLSubQuery<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,
                                                                        java.lang.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 java.lang.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 java.lang.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 java.lang.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)