3.15.1.5. Reverse Mapping Tool Ant Task
The reverse mapping tool task allows you to directly invoke the reverse mapping tool from within Ant.
While many users will only run the reverse mapping process once, others will make it part of their build process.
The task’s parameters correspond exactly to the long versions of the command-line arguments to the org.apache.openjpa.jdbc.meta.ReverseMappingTool.
Following is an example of a build.xml target that invokes the reverse mapping tool:
Example 174. Invoking the Reverse Mapping Tool from Ant
<target name="reversemap">
<!-- define the reversemappingtool task; this can be done at the top of -->
<!-- the build.xml file, so it will be available for all targets -->
<taskdef name="reversemappingtool"
classname="org.apache.openjpa.jdbc.ant.ReverseMappingToolTask"/>
<!-- reverse map the entire database -->
<reversemappingtool package="com.xyz.model" directory="${basedir}/src"
customizerProperties="${basedir}/conf/reverse.properties">
<codeformat tabSpaces="4" spaceBeforeParen="true" braceOnSameLine="false"/>
</reversemappingtool>
</target>