aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/05_releases.mkd10
-rw-r--r--src/com/iciql/Constants.java4
-rw-r--r--src/com/iciql/Db.java34
3 files changed, 44 insertions, 4 deletions
diff --git a/docs/05_releases.mkd b/docs/05_releases.mkd
index abc8791..9a7d13e 100644
--- a/docs/05_releases.mkd
+++ b/docs/05_releases.mkd
@@ -6,14 +6,20 @@
**%VERSION%** ([zip](http://code.google.com/p/iciql/downloads/detail?name=%ZIP%)|[jar](http://code.google.com/p/iciql/downloads/detail?name=%JAR%))   *released %BUILDDATE%*
+- Added list alternatives to the varargs methods because it was too easy to forget list.toArray() for the varargs methods
+List<T> Db.executeQuery(Class<? extends T> modelClass, String sql, List<?> args)
+ResultSet executeQuery(String sql, List<?> args)
+
+### Older Releases
+
+**0.7.3** &nbsp; *released 2011-12-06*
+
- api change release (API v8)
- Fixed JOIN ON primitives
- Fixed GROUP BY primitives
- Fixed primitive references when selecting into a custom type with primitives
- Improved fluent/type-safety of joins
-### Older Releases
-
**0.7.2** &nbsp; *released 2011-11-30*
- generated models are now serializable with a default serial version id of 1
diff --git a/src/com/iciql/Constants.java b/src/com/iciql/Constants.java
index 5c1bfc0..37f0c2b 100644
--- a/src/com/iciql/Constants.java
+++ b/src/com/iciql/Constants.java
@@ -25,11 +25,11 @@ public class Constants {
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
- public static final String VERSION = "0.7.3";
+ public static final String VERSION = "0.7.4-SNAPSHOT";
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
- public static final String VERSION_DATE = "2011-12-06";
+ public static final String VERSION_DATE = "PENDING";
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
diff --git a/src/com/iciql/Db.java b/src/com/iciql/Db.java
index 05d7f46..e05ec56 100644
--- a/src/com/iciql/Db.java
+++ b/src/com/iciql/Db.java
@@ -448,6 +448,26 @@ public class Db {
return (TableDefinition<T>) classMap.get(clazz);
}
+
+ /**
+ * Run a SQL query directly against the database.
+ *
+ * Be sure to close the ResultSet with
+ *
+ * <pre>
+ * JdbcUtils.closeSilently(rs, true);
+ * </pre>
+ *
+ * @param sql
+ * the SQL statement
+ * @param args
+ * optional object arguments for x=? tokens in query
+ * @return the result set
+ */
+ public ResultSet executeQuery(String sql, List<?> args) {
+ return executeQuery(sql, args.toArray());
+ }
+
/**
* Run a SQL query directly against the database.
*
@@ -490,6 +510,20 @@ public class Db {
* the SQL statement
* @return the result set
*/
+ public <T> List<T> executeQuery(Class<? extends T> modelClass, String sql, List<?> args) {
+ return executeQuery(modelClass, sql, args.toArray());
+ }
+
+ /**
+ * Run a SQL query directly against the database and map the results to the
+ * model class.
+ *
+ * @param modelClass
+ * the model class to bind the query ResultSet rows into.
+ * @param sql
+ * the SQL statement
+ * @return the result set
+ */
public <T> List<T> executeQuery(Class<? extends T> modelClass, String sql, Object... args) {
ResultSet rs = null;
try {