diff options
author | James Moger <james.moger@gmail.com> | 2011-12-09 16:42:59 -0500 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-12-09 16:42:59 -0500 |
commit | 876c4e51578dfa7bd98956d2f07ae7498a70629c (patch) | |
tree | e23df1f9a29cb027c55a95e50f019e7f6d717d08 /docs | |
parent | 407ea16f9f8f6d3bd5135783d98b63c0e4704609 (diff) | |
download | iciql-876c4e51578dfa7bd98956d2f07ae7498a70629c.tar.gz iciql-876c4e51578dfa7bd98956d2f07ae7498a70629c.zip |
Columns mapped by name in result set instead of index. Disallow multiple
primitive bools in a model WITH explicit referencing.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/01_model_classes.mkd | 2 | ||||
-rw-r--r-- | docs/04_examples.mkd | 7 | ||||
-rw-r--r-- | docs/05_releases.mkd | 26 | ||||
-rw-r--r-- | docs/06_jaqu_comparison.mkd | 1 |
4 files changed, 32 insertions, 4 deletions
diff --git a/docs/01_model_classes.mkd b/docs/01_model_classes.mkd index 5babdcc..f534660 100644 --- a/docs/01_model_classes.mkd +++ b/docs/01_model_classes.mkd @@ -23,7 +23,7 @@ can be used for all iciql expressions <td>VARCHAR *(length > 0)* or CLOB *(length == 0)*</td></tr>
<tr><td>java.lang.Boolean</td><td>boolean</td>
-<td>BOOLEAN</td></tr>
+<td>BOOLEAN<br/><i>can only **declare and explicitly reference** one <u>primitive boolean</u> per model<br/>multiple primitives are allowed if not using where/set/on/and/or/groupBy/orderBy(boolean)</i></td></tr>
<tr><td>java.lang.Byte</td><td>byte</td>
<td>TINYINT</td></tr>
diff --git a/docs/04_examples.mkd b/docs/04_examples.mkd index 480e29d..a1273be 100644 --- a/docs/04_examples.mkd +++ b/docs/04_examples.mkd @@ -8,6 +8,13 @@ List<Product> allProducts = db.from(p).select(); Customer c = new Customer();
List<Customer> waCustomers = db.from(c). where(c.region).is("WA").select();
+public static class ProductPrice {
+ public String productName;
+ public String category;
+ @IQColumn(name = "unitPrice")
+ public Double price;
+}
+
// select with generation of new anonymous inner class
List<ProductPrice> productPrices =
db.from(p).
diff --git a/docs/05_releases.mkd b/docs/05_releases.mkd index 9a7d13e..d4aa8f2 100644 --- a/docs/05_releases.mkd +++ b/docs/05_releases.mkd @@ -6,9 +6,29 @@ **%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)
+- Disallow **declaring and explicitly referencing** multiple primitive booleans in a single model.<br/>A runtime exception will be thrown if an attempt to use where/set/on/and/or/groupBy/orderBy(boolean) and your model has multiple mapped primitive boolean fields.
+- Added list alternatives to the varargs methods because it was too easy to forget list.toArray()<br/>
+*Db.executeQuery(Class<? extends T> modelClass, String sql, List<?> args)*<br/>
+*Db.executeQuery(String sql, List<?> args)*<br/>
+*Query.where(String fragment, List<?> args)*<br/>
+- Fixed inherited JaQu bug related to model classes and wildcard queries (select *).<p/>
+Iciql maps resultset columns by the index of the model class field from a list. This assumes that *all* columns in the resultset have a corresponding model field definition. This works fine for most queries because iciql explicitly selects columns from the table (*select alpha, beta...*) when you execute *select()*. The problem is when iciql issues a join or a custom wildcard query and your model does not represent all columns in the resultset: columns and fields fail to correctly line-up.<p/>
+The fix for this (building a column index from the resultset by column name lookup) breaks selecting into *some* anonymous inner classes. At issue is that the inner class field names must now match the column names or the fields must be explicitly annotated with the column names.<p/>**Example** (notice *IQColumn* annotation)<br/>
+%BEGINCODE%
+public static class ProductPrice {
+ public String productName;
+ public String category;
+ @IQColumn(name = "unitPrice")
+ public Double price;
+}
+
+db....select(new ProductPrice() {{
+ productName = p.productName;
+ category = p.category;
+ // or unitPrice = p.unitPrice;
+ price = p.unitPrice;
+}}
+%ENDCODE%
### Older Releases
diff --git a/docs/06_jaqu_comparison.mkd b/docs/06_jaqu_comparison.mkd index 33ca975..9c0f56c 100644 --- a/docs/06_jaqu_comparison.mkd +++ b/docs/06_jaqu_comparison.mkd @@ -10,6 +10,7 @@ This is an overview of the fundamental differences between the original JaQu pro <tr><td>databases</td><td>H2, HSQL, Derby, MySQL, and PostreSQL</td><td>H2 only</td></tr>
<tr><td>logging</td><td>console, SLF4J, or custom logging</td><td>console logging</td></tr>
<tr><td>exceptions</td><td>always includes generated statement in exception, when available</td><td>--</td></tr>
+<tr><td>column mappings</td><td>result sets built by column name</td><td>result sets built by field index<br/>this can fail for dynamic queries or joins</td></tr>
<tr><th colspan="3">syntax and api</th></tr>
<tr><td>dynamic queries</td><td>methods and where clauses for dynamic queries that build iciql objects</td><td>--</td></tr>
<tr><td>DROP</td><td>syntax to drop a table</td><td></td></tr>
|