JA09 - Java Persistence API 2 Development - 3 Days

View Dates and Locations

Course Description

The Java Persistence API (JPA) is a standard object-relational mapping (ORM) technology for Java Enterprise Edition applications. This course takes a detailed look at JPA 2, describing how to map complex relational structures and how to use the Java Persistence Query Language (JPQL) effectively.


At least 6 months Java programming experience. Familiarity with relational databases and SQL.


What you will learn:

  • Understanding persistence in Java EE
  • Mapping classes to tables
  • Using JPA to query entities
  • Using advanced query techniques
  • Managing entity lifetimes
  • Mapping associations and collections
  • Mapping inheritance hierarchies
  • Using the Criteria API


For on-site courses (i.e. at your premises), we are more than happy to tailor the course agenda to suit your exact requirements. In many cases, we are able to build your in-house standards and naming conventions into the delivered course.

On-site course enquiry (from £165 pp per day)

Course Details

View Dates and Locations

Persistence in Java EE
Entity beans
EntityManager and Persistence Units
Mapping entity classes to relational databases
Providing metadata via annotations and XML
Using the Java Persistence API
Summary of JPA 2.0 features

JPA Queries
Overview of Java Persistence Query Language (JPQL)
Lazy and eager Loading
Paging and scrolling

Going Further with JPA Queries
Queries across relationships (inner joins, outer joins, fetch joins)
Batch operations
Bulk updates
Named queries
Native queries
Primary key generation

Using the Criteria API
Overview of the Criteria API
Building Criteria API queries
Strongly typed query definitions

Working with Persistent Objects
Entity lifecycle
Entity identity
Transient, persistent, and detached states
Persistent object updates

Mapping Collections and Associations
Fetching strategies
Bidirectional many-to-one
Bidirectional one-to-one
Bidirectional many-to-many
Embedded objects

Mapping Inheritance
Inheritance mapping strategies
Table per concrete class
Table per subclass
Table per hierarchy

Transaction Management
Transaction configuration
Transaction API
Transaction propagation

Locking and Versioning
Optimistic locking and versioning
Pessimistic locking



Please be aware that due to COVID-19 we are not currently running public courses. However, most of our courses can be delivered over the web (with mainframe access where necessary).

Dates are being arranged daily - please phone or email for further information.

Course Enquiry