aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2016-04-04 19:32:44 -0400
committerJames Moger <james.moger@gitblit.com>2016-04-04 19:32:44 -0400
commit2523ad5454716a9e08f0d3220a92760aa50773e2 (patch)
tree71a5404dfdaadcef114fa27ebc47b7023b371f3f /src/main
parent27979f07905dbf95b478a48babc99643d71bfdec (diff)
downloadiciql-2523ad5454716a9e08f0d3220a92760aa50773e2.tar.gz
iciql-2523ad5454716a9e08f0d3220a92760aa50773e2.zip
Fixes #21: Order by descending on primitives
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/iciql/Query.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/com/iciql/Query.java b/src/main/java/com/iciql/Query.java
index f8fd4ca..7a8a1ff 100644
--- a/src/main/java/com/iciql/Query.java
+++ b/src/main/java/com/iciql/Query.java
@@ -736,6 +736,38 @@ public class Query<T> {
return this;
}
+ public Query<T> orderByDesc(byte field) {
+ return orderByDescPrimitive(field);
+ }
+
+ public Query<T> orderByDesc(short field) {
+ return orderByDescPrimitive(field);
+ }
+
+ public Query<T> orderByDesc(int field) {
+ return orderByDescPrimitive(field);
+ }
+
+ public Query<T> orderByDesc(long field) {
+ return orderByDescPrimitive(field);
+ }
+
+ public Query<T> orderByDesc(float field) {
+ return orderByDescPrimitive(field);
+ }
+
+ public Query<T> orderByDesc(double field) {
+ return orderByDescPrimitive(field);
+ }
+
+ Query<T> orderByDescPrimitive(Object field) {
+ Object alias = getPrimitiveAliasByValue(field);
+ if (alias == null) {
+ return orderByDesc(field);
+ }
+ return orderByDesc(alias);
+ }
+
public Query<T> orderByDesc(Object expr) {
OrderExpression<T> e = new OrderExpression<T>(this, expr, true, false, false);
addOrderBy(e);