summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2011-08-08 11:12:50 -0400
committerJames Moger <james.moger@gmail.com>2011-08-08 11:12:50 -0400
commit35973f16d6e408fff3e9eeeda4dac4ab3f7cb048 (patch)
treebd266925e65837ecbfe18ac3b734a05d6bf49bdc /docs
parentf7485f5f18e49cef057782c0c3137e64a5af542c (diff)
downloadiciql-35973f16d6e408fff3e9eeeda4dac4ab3f7cb048.tar.gz
iciql-35973f16d6e408fff3e9eeeda4dac4ab3f7cb048.zip
Documentation. EnumType default is NAME.
Diffstat (limited to 'docs')
-rw-r--r--docs/01_model_classes.mkd92
-rw-r--r--docs/02_table_versioning.mkd2
-rw-r--r--docs/02_usage.mkd2
-rw-r--r--docs/05_releases.mkd17
4 files changed, 91 insertions, 22 deletions
diff --git a/docs/01_model_classes.mkd b/docs/01_model_classes.mkd
index 6e58f0a..846ef6c 100644
--- a/docs/01_model_classes.mkd
+++ b/docs/01_model_classes.mkd
@@ -5,9 +5,16 @@ Models can be manually written using one of two approaches: *annotation configur
Alternatively, model classes can be automatically generated by iciql using the model generation tool. Please see the [tools](tools.html) page for details.
-### Supported Data Types
-<table>
+### Configuration Requirements and Limitations
+
+1. Your model class **must** provide a public default constructor.
+2. Only the specified types are supported. Other types such as arrays and custom types are not supported.
+3. Triggers, views, and other advanced database features are not supported.
+### Fully Supported Data Types
+The following data types can be used for all iciql expressions.
+<table>
+<tr><th colspan="2">All Databases</th></tr>
<tr><td>java.lang.String</td>
<td>VARCHAR *(length > 0)* or TEXT *(length == 0)*</td></tr>
@@ -47,11 +54,8 @@ Alternatively, model classes can be automatically generated by iciql using the m
<tr><td>java.util.Date</td>
<td>TIMESTAMP</td></tr>
-<tr><td>byte []</td>
-<td>BLOB</td></tr>
-
-<tr><td>java.lang.Enum.name()</td>
-<td>VARCHAR *(length > 0)* or TEXT *(length == 0)*<br/>*EnumType.STRING*</td></tr>
+<tr><td>java.lang.Enum.name()<br/>*default type*</td>
+<td>VARCHAR *(length > 0)* or TEXT *(length == 0)*<br/>*EnumType.NAME*</td></tr>
<tr><td>java.lang.Enum.ordinal()</td>
<td>INT<br/>*EnumType.ORDINAL*</td></tr>
@@ -59,23 +63,79 @@ Alternatively, model classes can be automatically generated by iciql using the m
<tr><td>java.lang.Enum implements<br/>*com.iciql.Iciql.EnumId.enumId()*</td>
<td>INT<br/>*EnumType.ENUMID*</td></tr>
+<tr><th colspan="2">H2 Databases</th></tr>
+<tr><td>java.util.UUID</td>
+<td>UUID</td><tr/>
+
</table>
**NOTE:**<br/>
The reverse lookup used for model generation, SQL type -> Java type, contains more mappings.<br/>
Please consult the `com.iciql.ModelUtils` class for details.
-### Unsupported Types
-- Java primitives (use their object counterparts instead)
-- array types
-- custom types
+### Partially Supported Data Types
+The following data types can be mapped to columns for all general statements <u>BUT</u> these field types may **not** be used to specify **compile-time** *clauses or constraints*.
+
+<table>
+<tr><td>byte []</td>
+<td>BLOB</td></tr>
+
+<tr><td>boolean</td>
+<td>BIT</td></tr>
+
+<tr><td>byte</td>
+<td>TINYINT</td></tr>
+
+<tr><td>short</td>
+<td>SMALLINT</td></tr>
+
+<tr><td>int</td>
+<td>INT</td></tr>
+
+<tr><td>long</td>
+<td>BIGINT</td></tr>
+
+<tr><td>float</td>
+<td>REAL</td></tr>
+
+<tr><td>double</td>
+<td>DOUBLE</td></tr>
+
+</table>
-### Configuration Rules
-1. field mappings must be Objects not primitives
-2. the model class must have a default public constructor
+#### Partially Supported Data Types Example
+%BEGINCODE%
+class Primitives {
+ @IQColumn(primaryKey = true)
+ int id;
+
+ @IQColumn
+ String name;
+
+ public Primitives() {
+ }
+
+ public Primitives(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+}
+
+Primitives p = new Primitives();
+
+// the following expressions compile, but will throw iciql runtime exceptions
+db.from(p).where(p.id).is(100).selectFirst();
+db.from(p).where(p.id).atLeast(10).select();
+
+// the following expressions will work as expected
+db.from(p).select();
+db.from(p).where("id = ?", 100).selectFirst();
+db.from(p).where("id >= ?", 10).select();
+db.insert(new Primitives(150, "test"));
+db.update(new Primitives(150, "modified"));
+db.delete(new Primitives(150, "test"));
+%ENDCODE%
-### Configuration Limitations
-Triggers, views, and other advanced database features are unimplemented.
## Annotation Configuration
The recommended approach to setup a model class is to annotate the class and field declarations.
diff --git a/docs/02_table_versioning.mkd b/docs/02_table_versioning.mkd
index 4650f74..12cdf6c 100644
--- a/docs/02_table_versioning.mkd
+++ b/docs/02_table_versioning.mkd
@@ -10,7 +10,7 @@ Your `com.iciql.DbUpgrader` implementation must specify the `IQVersion(version)`
### How does it work?
If you choose to use versioning, iciql will maintain a table within your database named *_iq_versions* which is defined as:
- CREATE TABLE _IQ_VERSIONS(SCHEMANAME TEXT NOT NULL, TABLENAME TEXT NOT NULL, VERSION INT NOT NULL)
+ CREATE TABLE _IQ_VERSIONS(SCHEMANAME VARCHAR(255) NOT NULL, TABLENAME VARCHAR(255) NOT NULL, VERSION INT NOT NULL)
This database table is automatically created if and only if at least one of your model classes specifies a *version* > 0.
diff --git a/docs/02_usage.mkd b/docs/02_usage.mkd
index d872ee0..4cca129 100644
--- a/docs/02_usage.mkd
+++ b/docs/02_usage.mkd
@@ -48,7 +48,7 @@ List&lt;Product&gt; restock = db.from(p).where("unitsInStock=? and productName l
#### Db.executeQuery Approaches
There may be times when the hybrid approach is still too restrictive and you'd prefer to write straight SQL. You can do that too and use iciql to build objects from your ResultSet, but be careful:
-1. Make sure to _select *_ in your query otherwise db.bindResultSet() will throw a RuntimeException
+1. Make sure to _select *_ in your query otherwise db.buildObjects() will throw a RuntimeException
2. There is no model class type checking nor field type checking.
%BEGINCODE%
diff --git a/docs/05_releases.mkd b/docs/05_releases.mkd
index eb2c93c..f2f14cc 100644
--- a/docs/05_releases.mkd
+++ b/docs/05_releases.mkd
@@ -1,8 +1,19 @@
## Release History
### Current Release
+
**%VERSION%** ([zip](http://code.google.com/p/iciql/downloads/detail?name=%ZIP%)|[jar](http://code.google.com/p/iciql/downloads/detail?name=%JAR%)) &nbsp; *released %BUILDDATE%*
+- api change release (API v3)
+- finished enum support (issue 4)
+- added UUID type support (H2 databases only)
+- added partial primitives support *(primitives may not be used for compile-time condition clauses)*
+- added *between(A y).and(A z)* condition syntax
+
+### Older Releases
+
+**0.6.2** &nbsp; *released 2011-08-05*
+
- api change release (API v2)
- fix to versioning to support H2 1.3.158+
- added BLOB support (issue 1)
@@ -20,10 +31,8 @@
%ENDCODE%
- @IQColumn(maxLength=20) -> @IQColumn(length=20)
- @IQColumn(trimString=true) -> @IQColumn(trim=true)
-
-### Older Releases
-
-**0.5.0** ([zip](http://code.google.com/p/iciql/downloads/detail?name=iciql-0.5.0.zip)|[jar](http://code.google.com/p/iciql/downloads/detail?name=iciql-0.5.0.jar)) &nbsp; *released 2011-08-03*
+
+**0.5.0** &nbsp; *released 2011-08-03*
- initial release (API v1)