You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by mi...@apache.org on 2011/02/21 20:54:23 UTC

svn commit: r1073124 - /openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

Author: mikedd
Date: Mon Feb 21 19:54:22 2011
New Revision: 1073124

URL: http://svn.apache.org/viewvc?rev=1073124&view=rev
Log:
OPENJPA-1940: Use unqualified name when looking for PK columns on Oracle

Modified:
    openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java

Modified: openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1073124&r1=1073123&r2=1073124&view=diff
==============================================================================
--- openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/branches/2.1.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Mon Feb 21 19:54:22 2011
@@ -771,26 +771,30 @@ public class OracleDictionary
         ResultSet rs = null;
         try {
             int idx = 1;
-            if (!DBIdentifier.isNull(schemaName))
+            if (!DBIdentifier.isNull(schemaName)) {
                 setString(stmnt, idx++, convertSchemaCase(schemaName), null);
-            if (!DBIdentifier.isNull(tableName))
-                setString(stmnt, idx++, convertSchemaCase(tableName), null);
+            }
+            if (!DBIdentifier.isNull(tableName)) {
+                setString(stmnt, idx++, convertSchemaCase(tableName.getUnqualifiedName()), null);
+            }
             setTimeouts(stmnt, conf, false);
             rs = stmnt.executeQuery();
-            List pkList = new ArrayList();
-            while (rs != null && rs.next())
+            List<PrimaryKey> pkList = new ArrayList<PrimaryKey>();
+            while (rs != null && rs.next()) {
                 pkList.add(newPrimaryKey(rs));
-            return (PrimaryKey[]) pkList.toArray
-                (new PrimaryKey[pkList.size()]);
+            }
+            return pkList.toArray(new PrimaryKey[pkList.size()]);
         } finally {
             if (rs != null)
                 try {
                     rs.close();
                 } catch (Exception e) {
+                    // ignore cleanup exception
                 }
             try {
                 stmnt.close();
             } catch (Exception e) {
+                // ignore cleanup exception
             }
         }
     }