Deploying a JPA application to Liberty

[17.0.0.2 and later]To enable Liberty to support an application that uses the Java™ Persistence API (JPA), you add the jpa-2.0, jpa-2.1, or jpaContainer-2.1 feature to the server.xml file, depending on which specification level you need. You also need to define persistence contexts and persistence units, and configure access to the entity manager and entity manager factory.

Before you begin

This task assumes that you created a Liberty server, on which you want to deploy an application that uses JPA. See Creating a Liberty server manually.

About this task

The following JPA features are available in Liberty:
  • The jpa-2.0 feature supports applications that use application-managed and container-managed JPA written to the JPA 2.0 specification. The support is built on Apache OpenJPA with extensions to support the container-managed programming model.
  • The jpa-2.1 feature supports applications that use application-managed and container-managed JPA written to the JPA 2.1 specification. The support is built on EclipseLink. If the built-in EclipseLink JPA privier is not being utilized, you may want to use the jpaContainer-2.1 feature instead in order to minimize the server runtime image.
  • [17.0.0.2 and later]The jpaContainer-2.1 feature supports applications that use application-managed and container-managed JPA written to the JPA 2.1 specification. This feature does not include a built-in JPA provider. The user must supply a JPA provider through a shared library, the global library, or embedded in the application.

For information about developing JPA applications by using WebSphere® Developer Tools, see Developing JPA applications.

Procedure


Icon that indicates the type of topic Task topic

File name: twlp_dep_jpa.html