Package com.querydsl.jpa
Class JPAExpressions
java.lang.Object
com.querydsl.jpa.JPAExpressions
JPAExpressions provides factory methods for JPQL specific operations
elements.- Author:
- tiwe
-
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Comparable<? super A>>
ComparableExpression<A>avg(CollectionExpression<?, A> col) Create a avg(col) expressionstatic <A extends Comparable<? super A>>
ComparableExpression<A>max(CollectionExpression<?, A> left) Create a max(col) expressionstatic <A extends Comparable<? super A>>
ComparableExpression<A>min(CollectionExpression<?, A> left) Create a min(col) expressionselect(Expression<?>... exprs) Create a new detached JPQLQuery instance with the given projectionstatic <T> JPQLQuery<T>select(Expression<T> expr) Create a new detached JPQLQuery instance with the given projectionselectDistinct(Expression<?>... exprs) Create a new detached JPQLQuery instance with the given projectionstatic <T> JPQLQuery<T>selectDistinct(Expression<T> expr) Create a new detached JPQLQuery instance with the given projectionstatic <T> JPQLQuery<T>selectFrom(EntityPath<T> expr) Create a new detached JPQLQuery instance with the given projectionCreate a new detached JPQLQuery instance with the projection oneCreate a new detached JPQLQuery instance with the projection zerostatic <U extends BeanPath<? extends T>,T>
UCreate a JPA 2.1 treated path.static StringExpressiontype(EntityPath<?> path) Create a type(path) expression
-
Method Details
-
select
Create a new detached JPQLQuery instance with the given projection- Type Parameters:
T-- Parameters:
expr- projection- Returns:
- select(expr)
-
select
Create a new detached JPQLQuery instance with the given projection- Parameters:
exprs- projection- Returns:
- select(exprs)
-
selectDistinct
Create a new detached JPQLQuery instance with the given projection- Type Parameters:
T-- Parameters:
expr- projection- Returns:
- select(distinct expr)
-
selectDistinct
Create a new detached JPQLQuery instance with the given projection- Parameters:
exprs- projection- Returns:
- select(distinct expr)
-
selectZero
Create a new detached JPQLQuery instance with the projection zero- Returns:
- select(0)
-
selectOne
Create a new detached JPQLQuery instance with the projection one- Returns:
- select(1)
-
selectFrom
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 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 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
Create a type(path) expression- Parameters:
path- entity- Returns:
- type(path)
-