openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mik...@apache.org
Subject svn commit: r1071439 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
Date Wed, 16 Feb 2011 23:17:42 GMT
Author: mikedd
Date: Wed Feb 16 23:17:42 2011
New Revision: 1071439

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

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

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=1071439&r1=1071438&r2=1071439&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
Wed Feb 16 23:17:42 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
             }
         }
     }



Mime
View raw message