The wsreversemapping tool generates persistent class definitions and metadata from a database schema.
The Feature Pack
for OSGi Applications and JPA 2.0 introduces support for Apache OpenJPA
2.0.
Run the JPA commands
(.bat on Windows or .sh on UNIX) from the <profile_root>/bin directory,
rather than from the <app_server_root>/bin directory to make sure
you have the latest version of the commands for your release level.
Before running the command, you must have a copy of persistence.xml file on the classpath, or specify it as a properties file through the -p [path_to_persistence.xml] argument.
The command syntax is as follows:
wsreversemapping.sh [parameters][arguments]
wsreversemapping.bat [parameters][arguments]
${profile_root}/bin/wsreversemapping.sh -pkg com.xyz -d ./src schema.xml
${profile_root}\bin\wsreversemapping.bat -pkg com.xyz -d ./src schema.xml
C:\> %profile_root%/bin/wsreversemapping.bat -sa dropDB Magazine.javapkg com.reversemapped -d src -connectionDriverName=com.ibm.db2.jcc.DB2Driver -connectionURL=jdbc:db2:localhost:50000/TEST -connectionUser=db2User -connectionPassword=db2Password
C:\> %profile_root%\bin\wsreversemapping.bat -sa dropDB Magazine.javapkg com.reversemapped -d src -connectionDriverName=com.ibm.db2.jcc.DB2Driver -connectionURL=jdbc:db2:localhost:50000/TEST -connectionUser=db2User -connectionPassword=db2Password
For more information, consult the mapping section in the Apache OpenJPA User's Guide.