diff options
author | James Moger <james.moger@gmail.com> | 2011-09-02 17:44:53 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2011-09-02 17:44:53 -0400 |
commit | 999af1bf78e0e45cb445f0adcf34588023b4ff76 (patch) | |
tree | b5d1107df22422d299e25ed9a488c810885f4675 /src/com/iciql/TableInspector.java | |
parent | ba323f66e1727097ac91b1743c85ea563ee565cd (diff) | |
download | iciql-999af1bf78e0e45cb445f0adcf34588023b4ff76.tar.gz iciql-999af1bf78e0e45cb445f0adcf34588023b4ff76.zip |
Generated models are now serializable.
Diffstat (limited to 'src/com/iciql/TableInspector.java')
-rw-r--r-- | src/com/iciql/TableInspector.java | 6 |
1 files changed, 5 insertions, 1 deletions
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 |