\r
**%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%*\r
\r
+- generated models are now serializable with a default serial version id of 1\r
+\r
+### Older Releases\r
+\r
+**0.7.1** *released 2011-08-31*\r
+\r
- api change release (API v7)\r
- Undeprecated interface configuration\r
- Interface configuration now maps ALL fields, not just public fields\r
- Fix to default dialect when creating autoincrement columns\r
- Added Db.open(url) method\r
\r
-### Older Releases\r
-\r
**0.7.0** *released 2011-08-17*\r
\r
- api change release (API v6)\r
\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
- public static final String VERSION = "0.7.1";\r
+ public static final String VERSION = "0.7.2-SNAPSHOT";\r
\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
- public static final String VERSION_DATE = "2011-08-31";\r
+ public static final String VERSION_DATE = "PENDING";\r
\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
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;
// 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());
// 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
// 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());