aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2012-01-05 09:24:42 -0500
committerJames Moger <james.moger@gmail.com>2012-01-05 09:24:42 -0500
commit28d2cf5b30ba18f20db54ed9447bc19cb0e4e1b0 (patch)
treeb359d09c6913cd38bddb36ea9205b7442a9af740 /docs
parent0932e559b420d46f8394a464c466804c1df0ede1 (diff)
downloadiciql-28d2cf5b30ba18f20db54ed9447bc19cb0e4e1b0.tar.gz
iciql-28d2cf5b30ba18f20db54ed9447bc19cb0e4e1b0.zip
Prepare 0.7.7 releasev0.7.7
Diffstat (limited to 'docs')
-rw-r--r--docs/02_usage.mkd5
-rw-r--r--docs/04_examples.mkd4
2 files changed, 9 insertions, 0 deletions
diff --git a/docs/02_usage.mkd b/docs/02_usage.mkd
index 14619f2..0c7ba06 100644
--- a/docs/02_usage.mkd
+++ b/docs/02_usage.mkd
@@ -54,6 +54,11 @@ There may be times when the hybrid approach is still too restrictive and you'd p
%BEGINCODE%
List&lt;Product&gt; allProducts = db.executeQuery(Product.class, "select * from products");
List&lt;Product&gt; restock = db.executeQuery(Product.class, "select * from products where unitsInStock=?", 0);
+
+// parameterized query which can be cached and re-used later
+String q = db.from(p).where(p.unitsInStock).isParameter().toSQL();
+List&lt;Product&gt; restock = db.executeQuery(Product.class, q, 0);
+
%ENDCODE%
Or if you want access to the raw *ResultSet* before building your model object instances...
diff --git a/docs/04_examples.mkd b/docs/04_examples.mkd
index eaaa579..1f605e7 100644
--- a/docs/04_examples.mkd
+++ b/docs/04_examples.mkd
@@ -114,6 +114,10 @@ Dynamic queries skip all field type checking and, depending on which approach yo
// where fragment with object parameters
List&lt;Product&gt; restock = db.from(p).where("unitsInStock=? and productName like ? order by productId", 0, "Chef%").select();
+// parameterized query which can be cached and re-used later
+String q = db.from(p).where(p.unitsInStock).isParameter().and(p.productName).likeParameter().orderBy(p.productId).toSQL();
+List&lt;Product&gt; allProducts = db.executeQuery(Product.class, q, 0, "Chef%");
+
// statement with binding to your model class
List&lt;Product&gt; allProducts = db.executeQuery(Product.class, "select * from products");