empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From franci...@apache.org
Subject svn commit: r793726 - /incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java
Date Mon, 13 Jul 2009 21:56:34 GMT
Author: francisdb
Date: Mon Jul 13 21:56:34 2009
New Revision: 793726

URL: http://svn.apache.org/viewvc?rev=793726&view=rev
Log:
EMPIREDB-44
Fix for CLOB data type in Derby driver

Modified:
    incubator/empire-db/trunk/empire-db/src/main/java/org/apache/empire/db/derby/DBDatabaseDriverDerby.java

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=793726&r1=793725&r2=793726&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
Mon Jul 13 21:56:34 2009
@@ -573,12 +573,18 @@
             }
                 break;
             case CLOB:
-                sql.append("LONGTEXT");
+                sql.append("CLOB");
+                if (c.getSize() > 0)
+                {
+                    sql.append("(" + String.valueOf((long) c.getSize()) + ") ");
+                }
                 break;
             case BLOB:
                 sql.append("BLOB");
                 if (c.getSize() > 0)
-                    sql.append(" (" + String.valueOf((long) c.getSize()) + ") ");
+                {
+                    sql.append("(" + String.valueOf((long) c.getSize()) + ") ");
+                }
                 break;
             case UNKNOWN:
                  log.error("Cannot append column of Data-Type 'UNKNOWN'");
@@ -586,7 +592,8 @@
         }
         // Default Value
         if (isDDLColumnDefaults() && c.getDataType()!=DataType.AUTOINC &&
c.getDefaultValue()!=null)
-        {   sql.append(" DEFAULT ");
+        {   
+            sql.append(" DEFAULT ");
             sql.append(getValueString(c.getDefaultValue(), c.getDataType()));
         }
         // Nullable



Mime
View raw message