openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p..@apache.org
Subject svn commit: r609824 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Date Tue, 08 Jan 2008 00:57:06 GMT
Author: pcl
Date: Mon Jan  7 16:57:05 2008
New Revision: 609824

URL: http://svn.apache.org/viewvc?rev=609824&view=rev
Log:
Obtain the DBDictionary up-front in the mapping tool constructor to ensure that the dictionary
is fully configured with connection-specific information.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java?rev=609824&r1=609823&r2=609824&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java
Mon Jan  7 16:57:05 2008
@@ -97,13 +97,15 @@
         ACTION_IMPORT,
     };
 
-    private static Localizer _loc = Localizer.forPackage(MappingTool.class);
+    private static final Localizer _loc =
+        Localizer.forPackage(MappingTool.class);
 
     private final JDBCConfiguration _conf;
     private final Log _log;
     private final String _action;
     private final boolean _meta;
     private final int _mode;
+    private final DBDictionary _dict;
 
     private MappingRepository _repos = null;
     private SchemaGroup _schema = null;
@@ -147,6 +149,8 @@
             _mode = MODE_META | MODE_MAPPING | MODE_QUERY;
         else
             _mode = MODE_MAPPING;
+
+        _dict = _conf.getDBDictionaryInstance();
     }
 
     /**
@@ -572,11 +576,10 @@
         SchemaGroup group = getSchemaGroup();
         Schema[] schemas = group.getSchemas();
         Table[] tables;
-        DBDictionary dict = _conf.getDBDictionaryInstance();
         for (int i = 0; i < schemas.length; i++) {
             tables = schemas[i].getTables();
             for (int j = 0; j < tables.length; j++)
-                dict.refSchemaComponents(tables[j]);
+                _dict.refSchemaComponents(tables[j]);
         }
 
         group.removeUnusedComponents();



Mime
View raw message