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.


Pre-requisites

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


Objectives

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

Customisation

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

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
Queries
Parameters
Paging and scrolling
Projections
Aggregates

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
Many-to-one
Bidirectional many-to-one
One-to-one
Bidirectional one-to-one
Many-to-many
Bidirectional many-to-many
Components
Embedded objects
Cascading

Mapping Inheritance
Overview
Inheritance mapping strategies
Table per concrete class
Table per subclass
Table per hierarchy
Unions
Polymorphism

Transaction Management
Transaction configuration
Transaction API
Transaction propagation

Locking and Versioning
Optimistic locking and versioning
Pessimistic locking


Availability

Course Enquiry