You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Migration Tool

This command-line utility translates proprietary mapping descriptors to standard JPA mapping descriptors.

Usage:

$ java org.apache.openjpa.tools.MigrationTool -input xyz.xml -output xyz.orm.xml -error error.txt+ -actions migration-actions.xml -verbose

where

-input

input location of the proprietary XML mapping descriptor resource. The resource is looked up in the current classpath. If not located as a resource, then looked up as an input file in relative to the current directory. This option is mandatory

-output

output location of the translated mapping descriptor file. This option is not mandatory. If unspecified, the output is simply printed on the standard console.

-error

output location of the non-translatable attributes or elements. Adding a + sign at the end of the file name will append the warning messages to an existing file. This option is not mandatory. If unspecified, the output is printed on the standard error console.

-actions

the actions to be performed on every element of the input descriptor elements. These actions are specified as XML elements compliant to a XML schema. A template of these actions for a subset of Hibernate elements is included in migration-actions.xml.
This option is not mandatory. The archetype for translating Hibernate mapping descriptor is used as a default.

-verbose

prints detailed trace of what the tool is doing. This option is not mandatory. If unspecified, detailed messages are not printed.

Discussion

This tool takes each top-level element of the input mapping descriptor and applies one or more actions to translate it to a standard JPA mapping descriptor.
For example, consider the fragment
{{
<id name="id" type="java.lang.Long" column="ID">
<generator class="native" />
</id>
}}

This tool is at experimental stage of development.

  • No labels