openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r1031109 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
Date Thu, 04 Nov 2010 17:58:00 GMT
Author: mikedd
Date: Thu Nov  4 17:58:00 2010
New Revision: 1031109

URL: http://svn.apache.org/viewvc?rev=1031109&view=rev
Log:
OPENJPA-1870: Check if columnDefinition was provided before overriding blob type. 

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java?rev=1031109&r1=1031108&r2=1031109&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/MySQLDictionary.java
Thu Nov  4 17:58:00 2010
@@ -32,6 +32,7 @@ import java.util.Set;
 
 import org.apache.commons.lang.StringUtils;
 import org.apache.openjpa.jdbc.identifier.DBIdentifier;
+import org.apache.openjpa.jdbc.identifier.DBIdentifier.DBIdentifierType;
 import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration;
 import org.apache.openjpa.jdbc.kernel.JDBCStore;
 import org.apache.openjpa.jdbc.kernel.exps.FilterValue;
@@ -459,7 +460,8 @@ public class MySQLDictionary
      */
     @Override
     public String getTypeName(Column col) {
-        if (col.getType() == Types.BLOB) {
+        // handle blobs differently, if the DBItentifierType is NULL (e.g. no column definition
is set). 
+        if (col.getType() == Types.BLOB && col.getTypeIdentifier().getType() == DBIdentifierType.NULL)
{
             if (col.getSize() <= 0)   // unknown size
                 return blobTypeName;  // return old default of 64KB
             else if (col.getSize() <= 255)



Mime
View raw message