openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r665801 - in /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc: schema/SchemaGenerator.java sql/DBDictionary.java sql/InformixDictionary.java
Date Mon, 09 Jun 2008 17:53:22 GMT
Author: mikedd
Date: Mon Jun  9 10:53:22 2008
New Revision: 665801

URL: http://svn.apache.org/viewvc?rev=665801&view=rev
Log:
OPENJPA-629 trim schema name for Informix only.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java?rev=665801&r1=665800&r2=665801&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
Mon Jun  9 10:53:22 2008
@@ -756,8 +756,10 @@
                 seq++;
 
             // find pk table
-            pkSchemaName = 
-                StringUtils.trimToNull(fks[i].getPrimaryKeySchemaName());
+            pkSchemaName = fks[i].getPrimaryKeySchemaName();
+            if(_dict.getTrimSchemaName()) {
+                pkSchemaName= StringUtils.trimToNull(pkSchemaName);
+            }
             pkTableName = fks[i].getPrimaryKeyTableName();
             if (_log.isTraceEnabled())
                 _log.trace(_loc.get("gen-fk", new Object[]{ name, table,

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=665801&r1=665800&r2=665801&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Mon Jun  9 10:53:22 2008
@@ -237,6 +237,11 @@
     public boolean supportsModOperator = false;
     public boolean supportsXMLColumn = false;
     public boolean reportsSuccessNoInfoOnBatchUpdates = false;
+    
+    /**
+     * Some Databases append whitespace after the schema name 
+     */
+    public boolean trimSchemaName = false;
 
     // functions
     public String castFunction = "CAST({0} AS {1})";
@@ -4438,4 +4443,12 @@
     public int getBatchUpdateCount(PreparedStatement ps) throws SQLException {
         return 0;
     }
+    
+    public boolean getTrimSchemaName() { 
+        return trimSchemaName;
+    }
+    
+    public void setTrimSchemaName(boolean trimSchemaName) { 
+        this.trimSchemaName = trimSchemaName; 
+    }
 }

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java?rev=665801&r1=665800&r2=665801&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/InformixDictionary.java
Mon Jun  9 10:53:22 2008
@@ -148,6 +148,8 @@
         // Informix does not support foreign key delete action NULL or DEFAULT
         supportsNullDeleteAction = false;
         supportsDefaultDeleteAction = false;
+        
+        trimSchemaName = true;
     }
 
     public void connectedConfiguration(Connection conn)



Mime
View raw message