Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java
- ===================================================================
- --- openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java (revision 1547603)
- +++ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ReverseMappingTool.java (working copy)
- @@ -846,8 +846,7 @@
- *
- * @return a list of {@link File} instances that were written
- */
- - public List recordCode()
- - throws IOException {
- + public List recordCode() throws IOException {
- return recordCode(null);
- }
- @@ -1755,6 +1754,10 @@
- return tool;
- }
- + protected static ReverseMappingTool newInstance(JDBCConfiguration conf) {
- + return new ReverseMappingTool(conf);
- + }
- +
- ////////
- // Main
- ////////
- @@ -1994,12 +1997,19 @@
- run(conf, args, flags, loader);
- return true;
- }
- -
- +
- /**
- * Run the tool.
- */
- - public static void run(JDBCConfiguration conf, String[] args,
- - Flags flags, ClassLoader loader)
- + public static void run(JDBCConfiguration conf, String[] args, Flags flags, ClassLoader loader) throws IOException,
- + SQLException {
- + run(conf, args, flags, loader, null);
- + }
- +
- + /**
- + * Run the tool and write to the optionally provided map
- + */
- + public static void run(JDBCConfiguration conf, String[] args, Flags flags, ClassLoader loader, Map output)
- throws IOException, SQLException {
- // parse the schema to reverse-map
- Log log = conf.getLog(OpenJPAConfiguration.LOG_TOOL);
- @@ -2021,7 +2031,7 @@
- }
- // flags
- - ReverseMappingTool tool = new ReverseMappingTool(conf);
- + ReverseMappingTool tool = newInstance(conf);
- tool.setSchemaGroup(schema);
- tool.setPackageName(flags.packageName);
- tool.setDirectory(flags.directory);
- @@ -2052,7 +2062,12 @@
- tool.buildAnnotations();
- }
- log.info(_loc.get("revtool-write-code"));
- - tool.recordCode();
- + if(output == null){
- + tool.recordCode();
- + } else{
- + tool.recordCode(output);
- + }
- +
- if (!LEVEL_NONE.equals(flags.metaDataLevel)) {
- log.info(_loc.get("revtool-write-metadata"));
- tool.recordMetaData(LEVEL_CLASS.equals(flags.metaDataLevel));
Advertisement
Add Comment
Please, Sign In to add comment