openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aron L <>
Subject Using to generate Java strings?
Date Fri, 06 Dec 2013 21:35:44 GMT
Hi All,

I've managed to get ReverseMappingTool running from within a plain-old Java
method. Using the following: 


JDBCConfiguration result = new JDBCConfigurationImpl();

Options rmOpts = new Options();
String argString = "-Log DefaultLevel=INFO -metaDataFactory jpa() -metadata
rmOpts.setFromCmdLine(StringUtils.split(argString, " "));

try {, new String[0], rmOpts);
} catch (Exception e) {


This successfully writes Java files reflective of the specified database to
the directory that my code is running in, as expected.

However, I would much prefer to have the Java generated returned in a map as
a String, than written to a file. I see a way of changing the code slightly
to make this happen: The method "recordCode" called by run on [1] below can
take a Map, and if the Map is there, it will write the code that I want to
that map. So if a variant of run(...) is added that allows the user to pass
a map which is then forwarded to that method, then the user will get the
code back.


Does anyone see a better way to do this, that doesn't involve changing the
code? And if not, should I submit this customization as a patch?


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message