added orderBy to CustomQueryable

added isAscending() to OrderSpecifier
This commit is contained in:
Timo Westkämper 2009-04-19 09:09:36 +00:00
parent 3d918df73e
commit 1ec0bbbb2d
2 changed files with 18 additions and 7 deletions

View File

@ -15,6 +15,7 @@ import com.mysema.query.collections.ColQuery;
import com.mysema.query.collections.IteratorSource;
import com.mysema.query.collections.QueryIndexSupport;
import com.mysema.query.grammar.JavaOps;
import com.mysema.query.grammar.OrderSpecifier;
import com.mysema.query.grammar.types.Expr;
import com.mysema.query.util.Assert;
@ -51,16 +52,22 @@ public class CustomQueryable<SubType extends CustomQueryable<SubType>> extends P
setProjectable(innerQuery);
}
@SuppressWarnings("unchecked")
public SubType from(Expr<?>... o) {
innerQuery.from(o);
return _this;
}
protected ColQuery getInnerQuery(){
return innerQuery;
}
public SubType from(Expr<?>... o) {
innerQuery.from(o);
return _this;
}
public SubType orderBy(OrderSpecifier<?>... o) {
innerQuery.orderBy(o);
return _this;
}
public SubType where(Expr.EBoolean... o) {
innerQuery.where(o);
return _this;

View File

@ -27,7 +27,11 @@ public class OrderSpecifier<A extends Comparable<? super A>> {
public Order getOrder() {
return order;
}
public boolean isAscending(){
return order == Order.ASC;
}
public Expr<A> getTarget() {
return target;
}