Enhancement of JPA entities
The JPA provider included in the Liberty profile is based on Apache OpenJPA. OpenJPA uses Java bytecode enhancement of JPA persistent types (Entity, Embeddable, MappedSuperclass) to add state tracking, and other necessary information to enable persistence and other optimized features within JPA classes. In an application server environment, enhancement of the JPA entities occurs automatically when the application is loaded by the Liberty profile server.
Pre-enhancement of JPA classes (or build time enhancement) is necessary when a persistence JAR is used in both application server, and non-application server environments. The most common ways to perform build time enhancement are the OpenJPA enhancer Ant task, and PCEnhancer. These build time enhancement options require the OpenJPA library and dependent libraries to be on the classpath. The JPA thin client JAR com.ibm.ws.jpa.thinclient_8.5.0.jar, an installable option for the Liberty profile, includes the OpenJPA library and dependent libraries.
If we installed the product using Installation Manager, the .jar file is in the runtimes directory. If we performed an archive installation , the .jar file is in the directory of the choice. To perform build time enhancement, include the JPA thin client .jar file on the classpath. Use the JPA thin client .jar file to ensure full compatibility with the application server.
Parent topic: Deploy a JPA application to the Liberty profileRelated information:
Enhancement - Persistent Classes