]> source.dussan.org Git - iciql.git/commitdiff
Fixes #20: Add groupBy methods to QueryWhere
authorJames Moger <james.moger@gitblit.com>
Mon, 4 Apr 2016 15:37:24 +0000 (11:37 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 4 Apr 2016 15:37:24 +0000 (11:37 -0400)
releases.moxie
src/main/java/com/iciql/QueryWhere.java

index 65bb94593bb9c558ef9a4a85a1ebf6e5dbbd5ef7..44135648ab3c9fbf6875ca5e0717fdca8ca0b4b8 100644 (file)
@@ -11,7 +11,8 @@ r30: {
     security: ~
     fixes: ~
     changes: ~
-    additions: ~
+    additions:
+    - Added groupBy methods to QueryWhere
     dependencyChanges: ~
     contributors: ~
 }
index 731fc0b7f85aa666ae64f1e44d3926eeb7bb65e6..fdce1cbab86f501d442d9b7a88a8c01315a2ad47 100644 (file)
@@ -532,6 +532,101 @@ public class QueryWhere<T> {
                return this;\r
        }\r
 \r
+       /**\r
+        * Group by primitive boolean field\r
+        *\r
+        * @param field\r
+        *            a primitive boolean field\r
+        * @return the query\r
+        */\r
+       public QueryWhere<T> groupBy(boolean field) {\r
+               query.getFrom().getAliasDefinition().checkMultipleBooleans();\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       /**\r
+        * Group by primitive byte field\r
+        *\r
+        * @param field\r
+        *            a primitive byte field\r
+        * @return the query\r
+        */\r
+       public QueryWhere<T> groupBy(byte field) {\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       /**\r
+        * Group by primitive short field\r
+        *\r
+        * @param field\r
+        *            a primitive short field\r
+        * @return the query\r
+        */\r
+       public QueryWhere<T> groupBy(short field) {\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       public QueryWhere<T> groupBy(int field) {\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       /**\r
+        * Group by primitive long field\r
+        *\r
+        * @param field\r
+        *            a primitive long field\r
+        * @return the query\r
+        */\r
+       public QueryWhere<T> groupBy(long field) {\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       /**\r
+        * Group by primitive float field\r
+        *\r
+        * @param field\r
+        *            a primitive float field\r
+        * @return the query\r
+        */\r
+       public QueryWhere<T> groupBy(float field) {\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       /**\r
+        * Group by primitive double field\r
+        *\r
+        * @param field\r
+        *            a primitive double field\r
+        * @return the query\r
+        */\r
+       public QueryWhere<T> groupBy(double field) {\r
+               return groupByPrimitive(field);\r
+       }\r
+\r
+       private QueryWhere<T> groupByPrimitive(Object field) {\r
+               query.groupByPrimitive(field);\r
+               return this;\r
+       }\r
+\r
+       public QueryWhere<T> groupBy(Object field) {\r
+               query.getFrom().getAliasDefinition().checkMultipleEnums(field);\r
+               query.groupBy(field);\r
+               return this;\r
+       }\r
+\r
+       /**\r
+        * Group by a number of Object columns.\r
+        *\r
+        * @param expressions\r
+        *            the group by expressions\r
+        * @return the query\r
+        */\r
+\r
+       public QueryWhere<T> groupBy(Object... expressions) {\r
+               query.groupBy(expressions);\r
+               return this;\r
+       }\r
+\r
        public int delete() {\r
                return query.delete();\r
        }\r