diff options
author | James Moger <james.moger@gitblit.com> | 2016-04-04 11:37:24 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2016-04-04 11:37:24 -0400 |
commit | 5ede276035ef01d5e3901fe36c45d1bd05efbf8b (patch) | |
tree | a968fa0fe4489a84c1b05c61e074b543dcf8544a /src/main/java/com/iciql/QueryWhere.java | |
parent | f3f46f1dcd98e9c50e443f2daad42f08061ce668 (diff) | |
download | iciql-5ede276035ef01d5e3901fe36c45d1bd05efbf8b.tar.gz iciql-5ede276035ef01d5e3901fe36c45d1bd05efbf8b.zip |
Fixes #20: Add groupBy methods to QueryWhere
Diffstat (limited to 'src/main/java/com/iciql/QueryWhere.java')
-rw-r--r-- | src/main/java/com/iciql/QueryWhere.java | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/src/main/java/com/iciql/QueryWhere.java b/src/main/java/com/iciql/QueryWhere.java index 731fc0b..fdce1cb 100644 --- a/src/main/java/com/iciql/QueryWhere.java +++ b/src/main/java/com/iciql/QueryWhere.java @@ -532,6 +532,101 @@ public class QueryWhere<T> { return this;
}
+ /**
+ * Group by primitive boolean field
+ *
+ * @param field
+ * a primitive boolean field
+ * @return the query
+ */
+ public QueryWhere<T> groupBy(boolean field) {
+ query.getFrom().getAliasDefinition().checkMultipleBooleans();
+ return groupByPrimitive(field);
+ }
+
+ /**
+ * Group by primitive byte field
+ *
+ * @param field
+ * a primitive byte field
+ * @return the query
+ */
+ public QueryWhere<T> groupBy(byte field) {
+ return groupByPrimitive(field);
+ }
+
+ /**
+ * Group by primitive short field
+ *
+ * @param field
+ * a primitive short field
+ * @return the query
+ */
+ public QueryWhere<T> groupBy(short field) {
+ return groupByPrimitive(field);
+ }
+
+ public QueryWhere<T> groupBy(int field) {
+ return groupByPrimitive(field);
+ }
+
+ /**
+ * Group by primitive long field
+ *
+ * @param field
+ * a primitive long field
+ * @return the query
+ */
+ public QueryWhere<T> groupBy(long field) {
+ return groupByPrimitive(field);
+ }
+
+ /**
+ * Group by primitive float field
+ *
+ * @param field
+ * a primitive float field
+ * @return the query
+ */
+ public QueryWhere<T> groupBy(float field) {
+ return groupByPrimitive(field);
+ }
+
+ /**
+ * Group by primitive double field
+ *
+ * @param field
+ * a primitive double field
+ * @return the query
+ */
+ public QueryWhere<T> groupBy(double field) {
+ return groupByPrimitive(field);
+ }
+
+ private QueryWhere<T> groupByPrimitive(Object field) {
+ query.groupByPrimitive(field);
+ return this;
+ }
+
+ public QueryWhere<T> groupBy(Object field) {
+ query.getFrom().getAliasDefinition().checkMultipleEnums(field);
+ query.groupBy(field);
+ return this;
+ }
+
+ /**
+ * Group by a number of Object columns.
+ *
+ * @param expressions
+ * the group by expressions
+ * @return the query
+ */
+
+ public QueryWhere<T> groupBy(Object... expressions) {
+ query.groupBy(expressions);
+ return this;
+ }
+
public int delete() {
return query.delete();
}
|