Class JPQLNextExpressions
java.lang.Object
com.blazebit.persistence.querydsl.JPQLNextExpressions
public class JPQLNextExpressions extends Object
Utility methods for creating JPQL.next expressions
- Since:
- 1.5.0
- Author:
- Jan-Willem Gmelig Meyling
-
Constructor Summary
Constructors Modifier Constructor Description protected
JPQLNextExpressions()
-
Method Summary
Modifier and Type Method Description static <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addDays(com.querydsl.core.types.dsl.DateExpression<D> date, int days)
Add the given amount of days to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addDays(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> days)
Add the given amount of days to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addDays(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int days)
Add the given amount of days to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addDays(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> days)
Add the given amount of days to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addHours(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int hours)
Add the given amount of hours to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addHours(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> hours)
Add the given amount of hours to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addMinutes(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int minutes)
Add the given amount of minutes to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addMinutes(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> minutes)
Add the given amount of minutes to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addMonths(com.querydsl.core.types.dsl.DateExpression<D> date, int months)
Add the given amount of months to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addMonths(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> months)
Add the given amount of months to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addMonths(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int months)
Add the given amount of months to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addMonths(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> months)
Add the given amount of months to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addSeconds(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int seconds)
Add the given amount of seconds to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addSeconds(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> seconds)
Add the given amount of seconds to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addWeeks(com.querydsl.core.types.dsl.DateExpression<D> date, int weeks)
Add the given amount of weeks to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addWeeks(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> weeks)
Add the given amount of weeks to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addWeeks(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int weeks)
Add the given amount of weeks to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addWeeks(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> weeks)
Add the given amount of weeks to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addYears(com.querydsl.core.types.dsl.DateExpression<D> date, int years)
Add the given amount of years to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>addYears(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> years)
Add the given amount of years to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addYears(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int years)
Add the given amount of years to the datestatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>addYears(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> years)
Add the given amount of years to the datestatic FilterableWindowOver<Boolean>
all(com.querydsl.core.types.Expression<Boolean> expr)
Start a window function expressionstatic FilterableWindowOver<Boolean>
any(com.querydsl.core.types.Expression<Boolean> expr)
Start a window function expressionstatic <A extends Comparable<? super A>>
com.querydsl.core.types.dsl.ComparableExpression<A>avg(com.querydsl.core.types.CollectionExpression<?,A> col)
Create a avg(col) expressionstatic <T extends Number>
FilterableWindowOver<T>avg(com.querydsl.core.types.Expression<T> expr)
Start a window function expressionstatic <T> com.querydsl.core.types.Operation<T>
bind(com.querydsl.core.types.Path<? super T> path, com.querydsl.core.types.Expression<T> expression)
Create a CTE bind expression.static <T> com.querydsl.core.types.Expression<T>
cast(Class<T> result, com.querydsl.core.types.Expression<?> expression)
A cast invocation will always generate a ANSI SQL cast.static FilterableWindowOver<Long>
count()
Start a window function expressionstatic FilterableWindowOver<Long>
count(com.querydsl.core.types.Expression<?> expr)
Start a window function expressionstatic FilterableWindowOver<Long>
countDistinct(com.querydsl.core.types.Expression<?> expr)
Start a window function expressionstatic FilterableWindowOver<Double>
cumeDist()
CUME_DIST calculates the cumulative distribution of a value in a group of values.static <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>dateadd(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> date, int amount)
Create a dateadd(unit, date, amount) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>dateadd(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> amountExpression)
Create a dateadd(unit, date, amountExpression) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>dateadd(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> date, int amount)
Create a dateadd(unit, date, amount) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>dateadd(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> amountExpression)
Create a dateadd(unit, date, amountExpression) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.NumberExpression<Integer>datediff(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> start, com.querydsl.core.types.dsl.DateExpression<D> end)
Get a datediff(unit, start, end) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.NumberExpression<Integer>datediff(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> start, D end)
Get a datediff(unit, start, end) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.NumberExpression<Integer>datediff(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> start, com.querydsl.core.types.dsl.DateTimeExpression<D> end)
Get a datediff(unit, start, end) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.NumberExpression<Integer>datediff(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> start, D end)
Get a datediff(unit, start, end) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.NumberExpression<Integer>datediff(DatePart unit, D start, com.querydsl.core.types.dsl.DateExpression<D> end)
Get a datediff(unit, start, end) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.NumberExpression<Integer>datediff(DatePart unit, D start, com.querydsl.core.types.dsl.DateTimeExpression<D> end)
Get a datediff(unit, start, end) expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateExpression<D>datetrunc(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> expr)
Truncate the given date expressionstatic <D extends Comparable<?>>
com.querydsl.core.types.dsl.DateTimeExpression<D>datetrunc(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> expr)
Truncate the given datetime expressionstatic FilterableWindowOver<Long>
denseRank()
rank of the current row without gaps; this function counts peer groupsstatic <T> FilterableWindowOver<T>
firstValue(com.querydsl.core.types.Expression<T> expr)
returns value evaluated at the row that is the first row of the window framestatic <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>greatest(com.querydsl.core.types.Expression<T> a, com.querydsl.core.types.Expression<T> b)
Returns the greatest value of all given arguments.static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>greatest(com.querydsl.core.types.Expression<T> a, T b)
Returns the greatest value of all given arguments.static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>greatest(T a, com.querydsl.core.types.Expression<T> b)
Returns the greatest value of all given arguments.static com.querydsl.core.types.dsl.StringExpression
groupConcat(boolean distinct, com.querydsl.core.types.Expression<?> expression, com.querydsl.core.types.Expression<String> separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.static com.querydsl.core.types.dsl.StringExpression
groupConcat(boolean distinct, com.querydsl.core.types.Expression<?> expression, String separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.static com.querydsl.core.types.dsl.StringExpression
groupConcat(com.querydsl.core.types.Expression<?> expression, com.querydsl.core.types.Expression<String> separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.static com.querydsl.core.types.dsl.StringExpression
groupConcat(com.querydsl.core.types.Expression<?> expression, String separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)
Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.static <T> FilterableWindowOver<T>
lag(com.querydsl.core.types.Expression<T> expr)
expr evaluated at the row that is one row before the current row within the partitionstatic <T> FilterableWindowOver<T>
lastValue(com.querydsl.core.types.Expression<T> expr)
returns value evaluated at the row that is the last row of the window framestatic <T> FilterableWindowOver<T>
lead(com.querydsl.core.types.Expression<T> expr)
expr evaluated at the row that is one row after the current row within the partition;static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>least(com.querydsl.core.types.Expression<T> a, com.querydsl.core.types.Expression<T> b)
Returns the smallest value of all given arguments.static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>least(com.querydsl.core.types.Expression<T> a, T b)
Returns the smallest value of all given arguments.static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>least(T a, com.querydsl.core.types.Expression<T> b)
Returns the smallest value of all given arguments.static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>literal(Class<T> clasz, T value)
Create a literal expression for the specified value.static <T extends Comparable<? super T>>
com.querydsl.core.types.Expression<T>literal(T value)
Create a literal expression for the specified value.static <A extends Comparable<? super A>>
com.querydsl.core.types.dsl.ComparableExpression<A>max(com.querydsl.core.types.CollectionExpression<?,A> left)
Create a max(col) expressionstatic <T extends Comparable<? super T>>
FilterableWindowOver<T>max(com.querydsl.core.types.Expression<T> expr)
Start a window function expressionstatic <A extends Comparable<? super A>>
com.querydsl.core.types.dsl.ComparableExpression<A>min(com.querydsl.core.types.CollectionExpression<?,A> left)
Create a min(col) expressionstatic <T extends Comparable<? super T>>
FilterableWindowOver<T>min(com.querydsl.core.types.Expression<T> expr)
Start a window function expressionstatic <T> FilterableWindowOver<T>
nthValue(com.querydsl.core.types.Expression<T> expr, com.querydsl.core.types.Expression<? extends Number> n)
NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause.static <T> FilterableWindowOver<T>
nthValue(com.querydsl.core.types.Expression<T> expr, Number n)
NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause.static <T extends Number & Comparable>
FilterableWindowOver<T>ntile(T num)
divides an ordered data set into a number of buckets indicated by expr and assigns the appropriate bucket number to each rowstatic FilterableWindowOver<Double>
percentRank()
As an analytic function, for a row r, PERCENT_RANK calculates the rank of r minus 1, divided by 1 less than the number of rows being evaluated (the entire query result set or a partition).static FilterableWindowOver<Long>
rank()
rank of the current row with gaps; same as row_number of its first peerstatic FilterableWindowOver<Long>
rowNumber()
number of the current row within its partition, counting from 1static BlazeJPAQuery<com.querydsl.core.Tuple>
select(com.querydsl.core.types.Expression<?>... exprs)
Create a new detached JPQLQuery instance with the given projectionstatic <T> BlazeJPAQuery<T>
select(com.querydsl.core.types.Expression<T> expr)
Create a new detached JPQLQuery instance with the given projectionstatic BlazeJPAQuery<com.querydsl.core.Tuple>
selectDistinct(com.querydsl.core.types.Expression<?>... exprs)
Create a new detached JPQLQuery instance with the given projectionstatic <T> BlazeJPAQuery<T>
selectDistinct(com.querydsl.core.types.Expression<T> expr)
Create a new detached JPQLQuery instance with the given projectionstatic <T> BlazeJPAQuery<T>
selectFrom(com.querydsl.core.types.EntityPath<T> expr)
Create a new detached JPQLQuery instance with the given projectionstatic BlazeJPAQuery<Integer>
selectOne()
Create a new detached JPQLQuery instance with the projection onestatic BlazeJPAQuery<Integer>
selectZero()
Create a new detached JPQLQuery instance with the projection zerostatic <T extends Number>
FilterableWindowOver<T>sum(com.querydsl.core.types.Expression<T> expr)
Start a window function expressionstatic <T> com.querydsl.core.types.Expression<T>
treat(Class<T> result, com.querydsl.core.types.Expression<?> expression)
A treat invocation will only adjust the type of the expression in the JPQL expression and not cause an explicit cast on the DBMS side.static com.querydsl.core.types.dsl.StringExpression
type(com.querydsl.core.types.EntityPath<?> path)
Create a type(path) expression
-
Constructor Details
-
JPQLNextExpressions
protected JPQLNextExpressions()
-
-
Method Details
-
select
Create a new detached JPQLQuery instance with the given projection- Type Parameters:
T
- result type- Parameters:
expr
- projection- Returns:
- select(expr)
- See Also:
JPAExpressions.select(Expression)
-
select
public static BlazeJPAQuery<com.querydsl.core.Tuple> select(com.querydsl.core.types.Expression<?>... exprs)Create a new detached JPQLQuery instance with the given projection- Parameters:
exprs
- projection- Returns:
- select(exprs)
- See Also:
JPAExpressions.select(Expression[])
-
selectDistinct
Create a new detached JPQLQuery instance with the given projection- Type Parameters:
T
- result type- Parameters:
expr
- projection- Returns:
- select(distinct expr)
- See Also:
JPAExpressions.selectDistinct(Expression)
-
selectDistinct
public static BlazeJPAQuery<com.querydsl.core.Tuple> selectDistinct(com.querydsl.core.types.Expression<?>... exprs)Create a new detached JPQLQuery instance with the given projection- Parameters:
exprs
- projection- Returns:
- select(distinct expr)
- See Also:
JPAExpressions.selectDistinct(Expression[])
-
selectZero
Create a new detached JPQLQuery instance with the projection zero- Returns:
- select(0)
- See Also:
JPAExpressions.selectZero()
-
selectOne
Create a new detached JPQLQuery instance with the projection one- Returns:
- select(1)
- See Also:
JPAExpressions.selectOne()
-
selectFrom
Create a new detached JPQLQuery instance with the given projection- Type Parameters:
T
- result type- Parameters:
expr
- projection and source- Returns:
- select(expr).from(expr)
-
avg
public static <A extends Comparable<? super A>> com.querydsl.core.types.dsl.ComparableExpression<A> avg(com.querydsl.core.types.CollectionExpression<?,A> col)Create a avg(col) expression- Type Parameters:
A
- collection element type- Parameters:
col
- collection- Returns:
- avg(col)
- See Also:
JPAExpressions.avg(CollectionExpression)
-
max
public static <A extends Comparable<? super A>> com.querydsl.core.types.dsl.ComparableExpression<A> max(com.querydsl.core.types.CollectionExpression<?,A> left)Create a max(col) expression- Type Parameters:
A
- collection element type- Parameters:
left
- collection- Returns:
- max(col)
- See Also:
JPAExpressions.max(CollectionExpression)
-
min
public static <A extends Comparable<? super A>> com.querydsl.core.types.dsl.ComparableExpression<A> min(com.querydsl.core.types.CollectionExpression<?,A> left)Create a min(col) expression- Type Parameters:
A
- collection element type- Parameters:
left
- collection- Returns:
- min(col)
- See Also:
JPAExpressions.min(CollectionExpression)
-
type
public static com.querydsl.core.types.dsl.StringExpression type(com.querydsl.core.types.EntityPath<?> path)Create a type(path) expression- Parameters:
path
- entity- Returns:
- type(path)
- See Also:
JPAExpressions.type(EntityPath)
-
dateadd
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> dateadd(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> date, int amount)Create a dateadd(unit, date, amount) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partdate
- dateamount
- amount- Returns:
- converted date
- See Also:
SQLExpressions.dateadd(com.querydsl.sql.DatePart, DateExpression, int)
-
dateadd
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> dateadd(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> date, int amount)Create a dateadd(unit, date, amount) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partdate
- dateamount
- amount- Returns:
- converted date
- See Also:
SQLExpressions.dateadd(com.querydsl.sql.DatePart, DateExpression, int)
-
dateadd
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> dateadd(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> amountExpression)Create a dateadd(unit, date, amountExpression) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partdate
- dateamountExpression
- amountExpression- Returns:
- converted date
- See Also:
SQLExpressions.dateadd(com.querydsl.sql.DatePart, DateExpression, int)
-
dateadd
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> dateadd(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> amountExpression)Create a dateadd(unit, date, amountExpression) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partdate
- dateamountExpression
- amountExpression- Returns:
- converted date
- See Also:
SQLExpressions.dateadd(com.querydsl.sql.DatePart, DateExpression, int)
-
datediff
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.NumberExpression<Integer> datediff(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> start, com.querydsl.core.types.dsl.DateExpression<D> end)Get a datediff(unit, start, end) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partstart
- startend
- end- Returns:
- difference in units
- See Also:
SQLExpressions.datediff(com.querydsl.sql.DatePart, DateExpression, DateExpression)
-
datediff
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.NumberExpression<Integer> datediff(DatePart unit, D start, com.querydsl.core.types.dsl.DateExpression<D> end)Get a datediff(unit, start, end) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partstart
- startend
- end- Returns:
- difference in units
- See Also:
SQLExpressions.datediff(com.querydsl.sql.DatePart, Comparable, DateExpression)
-
datediff
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.NumberExpression<Integer> datediff(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> start, D end)Get a datediff(unit, start, end) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partstart
- startend
- end- Returns:
- difference in units
- See Also:
SQLExpressions.datediff(com.querydsl.sql.DatePart, Comparable, DateExpression)
-
datediff
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.NumberExpression<Integer> datediff(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> start, com.querydsl.core.types.dsl.DateTimeExpression<D> end)Get a datediff(unit, start, end) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partstart
- startend
- end- Returns:
- difference in units
- See Also:
SQLExpressions.datediff(com.querydsl.sql.DatePart, Comparable, DateTimeExpression)
-
datediff
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.NumberExpression<Integer> datediff(DatePart unit, D start, com.querydsl.core.types.dsl.DateTimeExpression<D> end)Get a datediff(unit, start, end) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partstart
- startend
- end- Returns:
- difference in units
- See Also:
SQLExpressions.datediff(com.querydsl.sql.DatePart, Comparable, DateTimeExpression)
-
datediff
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.NumberExpression<Integer> datediff(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> start, D end)Get a datediff(unit, start, end) expression- Type Parameters:
D
- date type- Parameters:
unit
- date partstart
- startend
- end- Returns:
- difference in units
- See Also:
SQLExpressions.datediff(com.querydsl.sql.DatePart, Comparable, DateTimeExpression)
-
datetrunc
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> datetrunc(DatePart unit, com.querydsl.core.types.dsl.DateExpression<D> expr)Truncate the given date expression- Type Parameters:
D
- date type- Parameters:
unit
- date part to truncate toexpr
- truncated date- Returns:
- date trunc expression
- See Also:
SQLExpressions.datetrunc(com.querydsl.sql.DatePart, DateExpression)
-
datetrunc
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> datetrunc(DatePart unit, com.querydsl.core.types.dsl.DateTimeExpression<D> expr)Truncate the given datetime expression- Type Parameters:
D
- date type- Parameters:
unit
- com.querydsl.sql.DatePart to truncate toexpr
- truncated datetime- Returns:
- date trunc expression
- See Also:
SQLExpressions.datetrunc(com.querydsl.sql.DatePart, DateTimeExpression)
-
addYears
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addYears(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int years)Add the given amount of years to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeyears
- years to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addYears(DateExpression, int)
-
addMonths
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addMonths(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int months)Add the given amount of months to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimemonths
- months to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addYears(DateTimeExpression, int)
-
addWeeks
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addWeeks(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int weeks)Add the given amount of weeks to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeweeks
- weeks to add- Returns:
- converted date
- See Also:
SQLExpressions.addWeeks(DateTimeExpression, int)
-
addDays
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addDays(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int days)Add the given amount of days to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimedays
- days to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addDays(DateTimeExpression, int)
-
addHours
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addHours(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int hours)Add the given amount of hours to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimehours
- hours to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addHours(DateTimeExpression, int)
-
addMinutes
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addMinutes(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int minutes)Add the given amount of minutes to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeminutes
- minutes to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addMinutes(DateTimeExpression, int)
-
addSeconds
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addSeconds(com.querydsl.core.types.dsl.DateTimeExpression<D> date, int seconds)Add the given amount of seconds to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeseconds
- seconds to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addSeconds(DateTimeExpression, int)
-
addYears
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addYears(com.querydsl.core.types.dsl.DateExpression<D> date, int years)Add the given amount of years to the date- Type Parameters:
D
- date type- Parameters:
date
- dateyears
- years to add- Returns:
- converted date
- See Also:
SQLExpressions.addYears(DateExpression, int)
-
addMonths
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addMonths(com.querydsl.core.types.dsl.DateExpression<D> date, int months)Add the given amount of months to the date- Type Parameters:
D
- date type- Parameters:
date
- datemonths
- months to add- Returns:
- converted date
- See Also:
SQLExpressions.addMonths(DateExpression, int)
-
addWeeks
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addWeeks(com.querydsl.core.types.dsl.DateExpression<D> date, int weeks)Add the given amount of weeks to the date- Type Parameters:
D
- date type- Parameters:
date
- dateweeks
- weeks to add- Returns:
- converted date
- See Also:
SQLExpressions.addWeeks(DateExpression, int)
-
addDays
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addDays(com.querydsl.core.types.dsl.DateExpression<D> date, int days)Add the given amount of days to the date- Type Parameters:
D
- date type- Parameters:
date
- datedays
- days to add- Returns:
- converted date
- See Also:
SQLExpressions.addDays(DateExpression, int)
-
addYears
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addYears(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> years)Add the given amount of years to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeyears
- years to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addYears(DateExpression, int)
-
addMonths
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addMonths(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> months)Add the given amount of months to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimemonths
- months to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addYears(DateTimeExpression, int)
-
addWeeks
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addWeeks(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> weeks)Add the given amount of weeks to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeweeks
- weeks to add- Returns:
- converted date
- See Also:
SQLExpressions.addWeeks(DateTimeExpression, int)
-
addDays
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addDays(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> days)Add the given amount of days to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimedays
- days to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addDays(DateTimeExpression, int)
-
addHours
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addHours(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> hours)Add the given amount of hours to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimehours
- hours to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addHours(DateTimeExpression, int)
-
addMinutes
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addMinutes(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> minutes)Add the given amount of minutes to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeminutes
- minutes to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addMinutes(DateTimeExpression, int)
-
addSeconds
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateTimeExpression<D> addSeconds(com.querydsl.core.types.dsl.DateTimeExpression<D> date, com.querydsl.core.types.Expression<Integer> seconds)Add the given amount of seconds to the date- Type Parameters:
D
- date type- Parameters:
date
- datetimeseconds
- seconds to add- Returns:
- converted datetime
- See Also:
SQLExpressions.addSeconds(DateTimeExpression, int)
-
addYears
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addYears(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> years)Add the given amount of years to the date- Type Parameters:
D
- date type- Parameters:
date
- dateyears
- years to add- Returns:
- converted date
- See Also:
SQLExpressions.addYears(DateExpression, int)
-
addMonths
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addMonths(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> months)Add the given amount of months to the date- Type Parameters:
D
- date type- Parameters:
date
- datemonths
- months to add- Returns:
- converted date
- See Also:
SQLExpressions.addMonths(DateExpression, int)
-
addWeeks
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addWeeks(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> weeks)Add the given amount of weeks to the date- Type Parameters:
D
- date type- Parameters:
date
- dateweeks
- weeks to add- Returns:
- converted date
- See Also:
SQLExpressions.addWeeks(DateExpression, int)
-
addDays
public static <D extends Comparable<?>> com.querydsl.core.types.dsl.DateExpression<D> addDays(com.querydsl.core.types.dsl.DateExpression<D> date, com.querydsl.core.types.Expression<Integer> days)Add the given amount of days to the date- Type Parameters:
D
- date type- Parameters:
date
- datedays
- days to add- Returns:
- converted date
- See Also:
SQLExpressions.addDays(DateExpression, int)
-
all
Start a window function expression- Parameters:
expr
- expression- Returns:
- all(expr)
-
any
Start a window function expression- Parameters:
expr
- expression- Returns:
- any(expr)
-
sum
public static <T extends Number> FilterableWindowOver<T> sum(com.querydsl.core.types.Expression<T> expr)Start a window function expression- Type Parameters:
T
- number expression type- Parameters:
expr
- expression- Returns:
- sum(expr)
-
count
Start a window function expression- Returns:
- count()
-
count
Start a window function expression- Parameters:
expr
- expression- Returns:
- count(expr)
-
countDistinct
Start a window function expression- Parameters:
expr
- expression- Returns:
- count(distinct expr)
-
avg
public static <T extends Number> FilterableWindowOver<T> avg(com.querydsl.core.types.Expression<T> expr)Start a window function expression- Type Parameters:
T
- number expression type- Parameters:
expr
- expression- Returns:
- avg(expr)
-
min
public static <T extends Comparable<? super T>> FilterableWindowOver<T> min(com.querydsl.core.types.Expression<T> expr)Start a window function expression- Type Parameters:
T
- number expression type- Parameters:
expr
- expression- Returns:
- min(expr)
-
max
public static <T extends Comparable<? super T>> FilterableWindowOver<T> max(com.querydsl.core.types.Expression<T> expr)Start a window function expression- Type Parameters:
T
- number expression type- Parameters:
expr
- expression- Returns:
- max(expr)
-
lead
expr evaluated at the row that is one row after the current row within the partition;- Type Parameters:
T
- number expression type- Parameters:
expr
- expression- Returns:
- lead(expr)
-
lag
expr evaluated at the row that is one row before the current row within the partition- Type Parameters:
T
- number expression type- Parameters:
expr
- expression- Returns:
- lag(expr)
-
nthValue
public static <T> FilterableWindowOver<T> nthValue(com.querydsl.core.types.Expression<T> expr, Number n)NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause. The returned value has the data type of the expr.- Type Parameters:
T
- number expression type- Parameters:
expr
- measure expressionn
- one based row index- Returns:
- nth_value(expr, n)
-
nthValue
public static <T> FilterableWindowOver<T> nthValue(com.querydsl.core.types.Expression<T> expr, com.querydsl.core.types.Expression<? extends Number> n)NTH_VALUE returns the expr value of the nth row in the window defined by the analytic clause. The returned value has the data type of the expr- Type Parameters:
T
- number expression type- Parameters:
expr
- measure expressionn
- one based row index- Returns:
- nth_value(expr, n)
-
ntile
divides an ordered data set into a number of buckets indicated by expr and assigns the appropriate bucket number to each row- Type Parameters:
T
- number expression type- Parameters:
num
- bucket size- Returns:
- ntile(num)
-
rank
rank of the current row with gaps; same as row_number of its first peer- Returns:
- rank()
-
denseRank
rank of the current row without gaps; this function counts peer groups- Returns:
- dense_rank()
-
percentRank
As an analytic function, for a row r, PERCENT_RANK calculates the rank of r minus 1, divided by 1 less than the number of rows being evaluated (the entire query result set or a partition).- Returns:
- percent_rank()
-
cumeDist
CUME_DIST calculates the cumulative distribution of a value in a group of values.- Returns:
- cume_dist()
-
rowNumber
number of the current row within its partition, counting from 1- Returns:
- row_number()
-
firstValue
returns value evaluated at the row that is the first row of the window frame- Type Parameters:
T
- number expression type- Parameters:
expr
- argument- Returns:
- first_value(expr)
-
lastValue
returns value evaluated at the row that is the last row of the window frame- Type Parameters:
T
- number expression type- Parameters:
expr
- argument- Returns:
- last_value(expr)
-
greatest
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> greatest(T a, com.querydsl.core.types.Expression<T> b)Returns the greatest value of all given arguments.- Type Parameters:
T
- type- Parameters:
a
- lhsb
- rhs- Returns:
- greatest operation
-
greatest
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> greatest(com.querydsl.core.types.Expression<T> a, T b)Returns the greatest value of all given arguments.- Type Parameters:
T
- type- Parameters:
a
- lhsb
- rhs- Returns:
- greatest operation
-
greatest
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> greatest(com.querydsl.core.types.Expression<T> a, com.querydsl.core.types.Expression<T> b)Returns the greatest value of all given arguments.- Type Parameters:
T
- type- Parameters:
a
- lhsb
- rhs- Returns:
- greatest operation
-
least
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> least(T a, com.querydsl.core.types.Expression<T> b)Returns the smallest value of all given arguments.- Type Parameters:
T
- type- Parameters:
a
- lhsb
- rhs- Returns:
- least operation
-
least
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> least(com.querydsl.core.types.Expression<T> a, T b)Returns the smallest value of all given arguments.- Type Parameters:
T
- type- Parameters:
a
- lhsb
- rhs- Returns:
- least operation
-
least
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> least(com.querydsl.core.types.Expression<T> a, com.querydsl.core.types.Expression<T> b)Returns the smallest value of all given arguments.- Type Parameters:
T
- type- Parameters:
a
- lhsb
- rhs- Returns:
- least operation
-
literal
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> literal(Class<T> clasz, T value)Create a literal expression for the specified value.- Type Parameters:
T
- value type- Parameters:
clasz
- typevalue
- value to render as literal- Returns:
- the literal value
-
literal
public static <T extends Comparable<? super T>> com.querydsl.core.types.Expression<T> literal(T value)Create a literal expression for the specified value.- Type Parameters:
T
- value type- Parameters:
value
- value to render as literal- Returns:
- the literal value
-
groupConcat
public static com.querydsl.core.types.dsl.StringExpression groupConcat(com.querydsl.core.types.Expression<?> expression, String separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.- Parameters:
expression
- Expression to aggregateseparator
- Separator to aggregate byorderSpecifiers
- Order specificers for the values- Returns:
- Group concat expression
-
groupConcat
public static com.querydsl.core.types.dsl.StringExpression groupConcat(com.querydsl.core.types.Expression<?> expression, com.querydsl.core.types.Expression<String> separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.- Parameters:
expression
- Expression to aggregateseparator
- Separator to aggregate byorderSpecifiers
- Order specificers for the values- Returns:
- Group concat expression
-
groupConcat
public static com.querydsl.core.types.dsl.StringExpression groupConcat(boolean distinct, com.querydsl.core.types.Expression<?> expression, String separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.- Parameters:
distinct
- Filter unique resultsexpression
- Expression to aggregateseparator
- Separator to aggregate byorderSpecifiers
- Order specificers for the values- Returns:
- Group concat expression
-
groupConcat
public static com.querydsl.core.types.dsl.StringExpression groupConcat(boolean distinct, com.querydsl.core.types.Expression<?> expression, com.querydsl.core.types.Expression<String> separator, com.querydsl.core.types.OrderSpecifier<?>... orderSpecifiers)Aggregates/concatenates the values produced by expression to a single string separated byseparator
in the order defined by theorderSpecifiers
.- Parameters:
distinct
- Filter unique resultsexpression
- Expression to aggregateseparator
- Separator to aggregate byorderSpecifiers
- Order specificers for the values- Returns:
- Group concat expression
-
cast
public static <T> com.querydsl.core.types.Expression<T> cast(Class<T> result, com.querydsl.core.types.Expression<?> expression)A cast invocation will always generate a ANSI SQL cast. The SQL data type for a Java type is determined byDbmsDialect.getSqlType()
. By providing a custom DBMS dialect you can override these types.- Type Parameters:
T
- Expression type- Parameters:
result
- Type to cast the value asexpression
- Expression- Returns:
- The casted expression
-
treat
public static <T> com.querydsl.core.types.Expression<T> treat(Class<T> result, com.querydsl.core.types.Expression<?> expression)A treat invocation will only adjust the type of the expression in the JPQL expression and not cause an explicit cast on the DBMS side. This can be used for cases when the type of an expression is actually known but can’t be inferred. This function is used internally and no user should ever have the need for this!- Type Parameters:
T
- Expression type- Parameters:
result
- Type to treat the value asexpression
- Expression- Returns:
- The treated expression
-
bind
public static <T> com.querydsl.core.types.Operation<T> bind(com.querydsl.core.types.Path<? super T> path, com.querydsl.core.types.Expression<T> expression)Create a CTE bind expression.- Type Parameters:
T
- Common type for path and value- Parameters:
path
- Path expression to bindexpression
- Value to which path should be bound- Returns:
- Operation result
-