mirror of https://github.com/apache/openjpa.git
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
This commit is contained in:
parent
5a0b5b39e7
commit
26ef9ddabb
|
@ -97,13 +97,15 @@ public class MappingTool
|
||||||
ACTION_IMPORT,
|
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 JDBCConfiguration _conf;
|
||||||
private final Log _log;
|
private final Log _log;
|
||||||
private final String _action;
|
private final String _action;
|
||||||
private final boolean _meta;
|
private final boolean _meta;
|
||||||
private final int _mode;
|
private final int _mode;
|
||||||
|
private final DBDictionary _dict;
|
||||||
|
|
||||||
private MappingRepository _repos = null;
|
private MappingRepository _repos = null;
|
||||||
private SchemaGroup _schema = null;
|
private SchemaGroup _schema = null;
|
||||||
|
@ -147,6 +149,8 @@ public class MappingTool
|
||||||
_mode = MODE_META | MODE_MAPPING | MODE_QUERY;
|
_mode = MODE_META | MODE_MAPPING | MODE_QUERY;
|
||||||
else
|
else
|
||||||
_mode = MODE_MAPPING;
|
_mode = MODE_MAPPING;
|
||||||
|
|
||||||
|
_dict = _conf.getDBDictionaryInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -572,11 +576,10 @@ public class MappingTool
|
||||||
SchemaGroup group = getSchemaGroup();
|
SchemaGroup group = getSchemaGroup();
|
||||||
Schema[] schemas = group.getSchemas();
|
Schema[] schemas = group.getSchemas();
|
||||||
Table[] tables;
|
Table[] tables;
|
||||||
DBDictionary dict = _conf.getDBDictionaryInstance();
|
|
||||||
for (int i = 0; i < schemas.length; i++) {
|
for (int i = 0; i < schemas.length; i++) {
|
||||||
tables = schemas[i].getTables();
|
tables = schemas[i].getTables();
|
||||||
for (int j = 0; j < tables.length; j++)
|
for (int j = 0; j < tables.length; j++)
|
||||||
dict.refSchemaComponents(tables[j]);
|
_dict.refSchemaComponents(tables[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
group.removeUnusedComponents();
|
group.removeUnusedComponents();
|
||||||
|
|
Loading…
Reference in New Issue