empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From doeb...@apache.org
Subject svn commit: r912415 - in /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db: ./ derby/ h2/ hsql/ mysql/ oracle/ postgresql/
Date Sun, 21 Feb 2010 22:00:54 GMT
Author: doebele
Date: Sun Feb 21 22:00:54 2010
New Revision: 912415

URL: http://svn.apache.org/viewvc?rev=912415&view=rev
Log:
EMPIREDB-71

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/h2/DBDatabaseDriverH2.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/hsql/DBDatabaseDriverHSql.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/mysql/DBDatabaseDriverMySQL.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/oracle/DBDatabaseDriverOracle.java
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/postgresql/DBDatabaseDriverPostgreSQL.java

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java?rev=912415&r1=912414&r2=912415&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/DBDatabaseDriver.java
Sun Feb 21 22:00:54 2010
@@ -29,6 +29,7 @@
 import java.util.Date;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.UUID;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -357,8 +358,11 @@
             String SeqName = (defValue != null) ? defValue.toString() : this.toString();
             return db.getNextSequenceValue(SeqName, conn);
         }
-        // Set database systems time and date
-        if ((type==DataType.DATE || type==DataType.DATETIME))
+        else if (type== DataType.UNIQUEID)
+        {   // emulate using java.util.UUID
+            return UUID.randomUUID();
+        }
+        else if ((type==DataType.DATE || type==DataType.DATETIME))
         {   // Get database system's date and time
             Date ts = db.getUpdateTimestamp(conn);
             return (type==DataType.DATE ? DateUtils.getDateOnly(ts) : ts);

Modified: incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
URL: http://svn.apache.org/viewvc/incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java?rev=912415&r1=912414&r2=912415&view=diff
==============================================================================
--- incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
(original)
+++ incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
Sun Feb 21 22:00:54 2010
@@ -586,6 +586,10 @@
                     sql.append("(" + String.valueOf((long) c.getSize()) + ") ");
                 }
                 break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
             case UNKNOWN:
                  log.error("Cannot append column of Data-Type 'UNKNOWN'");
                  return false;

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=912415&r1=912414&r2=912415&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
Sun Feb 21 22:00:54 2010
@@ -571,6 +571,10 @@
                 if (c.getSize() > 0)
                     sql.append(" (" + String.valueOf((long) c.getSize()) + ") ");
                 break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
             case UNKNOWN:
                  log.error("Cannot append column of Data-Type 'UNKNOWN'");
                  return false;

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=912415&r1=912414&r2=912415&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
Sun Feb 21 22:00:54 2010
@@ -541,6 +541,10 @@
             case BLOB:
                 sql.append("LONGVARBINARY");
                 break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
             case UNKNOWN:
                  log.error("Cannot append column of Data-Type 'UNKNOWN'");
                  return false;

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=912415&r1=912414&r2=912415&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
Sun Feb 21 22:00:54 2010
@@ -598,6 +598,10 @@
                 if (c.getSize() > 0)
                     sql.append(" (" + String.valueOf((long) c.getSize()) + ") ");
                 break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
             case UNKNOWN:
                  log.error("Cannot append column of Data-Type 'UNKNOWN'");
                  return false;

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=912415&r1=912414&r2=912415&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
Sun Feb 21 22:00:54 2010
@@ -631,6 +631,10 @@
                 if (c.getSize() > 0)
                     sql.append(" (" + String.valueOf((long) c.getSize()) + ") ");
                 break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
             case UNKNOWN:
                 log.error("Cannot append column of Data-Type 'UNKNOWN'");
                 return false;

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=912415&r1=912414&r2=912415&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
Sun Feb 21 22:00:54 2010
@@ -52,6 +52,7 @@
  */
 public class DBDatabaseDriverPostgreSQL extends DBDatabaseDriver
 {
+    @SuppressWarnings("hiding")
     private static final Log log = LogFactory.getLog(DBDatabaseDriverPostgreSQL.class);
     
     private static final String CREATE_REVERSE_FUNCTION =
@@ -720,6 +721,10 @@
             case BLOB:
                 sql.append("bytea");
                 break;
+            case UNIQUEID:
+                // emulate using java.util.UUID
+                sql.append("CHAR(36)");
+                break;
             case UNKNOWN:
                  log.error("Cannot append column of Data-Type 'UNKNOWN'");
                  return false;



Mime
View raw message