New or updated for this feature pack


Assembling JPA applications for a Java SE environment

You have developed and configured your applications to work with the Java Persistence API (JPA). Now you need to package the JPA applications for your environment.

About this task

New or updated for this feature pack For this task, you need to specify the com.ibm.ws.jpa.thinclient_JPA2FEP1.0.0.jar standalone Java archive (JAR) file in your class path. This standalone JAR file is available from the server install images. The location of this file on the client install image is
java -javaagent:${app_client_root}/feature_packs/jpa/runtimes/com.ibm.ws.jpa.thinclient_JPA2FEP1.0.0.jar com.xyz.Main 

Procedure

  1. Package the application.
    Note: Package the persistence units in separate JAR files to make them more accessible and reusable. If you package the persistence units this way, they can be tested outside the container both with and without the occurrence of database persistence. The persistence units can be included in standalone applications or they can be packaged into EAR files as persistence archive files. If you package the persistence unit into a persistence archive file, all of the application components must be able to access the persistence archive. The application that uses the persistence units must declare a dependency on the persistence archive using the MANIFEST.MF Class-Path: declaration.

    The Criteria Metamodel class files that are generated by the Annotation Processor when you developed your JPA application, need to be included in the JAR file in the same location as the entity class files.

    Note: If you are using IBM Optim pureQuery Runtime, add the persistence_unit_name.pdqxml files or the persistence_unit_name.pdqxml files to the JPA application JAR file. The files are located in same META-INF directory where your persistence.xml file is located. These persistence files were created during the development task. See the topic, Developing JPA applications for a Java SE environment for more information.
    To package the application use the following command:
    jar -cvf ${jar_Name} ${entity_Path}
    where ${jar_Name} represents the name of the JAR file to create, and ${entityPath} represents the root location where the entities reside, which is where you compiled them.
  2. New or updated for this feature pack When you run your standalone application, specify the JAR files in your classpath when executing your application. The JAR file to execute is the stand-alone JAR file, com.ibm.ws.jpa.thinclient_JPA2FEP1.0.0.jar. For example, use the following Java call to run the com.xyz.Main standalone application:
    java -javaagent:${app_client_root}/feature_packs/jpa/runtimes/com.ibm.ws.jpa.thinclient_JPA2FEP1.0.0.jar com.xyz.Main 

What to do next

For more information on any of the commands, classes or other OpenJPA information discussed here, refer to the Apache OpenJPA User's Guide.



In this information ...


Related information

IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic Task topic    

Terms and conditions for information centers | Feedback

Last updatedLast updated: Jun 12, 2013 3:32:32 AM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v700osgijpa&product=was-nd-mp&topic=tejb_assemblejpase
File name: tejb_assemblejpase.html