mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
added asc and desc support to QComparable
This commit is contained in:
parent
acf57e95ea
commit
acc654023b
@ -15,7 +15,7 @@ import com.mysema.query.util.Assert;
|
||||
* @author tiwe
|
||||
* @version $Id$
|
||||
*/
|
||||
public class OrderSpecifier<A extends Comparable<? super A>> {
|
||||
public class OrderSpecifier<A extends Comparable<?>> {
|
||||
private final Order order;
|
||||
private final Expr<A> target;
|
||||
|
||||
|
||||
@ -59,4 +59,14 @@ public class QComparable {
|
||||
public static <A extends Comparable> EBoolean aoe(Expr<A> left, Expr<A> right) {
|
||||
return factory.createBoolean(Ops.AOE, left, right);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <A extends Comparable> OrderSpecifier asc(Expr<A> expr){
|
||||
return new OrderSpecifier<A>(Order.ASC, expr);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <A extends Comparable> OrderSpecifier desc(Expr<A> expr){
|
||||
return new OrderSpecifier<A>(Order.DESC, expr);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user