From 26ef9ddabbb3deb3f7fb8f8145ddc3131ec51e5c Mon Sep 17 00:00:00 2001 From: Patrick Linskey Date: Tue, 8 Jan 2008 00:57:05 +0000 Subject: [PATCH] Obtain the DBDictionary up-front in the mapping tool constructor to ensure that the dictionary is fully configured with connection-specific information. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@609824 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/meta/MappingTool.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java index 91533e548..fb6b7d518 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/MappingTool.java @@ -97,13 +97,15 @@ public class MappingTool 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 @@ public class MappingTool _mode = MODE_META | MODE_MAPPING | MODE_QUERY; else _mode = MODE_MAPPING; + + _dict = _conf.getDBDictionaryInstance(); } /** @@ -572,11 +576,10 @@ public class MappingTool 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();