From 999af1bf78e0e45cb445f0adcf34588023b4ff76 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 2 Sep 2011 17:44:53 -0400 Subject: Generated models are now serializable. --- src/com/iciql/Constants.java | 4 ++-- src/com/iciql/TableInspector.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/com/iciql') 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 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 -- cgit v1.2.3