openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwsut...@apache.org
Subject svn commit: r585774 - in /openjpa: branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/ trunk/o...
Date Thu, 18 Oct 2007 01:37:58 GMT
Author: kwsutter
Date: Wed Oct 17 18:37:58 2007
New Revision: 585774

URL: http://svn.apache.org/viewvc?rev=585774&view=rev
Log:
OPENJPA-399.  Committing Teresa's most recent patch for this Issue.  Should be ready for resolution
now.

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
    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/DB2Dictionary.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/SQLServerDictionary.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java?rev=585774&r1=585773&r2=585774&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
Wed Oct 17 18:37:58 2007
@@ -819,8 +819,10 @@
         if (_log.isTraceEnabled())
             _log.trace(_loc.get("gen-seqs", schemaName, sequenceName));
 
+        // since all the sequences are generated under the default schema
+        // therefore, we can use the null schemaname to search
         Sequence[] seqs = _dict.getSequences(meta, conn.getCatalog(),
-            schemaName, sequenceName, conn);
+            null, sequenceName, conn);
 
         SchemaGroup group = getSchemaGroup();
         Schema schema;

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=585774&r1=585773&r2=585774&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Oct 17 18:37:58 2007
@@ -94,7 +94,7 @@
             "LONG VARCHAR FOR BIT DATA", "LONG VARCHAR", "LONG VARGRAPHIC",
         }));
         systemSchemas = new String(
-                "SYSCAT, SYSIBM, SYSSTAT, SYSIBMADM, SYSTOOLS");
+                "SYSCAT,SYSIBM,SYSSTAT,SYSIBMADM,SYSTOOLS");
         maxConstraintNameLength = 18;
         maxIndexNameLength = 18;
         maxColumnNameLength = 30;

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=585774&r1=585773&r2=585774&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java
Wed Oct 17 18:37:58 2007
@@ -3341,7 +3341,7 @@
         try {
             int idx = 1;
             if (schemaName != null)
-                stmnt.setString(idx++, schemaName);
+                stmnt.setString(idx++, schemaName.toUpperCase());
             if (sequenceName != null)
                 stmnt.setString(idx++, sequenceName);
 
@@ -3685,13 +3685,21 @@
         if (objectName == null)
             return null;
 
-        if (SCHEMA_CASE_LOWER.equals(schemaCase))
+        String scase = getSchemaCase();
+        if (SCHEMA_CASE_LOWER.equals(scase))
             return objectName.toLowerCase();
-        if (SCHEMA_CASE_PRESERVE.equals(schemaCase))
+        if (SCHEMA_CASE_PRESERVE.equals(scase))
             return objectName;
         return objectName.toUpperCase();
     }
 
+    /**
+     * Return DB specific schemaCase 
+     */
+    public String getSchemaCase(){
+        return schemaCase;
+    }
+    
     /**
      * Prepared the connection for metadata operations.
      */

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java?rev=585774&r1=585773&r2=585774&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
Wed Oct 17 18:37:58 2007
@@ -42,6 +42,7 @@
     private static final Localizer _loc = Localizer.forPackage
         (SQLServerDictionary.class);
 
+    private String schemaCase = SCHEMA_CASE_PRESERVE;
     /**
      * Flag whether to treat UNIQUEIDENTIFIER as VARBINARY or VARCHAR
      */
@@ -229,5 +230,12 @@
             append(getTypeName(type));
         appendLength(buf, type);
         buf.append("')");
+    }
+    
+    /**
+     * Return DB specific schemaCase
+     */
+    public String getSchemaCase() {
+        return schemaCase;
     }
 }

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=585774&r1=585773&r2=585774&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
Wed Oct 17 18:37:58 2007
@@ -819,8 +819,10 @@
         if (_log.isTraceEnabled())
             _log.trace(_loc.get("gen-seqs", schemaName, sequenceName));
 
+        // since all the sequences are generated under the default schema
+        // therefore, we can use the null schemaname to search
         Sequence[] seqs = _dict.getSequences(meta, conn.getCatalog(),
-            schemaName, sequenceName, conn);
+            null, sequenceName, conn);
 
         SchemaGroup group = getSchemaGroup();
         Schema schema;

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java?rev=585774&r1=585773&r2=585774&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DB2Dictionary.java
Wed Oct 17 18:37:58 2007
@@ -94,7 +94,7 @@
             "LONG VARCHAR FOR BIT DATA", "LONG VARCHAR", "LONG VARGRAPHIC",
         }));
         systemSchemas = new String(
-                "SYSCAT, SYSIBM, SYSSTAT, SYSIBMADM, SYSTOOLS");
+                "SYSCAT,SYSIBM,SYSSTAT,SYSIBMADM,SYSTOOLS");
         maxConstraintNameLength = 18;
         maxIndexNameLength = 18;
         maxColumnNameLength = 30;

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=585774&r1=585773&r2=585774&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
Wed Oct 17 18:37:58 2007
@@ -3364,7 +3364,7 @@
         try {
             int idx = 1;
             if (schemaName != null)
-                stmnt.setString(idx++, schemaName);
+                stmnt.setString(idx++, schemaName.toUpperCase());
             if (sequenceName != null)
                 stmnt.setString(idx++, sequenceName);
 
@@ -3708,13 +3708,21 @@
         if (objectName == null)
             return null;
 
-        if (SCHEMA_CASE_LOWER.equals(schemaCase))
+        String scase = getSchemaCase();
+        if (SCHEMA_CASE_LOWER.equals(scase))
             return objectName.toLowerCase();
-        if (SCHEMA_CASE_PRESERVE.equals(schemaCase))
+        if (SCHEMA_CASE_PRESERVE.equals(scase))
             return objectName;
         return objectName.toUpperCase();
     }
-
+    
+    /**
+     * Return DB specific schemaCase 
+     */
+    public String getSchemaCase(){
+        return schemaCase;
+    }
+        
     /**
      * Prepared the connection for metadata operations.
      */

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java?rev=585774&r1=585773&r2=585774&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLServerDictionary.java
Wed Oct 17 18:37:58 2007
@@ -42,6 +42,7 @@
     private static final Localizer _loc = Localizer.forPackage
         (SQLServerDictionary.class);
 
+    private String schemaCase = SCHEMA_CASE_PRESERVE;
     /**
      * Flag whether to treat UNIQUEIDENTIFIER as VARBINARY or VARCHAR
      */
@@ -229,5 +230,12 @@
             append(getTypeName(type));
         appendLength(buf, type);
         buf.append("')");
+    }
+    
+    /**
+     * Return DB specific schemaCase
+     */
+    public String getSchemaCase() {
+        return schemaCase;
     }
 }



Mime
View raw message