diff options
-rw-r--r-- | docs/05_releases.mkd | 8 | ||||
-rw-r--r-- | src/com/iciql/Constants.java | 4 | ||||
-rw-r--r-- | src/com/iciql/TableInspector.java | 6 | ||||
-rw-r--r-- | tests/com/iciql/test/ModelsTest.java | 10 |
4 files changed, 18 insertions, 10 deletions
diff --git a/docs/05_releases.mkd b/docs/05_releases.mkd index 9ccbbde..474b1c3 100644 --- a/docs/05_releases.mkd +++ b/docs/05_releases.mkd @@ -6,6 +6,12 @@ **%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%*
+- generated models are now serializable with a default serial version id of 1
+
+### Older Releases
+
+**0.7.1** *released 2011-08-31*
+
- api change release (API v7)
- Undeprecated interface configuration
- Interface configuration now maps ALL fields, not just public fields
@@ -16,8 +22,6 @@ - Fix to default dialect when creating autoincrement columns
- Added Db.open(url) method
-### Older Releases
-
**0.7.0** *released 2011-08-17*
- api change release (API v6)
diff --git a/src/com/iciql/Constants.java b/src/com/iciql/Constants.java index 247c39a..5d63393 100644 --- a/src/com/iciql/Constants.java +++ b/src/com/iciql/Constants.java @@ -25,11 +25,11 @@ public class Constants { // The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
- public static final String VERSION = "0.7.1";
+ public static final String VERSION = "0.7.2-SNAPSHOT";
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
- public static final String VERSION_DATE = "2011-08-31";
+ public static final String VERSION_DATE = "PENDING";
// The build script extracts this exact line so be careful editing it
// and only use A-Z a-z 0-9 .-_ in the string.
diff --git a/src/com/iciql/TableInspector.java b/src/com/iciql/TableInspector.java index 9b67ac3..71eb16d 100644 --- a/src/com/iciql/TableInspector.java +++ b/src/com/iciql/TableInspector.java @@ -24,6 +24,7 @@ import static com.iciql.util.JdbcUtils.closeSilently; import static com.iciql.util.StringUtils.isNullOrEmpty; import static java.text.MessageFormat.format; +import java.io.Serializable; import java.lang.reflect.Modifier; import java.sql.DatabaseMetaData; import java.sql.ResultSet; @@ -190,6 +191,7 @@ public class TableInspector { // import statements Set<String> imports = Utils.newHashSet(); + imports.add(Serializable.class.getCanonicalName()); imports.add(IQSchema.class.getCanonicalName()); imports.add(IQTable.class.getCanonicalName()); imports.add(IQIndexes.class.getCanonicalName()); @@ -256,7 +258,9 @@ public class TableInspector { // class declaration String clazzName = ModelUtils.convertTableToClassName(table); - model.append(format("public class {0} '{'", clazzName)).append(eol); + model.append(format("public class {0} implements Serializable '{'", clazzName)).append(eol); + model.append(eol); + model.append("\tprivate static final long serialVersionUID = 1L;").append(eol); model.append(eol); // field declarations diff --git a/tests/com/iciql/test/ModelsTest.java b/tests/com/iciql/test/ModelsTest.java index 3900437..ceed7a9 100644 --- a/tests/com/iciql/test/ModelsTest.java +++ b/tests/com/iciql/test/ModelsTest.java @@ -123,20 +123,20 @@ public class ModelsTest { // a poor test, but a start String dbName = IciqlSuite.getDatabaseEngineName(db); if (dbName.equals("H2")) { - assertEquals(1475, models.get(0).length()); + assertEquals(1579, models.get(0).length()); } else if (dbName.startsWith("HSQL")) { // HSQL uses Double instead of Float - assertEquals(1479, models.get(0).length()); + assertEquals(1583, models.get(0).length()); } else if (dbName.equals("Apache Derby")) { // Derby uses java.sql.Timestamp not java.util.Date // Derby uses username as schema name - assertEquals(1489, models.get(0).length()); + assertEquals(1593, models.get(0).length()); } else if (dbName.equals("PostgreSQL")) { - assertEquals(1531, models.get(0).length()); + assertEquals(1635, models.get(0).length()); } else if (dbName.equals("MySQL")) { // MySQL uses timestamp default values like // 0000-00-00 00:00:00 and CURRENT_TIMESTAMP - assertEquals(1561, models.get(0).length()); + assertEquals(1665, models.get(0).length()); } else { // unknown database assertEquals(0, models.get(0).length()); |