From 5c70dc9c2562f40211d51b35854c50a626c9c163 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 11 Aug 2011 14:38:02 -0400 Subject: [PATCH] Documentation. Added another unmapped field case. --- README.markdown | 6 +++--- docs/00_index.mkd | 5 +++-- docs/01_model_classes.mkd | 6 +++--- docs/05_building.mkd | 1 + docs/05_releases.mkd | 4 ++-- src/com/iciql/IciqlException.java | 2 +- src/com/iciql/SQLDialectDefault.java | 8 ++++---- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/README.markdown b/README.markdown index dc8b761..26cc96f 100644 --- a/README.markdown +++ b/README.markdown @@ -17,9 +17,9 @@ iciql **is not**... Supported Databases ------- -- [H2 1.3+](http://h2database.com) -- [HSQLDB 2.2+](http://hsqldb.org) -- Support for others is planned and should only require creating a simple "dialect" class. +- [H2 1.3](http://h2database.com) +- [HSQLDB 2.2](http://hsqldb.org) +- Support for others is planned and may only require creating a simple "dialect" class. License ------- diff --git a/docs/00_index.mkd b/docs/00_index.mkd index 1377db1..79139cf 100644 --- a/docs/00_index.mkd +++ b/docs/00_index.mkd @@ -36,9 +36,10 @@ select * from products ### Supported Databases -[H2 1.3+](http://h2database.com), [HSQLDB 2.2+](http://hsqldb.org) +- [H2 1.3](http://h2database.com) +- [HSQLDB 2.2](http://hsqldb.org) -Support for others is planned and should only require creating a simple "dialect" class. +Support for others is planned and may only require creating a simple "dialect" class. ### Java Runtime Requirement diff --git a/docs/01_model_classes.mkd b/docs/01_model_classes.mkd index 658ff2b..cd52c2b 100644 --- a/docs/01_model_classes.mkd +++ b/docs/01_model_classes.mkd @@ -15,7 +15,7 @@ Alternatively, model classes can be automatically generated by iciql using the m ### Fully Supported Data Types The following data types can be used for all iciql expressions. - + @@ -64,7 +64,7 @@ The following data types can be used for all iciql expressions. - + @@ -75,7 +75,7 @@ The reverse lookup used for model generation, SQL type -> Java type, contains mo Please consult the `com.iciql.ModelUtils` class for details. ### Partially Supported Data Types -The following data types can be mapped to columns for all general statements BUT these field types may **not** be used to specify **compile-time** *clauses or constraints*. +The following data types can be mapped to columns for all general statements BUT these field types may **not** be used to specify **compile-time** clauses or constraints.
All Databases
Standard SQL Types
java.lang.String VARCHAR *(length > 0)* or CLOB *(length == 0)*
java.lang.Enum implements
*com.iciql.Iciql.EnumId.enumId()*
INT
*EnumType.ENUMID*
H2 Databases
H2 Database Types
java.util.UUID UUID
diff --git a/docs/05_building.mkd b/docs/05_building.mkd index cb8381e..6e6196a 100644 --- a/docs/05_building.mkd +++ b/docs/05_building.mkd @@ -9,6 +9,7 @@ Additionally, [eclipse-cs](http://eclipse-cs.sourceforge.net), [FindBugs](http:/ ### Build Dependencies (downloaded during build) - [H2 Database](http://h2database.com) (Eclipse Public License 1.0) +- [HSQL Database Engine](http://hsqldb.org) (BSD) - [JUnit](http://junit.org) (Common Public License) - [commons-net](http://commons.apache.org/net) (Apache 2.0) - [ant-googlecode](http://code.google.com/p/ant-googlecode) (New BSD) diff --git a/docs/05_releases.mkd b/docs/05_releases.mkd index c999062..a0905e5 100644 --- a/docs/05_releases.mkd +++ b/docs/05_releases.mkd @@ -15,8 +15,8 @@ - moved dialects back to main package - improved automatic dialect determination on pooled connections - moved create table and create index statement generation into dialects -- added HSQL dialect. HSQL fails 4 unit tests, 2 of which are unimplemented merge, 1 has been filed as a bug in HSQL. -- added MySQL dialect. Untested. +- added HSQL dialect. HSQL fails 4 out of 49 unit tests: 2 failures are unimplemented merge, 1 has been filed as a bug in HSQL. +- added MySQL dialect. untested. - renamed _ iq_versions table to *iq_versions* since leading _ character is troublesome for some databases. - @IQColumn(allowNull=true) -> @IQColumn(nullable=true) - All columns are assumed NULLABLE unless explicitly set *@IQColumn(nullable = false)* diff --git a/src/com/iciql/IciqlException.java b/src/com/iciql/IciqlException.java index 6e55c79..5a99c5e 100644 --- a/src/com/iciql/IciqlException.java +++ b/src/com/iciql/IciqlException.java @@ -30,7 +30,7 @@ public class IciqlException extends RuntimeException { public static final int CODE_TABLE_NOT_FOUND = 3; public static final int CODE_INDEX_ALREADY_EXISTS = 4; - private static final String TOKEN_UNMAPPED_FIELD = "\\? (=|\\>|\\<|!=|\\>=|\\<=|LIKE|BETWEEN) \\?"; + private static final String TOKEN_UNMAPPED_FIELD = "\\? (=|\\>|\\<|\\<\\>|!=|\\>=|\\<=|LIKE|BETWEEN) \\?"; private static final long serialVersionUID = 1L; diff --git a/src/com/iciql/SQLDialectDefault.java b/src/com/iciql/SQLDialectDefault.java index 3fd2067..7786829 100644 --- a/src/com/iciql/SQLDialectDefault.java +++ b/src/com/iciql/SQLDialectDefault.java @@ -100,7 +100,7 @@ public class SQLDialectDefault implements SQLDialect { buff.appendExceptFirst(", "); buff.append(prepareColumnName(field.columnName)).append(' '); String dataType = field.dataType; - if (dataType.equals("VARCHAR")) { + if (dataType.equals("VARCHAR")) { // check to see if we should use VARCHAR or CLOB if (field.length <= 0) { dataType = "CLOB"; @@ -111,7 +111,7 @@ public class SQLDialectDefault implements SQLDialect { } } else if (dataType.equals("DECIMAL")) { // DECIMAL(precision,scale) - buff.append(convertSqlType(dataType)); + buff.append(convertSqlType(dataType)); if (field.length > 0) { buff.append('(').append(field.length); if (field.scale > 0) { @@ -173,13 +173,13 @@ public class SQLDialectDefault implements SQLDialect { @Override public void prepareCreateIndex(SQLStatement stat, String schemaName, String tableName, IndexDefinition index) { - throw new IciqlException("Dialect does not support index creation!"); + throw new IciqlException("{0} does not support index creation!", getClass().getSimpleName()); } @Override public void prepareMerge(SQLStatement stat, String schemaName, String tableName, TableDefinition def, Object obj) { - throw new IciqlException("Dialect does not support merge statements!"); + throw new IciqlException("{0} does not support merge statements!", getClass().getSimpleName()); } @Override -- 2.39.5
byte []