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

Compare with Current View Page History

« Previous Version 17 Next »

Quick Start Guide

Apache OpenJPA is a Java persistence project at The Apache Software Foundation that can be used as a stand-alone POJO persistence layer or integrated into any Java EE compliant container and many other lightweight frameworks, such as Tomcat and Spring.

The 1.x releases (1.2.2 is the latest) are a production ready, feature-rich, compliant implementation of the Java Persistence API (JPA) 1.0 part of the JSR-220 Enterprise Java Beans 3.0 specification, which pass the Sun JPA 1.0b Technology Compatibility Kit.

The 2.x releases (2.2.0 is the latest) are a production ready, compliant implementation of the JSR-317 Java Persistence 2.0 specification, which is backwards compatible to the JPA 1.0 specification and passes the Sun JPA 2.0 Technology Compatibility Kit.

The upcoming 2.3 release is based off of the 2.2.x release stream and will contain some additional features (TBD).

Runtime Dependencies

To use OpenJPA as a stand-alone Java component or with a lightweight non-Java EE framework, please refer to the following Build and Runtime Dependencies page for the supported levels of Java SE.

To use OpenJPA in a Java EE application server, please refer to the following Container Integration page for the known platforms that either include OpenJPA or have been tested with OpenJPA.

JPA Examples

OpenJPA provides some simple examples as part of the binary distribution on the Downloads page. The following Samples page provides quick start instructions on how to build and run these samples, along with pointers to other JPA samples from the Apache Geronimo project.

Enhancing Entities

The JPA spec requires some type of monitoring of Entity objects, but the spec does not define how to implement this monitoring. Some JPA providers auto-generate new subclasses or proxy objects that front the user's Entity objects at runtime, while others use byte-code weaving technologies to enhance the actual Entity class objects at build time. OpenJPA supports both enhancement methods, but strongly suggests only using the build time enhancement. The following Entity Enhancement page includes more details on both enhancement types, along with examples on how to setup build time enhancement in ANT, Maven and Eclipse environments.


  • No labels