openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jrba...@apache.org
Subject svn commit: r934493 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.java
Date Thu, 15 Apr 2010 17:24:03 GMT
Author: jrbauer
Date: Thu Apr 15 17:24:02 2010
New Revision: 934493

URL: http://svn.apache.org/viewvc?rev=934493&view=rev
Log:
OPENJPA-1605 Correct regression issue with table generation issue in schema generator.  Only
the first table name returned in a generic DBMD query was used to populate the schema.  This
broke the reverse mapping tool, which uses a generic query by default.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/SchemaGenerator.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=934493&r1=934492&r2=934493&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
Thu Apr 15 17:24:02 2010
@@ -572,9 +572,12 @@ public class SchemaGenerator {
         Schema schema;
         Table table;
         DBIdentifier tableSchema = DBIdentifier.NULL;
+        DBIdentifier baseTableName = (tableName == null) ? DBIdentifier.NULL : tableName.clone();
         for (int i = 0; cols != null && i < cols.length; i++) {
-            if (DBIdentifier.isNull(tableName) || tableName.equals("%")) {
+            if (DBIdentifier.isNull(baseTableName) || baseTableName.equals("%")) {
                 tableName = cols[i].getTableIdentifier();
+            } else {
+                tableName = baseTableName;
             }
             if (DBIdentifier.isNull(schemaName)) {
                 tableSchema = DBIdentifier.trimToNull(cols[i].getSchemaIdentifier());



Mime
View raw message