Package com.querydsl.jpa
Class JPAExpressions
- java.lang.Object
-
- com.querydsl.jpa.JPAExpressions
-
public final class JPAExpressions extends java.lang.ObjectJPAExpressionsprovides factory methods for JPQL specific operations elements.- Author:
- tiwe
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <A extends java.lang.Comparable<? super A>>
ComparableExpression<A>avg(CollectionExpression<?,A> col)Create a avg(col) expressionstatic <A extends java.lang.Comparable<? super A>>
ComparableExpression<A>max(CollectionExpression<?,A> left)Create a max(col) expressionstatic <A extends java.lang.Comparable<? super A>>
ComparableExpression<A>min(CollectionExpression<?,A> left)Create a min(col) expressionstatic JPQLSubQuery<Tuple>select(Expression<?>... exprs)Create a new detached JPQLQuery instance with the given projectionstatic <T> JPQLSubQuery<T>select(Expression<T> expr)Create a new detached JPQLQuery instance with the given projectionstatic JPQLSubQuery<Tuple>selectDistinct(Expression<?>... exprs)Create a new detached JPQLQuery instance with the given projectionstatic <T> JPQLSubQuery<T>selectDistinct(Expression<T> expr)Create a new detached JPQLQuery instance with the given projectionstatic <T> JPQLSubQuery<T>selectFrom(EntityPath<T> expr)Create a new detached JPQLQuery instance with the given projectionstatic JPQLSubQuery<java.lang.Integer>selectOne()Create a new detached JPQLQuery instance with the projection onestatic JPQLSubQuery<java.lang.Integer>selectZero()Create a new detached JPQLQuery instance with the projection zerostatic <U extends BeanPath<? extends T>,T>
Utreat(BeanPath<? extends T> path, java.lang.Class<U> subtype)Create a JPA 2.1 treated path.static StringExpressiontype(EntityPath<?> path)Create a type(path) expression
-
-
-
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 classT- the expression type- Parameters:
path- The path to apply the treat operation onsubtype- 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)
-
-