diff options
author | James Moger <james.moger@gmail.com> | 2011-08-15 16:44:14 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-08-15 16:44:14 -0400 |
commit | 66e810aaf212c5e37b0a1702b6c33480595408ce (patch) | |
tree | 2babeea368dec0023b9a2add5b3ddc2c1aaaeea8 /src/com/iciql/DbInspector.java | |
parent | 3622ae0026718ac8466e13e8011f8db309d89106 (diff) | |
download | iciql-66e810aaf212c5e37b0a1702b6c33480595408ce.tar.gz iciql-66e810aaf212c5e37b0a1702b6c33480595408ce.zip |
Added Derby dialect. Finished HSQL dialect. Documentation.
* Improved DEFAULT value specifications.
* Fixed bug in buildObjects where the ResultSet could be closed by the
automatic create table attempt.
* DbInspector now uses the dialect's reported DATETIME class preference.
* Improved IciqlException SQLState code checks.
* Integrated LIMIT and OFFSET expression appending in dialects.
* Updated to H2 1.3.159
* Allow reopening of a memory database in the test suite.
Diffstat (limited to 'src/com/iciql/DbInspector.java')
-rw-r--r-- | src/com/iciql/DbInspector.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/com/iciql/DbInspector.java b/src/com/iciql/DbInspector.java index fb1e5d6..c30bbb1 100644 --- a/src/com/iciql/DbInspector.java +++ b/src/com/iciql/DbInspector.java @@ -42,6 +42,7 @@ public class DbInspector { public DbInspector(Db db) { this.db = db; + setPreferredDateTimeClass(db.getDialect().getDateTimeClass()); } /** @@ -73,8 +74,8 @@ public class DbInspector { * (trims strings to maxLength of column) * @return a list of complete model classes as strings, each element a class */ - public List<String> generateModel(String schema, String table, String packageName, boolean annotateSchema, - boolean trimStrings) { + public List<String> generateModel(String schema, String table, String packageName, + boolean annotateSchema, boolean trimStrings) { try { List<String> models = Utils.newArrayList(); List<TableInspector> tables = getTables(schema, table); @@ -130,7 +131,8 @@ public class DbInspector { Class<T> clazz = (Class<T>) model.getClass(); TableDefinition<T> def = db.define(clazz); boolean forceUpperCase = getMetaData().storesUpperCaseIdentifiers(); - String schema = (forceUpperCase && def.schemaName != null) ? def.schemaName.toUpperCase() : def.schemaName; + String schema = (forceUpperCase && def.schemaName != null) ? def.schemaName.toUpperCase() + : def.schemaName; String table = forceUpperCase ? def.tableName.toUpperCase() : def.tableName; List<TableInspector> tables = getTables(schema, table); return tables.get(0); @@ -167,7 +169,8 @@ public class DbInspector { while (rs.next()) { String t = rs.getString("TABLE_NAME"); if (!t.equalsIgnoreCase(iciqlTables)) { - tables.add(new TableInspector(s, t, getMetaData().storesUpperCaseIdentifiers(), dateTimeClass)); + tables.add(new TableInspector(s, t, getMetaData().storesUpperCaseIdentifiers(), + dateTimeClass)); } } } |