empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r1070406 [2/2] - in /incubator/empire-db/trunk: empire-db-codegen/src/main/java/org/apache/empire/db/codegen/ empire-db-codegen/src/test/java/org/apache/empire/db/codegen/ empire-db-examples/empire-db-example-advanced/src/main/java/org/apac...
Date Mon, 14 Feb 2011 08:35:35 GMT
Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/order/DBOrderByExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/order/DBOrderByExpr.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/order/DBOrderByExpr.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/order/DBOrderByExpr.java
Mon Feb 14 08:35:33 2011
@@ -18,15 +18,17 @@
  */
 package org.apache.empire.db.expr.order;
 
-import java.util.Set;
-
 import org.apache.empire.db.DBColumn;
 import org.apache.empire.db.DBColumnExpr;
 import org.apache.empire.db.DBDatabase;
 import org.apache.empire.db.DBExpr;
 
+import java.util.Set;
+
 public class DBOrderByExpr extends DBExpr
 {
+    private final static long serialVersionUID = 1L;
+  
     public DBColumnExpr expr;
     public boolean desc;
 

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/set/DBSetExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/set/DBSetExpr.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/set/DBSetExpr.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/expr/set/DBSetExpr.java
Mon Feb 14 08:35:33 2011
@@ -40,6 +40,8 @@ import org.apache.empire.db.DBRowSet;
  */
 public class DBSetExpr extends DBExpr
 {
+    private final static long serialVersionUID = 1L;
+  
     public final DBColumn column;
     public Object         value;
 

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java
Mon Feb 14 08:35:33 2011
@@ -18,10 +18,6 @@
  */
 package org.apache.empire.db.h2;
 
-import java.sql.Connection;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.DataType;
@@ -41,6 +37,10 @@ import org.apache.empire.db.DBTable;
 import org.apache.empire.db.DBTableColumn;
 import org.apache.empire.db.DBView;
 
+import java.sql.Connection;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+
 
 /**
  * This class provides support for the H2 database system.
@@ -49,11 +49,16 @@ import org.apache.empire.db.DBView;
  */
 public class DBDatabaseDriverH2 extends DBDatabaseDriver
 {
+
+  private final static long serialVersionUID = 1L;
+
     /**
      * Defines the H2 command type.
      */ 
     public static class DBCommandH2 extends DBCommand
     {
+        private final static long serialVersionUID = 1L;
+      
         public DBCommandH2(DBDatabase db)
         {
             super(db);

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
Mon Feb 14 08:35:33 2011
@@ -18,10 +18,6 @@
  */
 package org.apache.empire.db.hsql;
 
-import java.sql.Connection;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-
 import org.apache.empire.commons.Errors;
 import org.apache.empire.data.DataType;
 import org.apache.empire.db.DBCmdType;
@@ -40,6 +36,10 @@ import org.apache.empire.db.DBTable;
 import org.apache.empire.db.DBTableColumn;
 import org.apache.empire.db.DBView;
 
+import java.sql.Connection;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+
 
 /**
  * This class provides support for the HSQLDB database system.<br>
@@ -49,12 +49,16 @@ import org.apache.empire.db.DBView;
  */
 public class DBDatabaseDriverHSql extends DBDatabaseDriver
 {
+  private final static long serialVersionUID = 1L;
+  
     /**
      * Defines the HSQLDB command type.
      */ 
 	public static class DBCommandHSql extends DBCommand
 	{
-	    /**
+        private static final long serialVersionUID = 1L;
+
+        /**
 	     * @param db the database
 	     * @see org.apache.empire.db.DBCommand
 	     */

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
Mon Feb 14 08:35:33 2011
@@ -18,11 +18,6 @@
  */
 package org.apache.empire.db.mysql;
 
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.StringUtils;
 import org.apache.empire.data.DataType;
@@ -42,6 +37,11 @@ import org.apache.empire.db.DBTable;
 import org.apache.empire.db.DBTableColumn;
 import org.apache.empire.db.DBView;
 
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+
 
 /**
  * This class provides support for the MySQL database system.
@@ -50,11 +50,15 @@ import org.apache.empire.db.DBView;
  */
 public class DBDatabaseDriverMySQL extends DBDatabaseDriver
 {
+    private static final long serialVersionUID = 1L;
+
     /**
      * Defines the MySQL command type.
      */ 
     public static class DBCommandMySQL extends DBCommand
     {
+        private final static long serialVersionUID = 1L;
+      
         protected int limit = -1;
         protected int skip  = -1;
         

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBCommandOracle.java
Mon Feb 14 08:35:33 2011
@@ -32,6 +32,8 @@ import org.apache.empire.db.expr.compare
  */
 public class DBCommandOracle extends DBCommand
 {
+    private final static long serialVersionUID = 1L;
+  
     // Oracle Connect By / Start With
     protected DBCompareExpr connectBy  = null;
     protected DBCompareExpr startWith  = null;

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
Mon Feb 14 08:35:33 2011
@@ -50,6 +50,9 @@ import org.apache.empire.db.DBView;
  */
 public class DBDatabaseDriverOracle extends DBDatabaseDriver
 {
+    private static final long serialVersionUID = 1L;
+
+
     // Implementation of boolean types
     public enum BooleanType
     {

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDataDictionnary.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDataDictionnary.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDataDictionnary.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleDataDictionnary.java
Mon Feb 14 08:35:33 2011
@@ -34,9 +34,9 @@ import org.apache.empire.db.DBView;
 public class OracleDataDictionnary {
     
     /**
-     * Immutable culumn info helper class
+     * Immutable column info helper class
      */
-    private class ColumnInfo {
+    public class ColumnInfo {
 
         private final String dataType;
         private final int charLength;

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleRowNumExpr.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleRowNumExpr.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleRowNumExpr.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleRowNumExpr.java
Mon Feb 14 08:35:33 2011
@@ -34,6 +34,7 @@ import org.w3c.dom.Element;
  */
 public class OracleRowNumExpr extends DBColumnExpr
 {
+    private final static long serialVersionUID = 1L;
     public final DBDatabase   db;
 
     /**

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleSYSDatabase.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleSYSDatabase.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleSYSDatabase.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/OracleSYSDatabase.java
Mon Feb 14 08:35:33 2011
@@ -23,148 +23,163 @@ import org.apache.empire.data.DataType;
 import org.apache.empire.db.*;
 
 /**
- * Represents the data model of the system tables.
- * They are required to parse the data models.
+ * Represents the data model of the system tables. They are required to parse the data models.
  * <P>
  * 
- *
+ * 
  */
-public class OracleSYSDatabase extends DBDatabase 
+public class OracleSYSDatabase extends DBDatabase
 {
 
+    private final static long serialVersionUID = 1L;
+
     // Table for all tables of a schema with their comments
     public static class DBTabComments extends DBTable
     {
-      public DBTableColumn C_OWNER;
-      public DBTableColumn C_TABLE_NAME;
-      public DBTableColumn C_TABLE_TYPE;
-      public DBTableColumn C_COMMENTS;
-      // Constructor
-      public DBTabComments(DBDatabase db)
-      {
-        super("ALL_TAB_COMMENTS", db);
-        // add all Colums
-        C_OWNER       = addColumn("OWNER",      DataType.TEXT, 50, false);
-        C_TABLE_NAME  = addColumn("TABLE_NAME", DataType.TEXT, 50, false);
-        C_TABLE_TYPE  = addColumn("TABLE_TYPE", DataType.TEXT, 50, false);
-        C_COMMENTS    = addColumn("COMMENTS",   DataType.TEXT, 500, false);
-      }
+        private static final long serialVersionUID = 1L;
+
+        public DBTableColumn      C_OWNER;
+        public DBTableColumn      C_TABLE_NAME;
+        public DBTableColumn      C_TABLE_TYPE;
+        public DBTableColumn      C_COMMENTS;
+
+        // Constructor
+        public DBTabComments(DBDatabase db)
+        {
+            super("ALL_TAB_COMMENTS", db);
+            // add all Colums
+            C_OWNER = addColumn("OWNER", DataType.TEXT, 50, false);
+            C_TABLE_NAME = addColumn("TABLE_NAME", DataType.TEXT, 50, false);
+            C_TABLE_TYPE = addColumn("TABLE_TYPE", DataType.TEXT, 50, false);
+            C_COMMENTS = addColumn("COMMENTS", DataType.TEXT, 500, false);
+        }
     }
 
     // Table for all constraints
     public static class DBConstraints extends DBTable
     {
-      public DBTableColumn C_CONSTRAINT_NAME;
-      public DBTableColumn C_TABLE_NAME;
-      public DBTableColumn C_R_CONSTRAINT_NAME;
-      public DBTableColumn C_CONSTRAINT_TYPE;
-      public DBTableColumn C_STATUS;
-      // Constructor
-      public DBConstraints(DBDatabase db)
-      {
-        super("ALL_CONSTRAINTS", db);
-        // add all Colums
-      
-        C_CONSTRAINT_NAME    = addColumn("CONSTRAINT_NAME",     DataType.TEXT, 100, false);
-        C_TABLE_NAME         = addColumn("TABLE_NAME",          DataType.TEXT, 100, false);
-        C_R_CONSTRAINT_NAME  = addColumn("R_CONSTRAINT_NAME",   DataType.TEXT, 100, false);
-        C_CONSTRAINT_TYPE    = addColumn("CONSTRAINT_TYPE",     DataType.TEXT, 1, false);
-        C_STATUS             = addColumn("STATUS",              DataType.TEXT, 20, false);
-      }
+        private final static long serialVersionUID = 1L;
+
+        public DBTableColumn      C_CONSTRAINT_NAME;
+        public DBTableColumn      C_TABLE_NAME;
+        public DBTableColumn      C_R_CONSTRAINT_NAME;
+        public DBTableColumn      C_CONSTRAINT_TYPE;
+        public DBTableColumn      C_STATUS;
+
+        // Constructor
+        public DBConstraints(DBDatabase db)
+        {
+            super("ALL_CONSTRAINTS", db);
+            // add all Colums
+
+            C_CONSTRAINT_NAME = addColumn("CONSTRAINT_NAME", DataType.TEXT, 100, false);
+            C_TABLE_NAME = addColumn("TABLE_NAME", DataType.TEXT, 100, false);
+            C_R_CONSTRAINT_NAME = addColumn("R_CONSTRAINT_NAME", DataType.TEXT, 100, false);
+            C_CONSTRAINT_TYPE = addColumn("CONSTRAINT_TYPE", DataType.TEXT, 1, false);
+            C_STATUS = addColumn("STATUS", DataType.TEXT, 20, false);
+        }
     }
 
     // Table for Columns and Tables a constraint is associated to
     public static class DBUserConCol extends DBTable
     {
-      public DBTableColumn C_CONSTRAINT_NAME;
-      public DBTableColumn C_TABLE_NAME;
-      public DBTableColumn C_COLUMN_NAME;
-      public DBTableColumn C_OWNER;
-      // Constructor
-      public DBUserConCol(DBDatabase db)
-      {
-        super("USER_CONS_COLUMNS", db);
-        // add all Colums
-      
-        C_CONSTRAINT_NAME = addColumn("CONSTRAINT_NAME",    DataType.TEXT, 100, false);
-        C_TABLE_NAME      = addColumn("TABLE_NAME",         DataType.TEXT, 100, false);
-        C_COLUMN_NAME     = addColumn("COLUMN_NAME",        DataType.TEXT, 100, false);
-        C_OWNER           = addColumn("OWNER",              DataType.TEXT, 100, false);
-        setPrimaryKey(C_CONSTRAINT_NAME);
-      }
+        private final static long serialVersionUID = 1L;
+
+        public DBTableColumn      C_CONSTRAINT_NAME;
+        public DBTableColumn      C_TABLE_NAME;
+        public DBTableColumn      C_COLUMN_NAME;
+        public DBTableColumn      C_OWNER;
+
+        // Constructor
+        public DBUserConCol(DBDatabase db)
+        {
+            super("USER_CONS_COLUMNS", db);
+            // add all Colums
+
+            C_CONSTRAINT_NAME = addColumn("CONSTRAINT_NAME", DataType.TEXT, 100, false);
+            C_TABLE_NAME = addColumn("TABLE_NAME", DataType.TEXT, 100, false);
+            C_COLUMN_NAME = addColumn("COLUMN_NAME", DataType.TEXT, 100, false);
+            C_OWNER = addColumn("OWNER", DataType.TEXT, 100, false);
+            setPrimaryKey(C_CONSTRAINT_NAME);
+        }
     }
 
     // Table for all columns of a schema with their comments
     public static class DBColInfo extends DBTable
     {
-      public DBTableColumn C_OWNER;
-      public DBTableColumn C_TABLE_NAME;
-      public DBTableColumn C_COLUMN_NAME;
-      public DBTableColumn C_DATA_TYPE;
-      public DBTableColumn C_DATA_TYPE_MOD;
-      public DBTableColumn C_DATA_TYPE_OWNER;
-      public DBTableColumn C_NULLABLE;
-      public DBTableColumn C_DATA_LENGTH;
-      public DBTableColumn C_DATA_PRECISION;
-      public DBTableColumn C_DATA_SCALE;
-      public DBTableColumn C_CHAR_LENGTH;
-
-      // Constructor
-      public DBColInfo(DBDatabase db)
-      {
-        super("ALL_TAB_COLUMNS", db);
-        // add all Colums
-        C_OWNER           = addColumn("OWNER",           DataType.TEXT,   30, false);
-        C_TABLE_NAME      = addColumn("TABLE_NAME",      DataType.TEXT,   30, false);
-        C_COLUMN_NAME     = addColumn("COLUMN_NAME",     DataType.TEXT,   30, false);
-        C_DATA_TYPE       = addColumn("DATA_TYPE",       DataType.TEXT,   50, false);
-        C_DATA_TYPE_MOD   = addColumn("DATA_TYPE_MOD",   DataType.TEXT,   50, false);
-        C_DATA_TYPE_OWNER = addColumn("DATA_TYPE_OWNER", DataType.TEXT,   50, false);
-        C_NULLABLE        = addColumn("NULLABLE",        DataType.TEXT,    1, false);
-        C_DATA_LENGTH     = addColumn("DATA_LENGTH",     DataType.DECIMAL, 0, false);
-        C_DATA_PRECISION  = addColumn("DATA_PRECISION",  DataType.DECIMAL, 0, false);
-        C_DATA_SCALE      = addColumn("DATA_SCALE",      DataType.DECIMAL, 0, false);
-        C_CHAR_LENGTH     = addColumn("CHAR_LENGTH",     DataType.DECIMAL, 0, false);
-      }
+        private final static long serialVersionUID = 1L;
+
+        public DBTableColumn      C_OWNER;
+        public DBTableColumn      C_TABLE_NAME;
+        public DBTableColumn      C_COLUMN_NAME;
+        public DBTableColumn      C_DATA_TYPE;
+        public DBTableColumn      C_DATA_TYPE_MOD;
+        public DBTableColumn      C_DATA_TYPE_OWNER;
+        public DBTableColumn      C_NULLABLE;
+        public DBTableColumn      C_DATA_LENGTH;
+        public DBTableColumn      C_DATA_PRECISION;
+        public DBTableColumn      C_DATA_SCALE;
+        public DBTableColumn      C_CHAR_LENGTH;
+
+        // Constructor
+        public DBColInfo(DBDatabase db)
+        {
+            super("ALL_TAB_COLUMNS", db);
+            // add all Colums
+            C_OWNER = addColumn("OWNER", DataType.TEXT, 30, false);
+            C_TABLE_NAME = addColumn("TABLE_NAME", DataType.TEXT, 30, false);
+            C_COLUMN_NAME = addColumn("COLUMN_NAME", DataType.TEXT, 30, false);
+            C_DATA_TYPE = addColumn("DATA_TYPE", DataType.TEXT, 50, false);
+            C_DATA_TYPE_MOD = addColumn("DATA_TYPE_MOD", DataType.TEXT, 50, false);
+            C_DATA_TYPE_OWNER = addColumn("DATA_TYPE_OWNER", DataType.TEXT, 50, false);
+            C_NULLABLE = addColumn("NULLABLE", DataType.TEXT, 1, false);
+            C_DATA_LENGTH = addColumn("DATA_LENGTH", DataType.DECIMAL, 0, false);
+            C_DATA_PRECISION = addColumn("DATA_PRECISION", DataType.DECIMAL, 0, false);
+            C_DATA_SCALE = addColumn("DATA_SCALE", DataType.DECIMAL, 0, false);
+            C_CHAR_LENGTH = addColumn("CHAR_LENGTH", DataType.DECIMAL, 0, false);
+        }
     }
 
     // Table for all columns of a schema with their comments
     public static class DBColComments extends DBTable
     {
-      public DBTableColumn C_OWNER;
-      public DBTableColumn C_TABLE_NAME;
-      public DBTableColumn C_COLUMN_NAME;
-      public DBTableColumn C_COMMENTS;
-      // Constructor
-      public DBColComments(DBDatabase db)
-      {
-        super("ALL_COL_COMMENTS", db);
-        // add all Colums
-        C_OWNER        = addColumn("OWNER",       DataType.TEXT, 50, false);
-        C_TABLE_NAME   = addColumn("TABLE_NAME",  DataType.TEXT, 50, false);
-        C_COLUMN_NAME  = addColumn("COLUMN_NAME", DataType.TEXT, 50, false);
-        C_COMMENTS     = addColumn("COMMENTS",    DataType.TEXT, 500, false);
-      }
-    }
-
-    public DBTabComments  TC = null;
-    public DBColInfo      CI = null;
-    public DBColComments  CC = null;  
-    public DBConstraints  CO = null;  
-    public DBUserConCol   UC = null;  
+        private final static long serialVersionUID = 1L;
+
+        public DBTableColumn      C_OWNER;
+        public DBTableColumn      C_TABLE_NAME;
+        public DBTableColumn      C_COLUMN_NAME;
+        public DBTableColumn      C_COMMENTS;
+
+        // Constructor
+        public DBColComments(DBDatabase db)
+        {
+            super("ALL_COL_COMMENTS", db);
+            // add all Colums
+            C_OWNER = addColumn("OWNER", DataType.TEXT, 50, false);
+            C_TABLE_NAME = addColumn("TABLE_NAME", DataType.TEXT, 50, false);
+            C_COLUMN_NAME = addColumn("COLUMN_NAME", DataType.TEXT, 50, false);
+            C_COMMENTS = addColumn("COMMENTS", DataType.TEXT, 500, false);
+        }
+    }
+
+    public DBTabComments TC = null;
+    public DBColInfo     CI = null;
+    public DBColComments CC = null;
+    public DBConstraints CO = null;
+    public DBUserConCol  UC = null;
 
     public OracleSYSDatabase(DBDatabaseDriverOracle driver)
     {
-       // System schema
-       super("SYS");
-       // Set Driver (do not use open(...)!)
-       this.driver = driver; 
-       // Add Tables
-       TC = new DBTabComments (this); 
-       CI = new DBColInfo     (this);  
-       CC = new DBColComments (this); 
-       CO = new DBConstraints (this);  
-       UC = new DBUserConCol  (this);  
+        // System schema
+        super("SYS");
+        // Set Driver (do not use open(...)!)
+        this.driver = driver;
+        // Add Tables
+        TC = new DBTabComments(this);
+        CI = new DBColInfo(this);
+        CC = new DBColComments(this);
+        CO = new DBConstraints(this);
+        UC = new DBUserConCol(this);
     }
 
 }
\ No newline at end of file

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java
Mon Feb 14 08:35:33 2011
@@ -52,6 +52,8 @@ import org.slf4j.LoggerFactory;
  */
 public class DBDatabaseDriverPostgreSQL extends DBDatabaseDriver
 {
+    private final static long serialVersionUID = 1L;
+  
     @SuppressWarnings("hiding")
     private static final Logger log = LoggerFactory.getLogger(DBDatabaseDriverPostgreSQL.class);
     
@@ -79,6 +81,8 @@ public class DBDatabaseDriverPostgreSQL 
      */ 
     public static class DBCommandPostreSQL extends DBCommand
     {
+        private final static long serialVersionUID = 1L;
+      
         public DBCommandPostreSQL(DBDatabase db)
         {
             super(db);

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/sqlserver/DBDatabaseDriverMSSQL.java
Mon Feb 14 08:35:33 2011
@@ -18,11 +18,6 @@
  */
 package org.apache.empire.db.sqlserver;
 
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-
 import org.apache.empire.commons.Errors;
 import org.apache.empire.commons.ObjectUtils;
 import org.apache.empire.commons.StringUtils;
@@ -43,6 +38,11 @@ import org.apache.empire.db.DBTable;
 import org.apache.empire.db.DBTableColumn;
 import org.apache.empire.db.DBView;
 
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+
 
 /**
  * This class provides support for the Microsoft SQL-Server database system.
@@ -52,11 +52,14 @@ import org.apache.empire.db.DBView;
  */
 public class DBDatabaseDriverMSSQL extends DBDatabaseDriver
 {
+    private final static long serialVersionUID = 1L;
+  
     /**
      * Defines the Microsoft SQL-Server command type.
      */ 
     public static class DBCommandMSSQL extends DBCommand
     {
+        private final static long serialVersionUID = 1L;
         protected int limit = -1;
 
         public DBCommandMSSQL(DBDatabase db)

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/EmpireExceptionTest.java
Mon Feb 14 08:35:33 2011
@@ -19,7 +19,7 @@
 package org.apache.empire;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertArrayEquals;
 
 import org.apache.empire.commons.ErrorInfo;
 import org.apache.empire.commons.ErrorObject;
@@ -31,67 +31,75 @@ import org.junit.Test;
 public class EmpireExceptionTest
 {
 
-	private final class MockErrorInfo implements ErrorInfo
-	{
+    private final class MockErrorInfo implements ErrorInfo
+    {
 
-		public Object[] getErrorParams()
-		{
-			return new Object[] { "JUnit", "Test" };
-		}
-
-		public String getErrorSource()
-		{
-			return "JUnitSource";
-		}
-
-		public ErrorType getErrorType()
-		{
-			return Errors.IllegalFormat;
-		}
-
-		public boolean hasError()
-		{
-			return true;
-		}
-	}
-
-	private final class MockErrorObject extends ErrorObject
-	{
-		public MockErrorObject()
-		{
-			super(new MockErrorInfo());
-		}
-	}
-
-	private EmpireException exception;
-	private ErrorObject errorObject;
-
-	@Before
-	public void setupException()
-	{
-	    ErrorObject.setExceptionsEnabled(false);
-		this.errorObject = new MockErrorObject();
-		this.exception = new EmpireException(errorObject);
-	}
-
-	@Test
-	public void testToString()
-	{
-		String expected = errorObject.getClass().getName() + ": The format of JUnit is invalid
for Test";
-		assertEquals(expected, exception.toString());
-	}
-
-	@Test
-	public void testGetErrorType()
-	{
-		assertEquals(Errors.IllegalFormat, exception.getErrorType());
-	}
-
-	@Test
-	public void testGetErrorObject()
-	{
-		assertEquals(errorObject, exception.getErrorObject());
-		assertSame(errorObject, exception.getErrorObject());
-	}
+        public Object[] getErrorParams()
+        {
+            return new Object[] { "JUnit", "Test" };
+        }
+
+        public String getErrorSource()
+        {
+            return "JUnitSource";
+        }
+
+        public ErrorType getErrorType()
+        {
+            return Errors.IllegalFormat;
+        }
+
+        public boolean hasError()
+        {
+            return true;
+        }
+
+        public String getErrorMessage()
+        {
+            return "JUnit error.";
+        }
+    }
+
+    private final class MockErrorObject extends ErrorObject
+    {
+        public MockErrorObject()
+        {
+            super(new MockErrorInfo());
+        }
+    }
+
+    private EmpireException exception;
+    private ErrorObject     errorObject;
+
+    @Before
+    public void setupException()
+    {
+        ErrorObject.setExceptionsEnabled(false);
+        this.errorObject = new MockErrorObject();
+        this.exception = new EmpireException(errorObject);
+    }
+
+    @Test
+    public void testToString()
+    {
+        String expected = errorObject.getClass().getName() + ": The format of JUnit is invalid
for Test";
+        assertEquals(expected, exception.toString());
+    }
+
+    @Test
+    public void testGetErrorType()
+    {
+        assertEquals(Errors.IllegalFormat, exception.getErrorType());
+    }
+
+    @Test
+    public void testGetErrorObject()
+    {
+        assertEquals(errorObject.getErrorMessage(), exception.getErrorObject().getErrorMessage());
+        assertEquals(errorObject.getErrorSource(), exception.getErrorObject().getErrorSource());
+        assertEquals(errorObject.getErrorType(), exception.getErrorObject().getErrorType());
+        assertEquals(errorObject.hasError(), exception.getErrorObject().hasError());
+        assertArrayEquals(errorObject.getErrorParams(), exception.getErrorObject().getErrorParams());
+    }
 
 }

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/commons/ErrorsTest.java
Mon Feb 14 08:35:33 2011
@@ -18,10 +18,10 @@
  */
 package org.apache.empire.commons;
 
-import static org.junit.Assert.*;
-
 import org.junit.Test;
 
+import static org.junit.Assert.assertEquals;
+
 public class ErrorsTest
 {
 
@@ -82,7 +82,12 @@ public class ErrorsTest
 		{
 			return hasErrror;
 		}
-	}
+
+    public String getErrorMessage()
+    {
+      return null;
+    }
+  }
 
 	
 

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/CompanyDB.java
Mon Feb 14 08:35:33 2011
@@ -19,12 +19,8 @@
 package org.apache.empire.db;
 
 import org.apache.empire.commons.Options;
-import org.apache.empire.data.DataType;
 import org.apache.empire.data.DataMode;
-import org.apache.empire.db.DBColumn;
-import org.apache.empire.db.DBDatabase;
-import org.apache.empire.db.DBTable;
-import org.apache.empire.db.DBTableColumn;
+import org.apache.empire.data.DataType;
 
 
 /**
@@ -33,11 +29,14 @@ import org.apache.empire.db.DBTableColum
  */
 public class CompanyDB extends DBDatabase
 {
+    private final static long serialVersionUID = 1L;
+
     /**
      * This class represents the definition of the Departments table.
      */
     public static class Departments extends DBTable
     {
+        private final static long serialVersionUID = 1L;
         public final DBTableColumn ID;
         public final DBTableColumn NAME;
         public final DBTableColumn HEAD;
@@ -68,6 +67,7 @@ public class CompanyDB extends DBDatabas
      */
     public static class Employees extends DBTable
     {
+        private final static long serialVersionUID = 1L;
         public final DBTableColumn ID;
         public final DBTableColumn SALUTATION;
         public final DBTableColumn FIRSTNAME;

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/DBCommandTest.java
Mon Feb 14 08:35:33 2011
@@ -18,14 +18,15 @@
  */
 package org.apache.empire.db;
 
-import static org.junit.Assert.*;
+import org.apache.empire.data.DataType;
+import org.junit.Test;
+import org.w3c.dom.Element;
 
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.empire.data.DataType;
-import org.junit.Test;
-import org.w3c.dom.Element;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
 
 /**
  * @author francisdb
@@ -63,12 +64,14 @@ public class DBCommandTest
 	}
 	
 	private class MockDB extends DBDatabase{
+        private static final long serialVersionUID = 1L;
 		
 	}
 	
 	
 	
 	private class MockDBColumn extends DBColumn{
+      private final static long serialVersionUID = 1L;
 
 	    public MockDBColumn(DBRowSet rowSet, String name)
         {

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/IntegerTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/IntegerTest.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/IntegerTest.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/IntegerTest.java
Mon Feb 14 08:35:33 2011
@@ -236,10 +236,12 @@ public class IntegerTest {
 
     public static class SampleDB extends DBDatabase {
 
+        private static final long serialVersionUID = 1L;
         public final SampleTable SAMPLE = new SampleTable(this);
 
         public class SampleTable extends DBTable {
 
+            private static final long serialVersionUID = 1L;
             public final DBTableColumn MY_INTEGER;
             public final DBTableColumn MY_LONG;
             public final DBTableColumn MY_SHORT;

Modified: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/MockDriver.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/MockDriver.java?rev=1070406&r1=1070405&r2=1070406&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/MockDriver.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/MockDriver.java
Mon Feb 14 08:35:33 2011
@@ -18,14 +18,15 @@
  */
 package org.apache.empire.db;
 
-import java.sql.Connection;
-
 import org.apache.empire.data.DataType;
 
+import java.sql.Connection;
+
 public class MockDriver extends DBDatabaseDriver{
-    
+    private final static long serialVersionUID = 1L;
+  
     class MockCommand extends DBCommand{
-
+        private final static long serialVersionUID = 1L;
         protected MockCommand(DBDatabase db)
         {
             super(db);

Added: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/SerializeTest.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/SerializeTest.java?rev=1070406&view=auto
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/SerializeTest.java
(added)
+++ incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/SerializeTest.java
Mon Feb 14 08:35:33 2011
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.empire.db;
+
+import org.apache.empire.data.DataType;
+import org.apache.empire.db.expr.order.DBOrderByExpr;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+/**
+ * @author <a href="mailto:eike.kettner@gmail.com">Eike Kettner</a>
+ * @since 25.01.11 21:56
+ */
+public class SerializeTest {
+
+  @Test
+  public void testDBObject() throws Exception {
+    ByteArrayOutputStream baos = new ByteArrayOutputStream();
+    for (DBObject dbo : getObjectsToSerialize()) {
+      baos.reset();
+      ObjectOutputStream oos = new ObjectOutputStream(baos);
+      oos.writeObject(dbo);
+
+      ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
+      DBObject dbo2 = (DBObject) oin.readObject();
+
+      //very simple check...
+      Assert.assertNotNull(dbo2.getDatabase());
+      Assert.assertEquals(dbo.getClass(), dbo2.getClass());
+      Assert.assertEquals(dbo.getDatabase().getClass(), dbo2.getDatabase().getClass());
+    }
+  }
+
+
+  public DBObject[] getObjectsToSerialize() {
+    final TestDatabase db = new TestDatabase();
+    DBRecord rec = new DBRecord();
+    rec.init(db.T_TEST, DBRecord.REC_NEW, null);
+    db.open(new MockDriver(), null);
+    return new DBObject[] {
+            db,
+            db.T_TEST,
+            db.V_TEST,
+            db.T_TEST.C_ID,
+            db.T_TEST.C_TEXT,
+            db.V_TEST.C_TEXT,
+            db.V_TEST.createCommand(),
+            rec,
+            new DBRelation(db, "test", new DBRelation.DBReference[]{db.T_TEST.C_TEXT.referenceOn(db.T_TEST.C_TEXT)}),
+            new DBOrderByExpr(db.T_TEST.C_TEXT, true),
+            db.T_TEST.C_ID.is(55)
+    };
+  }
+
+  static class TestDatabase extends DBDatabase {
+    private final static long serialVersionUID = 1L;
+    
+    public final TestTable T_TEST = new TestTable(this);
+    public final TestView V_TEST = new TestView(this, T_TEST);
+
+    static class TestTable extends DBTable {
+      private final static long serialVersionUID = 1L;
+      public final DBTableColumn C_ID;
+      public final DBTableColumn C_TEXT;
+
+      TestTable(DBDatabase db) {
+        super("testtable", db);
+        this.C_ID = addColumn("id", DataType.INTEGER, 0, true);
+        setPrimaryKey(C_ID);
+        this.C_TEXT = addColumn("text", DataType.TEXT, 255, false);
+      }
+    }
+    static class TestView extends DBView {
+      private final static long serialVersionUID = 1L;
+      public final DBViewColumn C_TEXT;
+
+      TestView(DBDatabase db, TestTable t) {
+        super("testview", db);
+        this.C_TEXT = addColumn(t.C_TEXT);
+      }
+
+      @Override
+      public DBCommandExpr createCommand() {
+        TestDatabase db = (TestDatabase) getDatabase();
+        DBCommand cmd = db.createCommand();
+        cmd.select(db.T_TEST.C_TEXT);
+        cmd.where(db.T_TEST.C_ID.isGreaterThan(5));
+        return cmd;
+      }
+    }
+
+  }
+}

Propchange: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/SerializeTest.java
------------------------------------------------------------------------------
    eol-style = native

Propchange: incubator/empire-db/trunk/empire-db/src/test/java/org/apache/empire/db/SerializeTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message