Very effective, thorough and from the convenience of your home or cube. I love it! More Testimonials »

Fast Track to the Java Persistence API Version 2

Delivery Options

Class Date and Time Price Pricing Information
$1,575.00
or 3 vouchers vouchers
$1,575.00 or 3 vouchers vouchers
$1,575.00 or 3 vouchers vouchers

Class Description

Class Overview

This Java Persistence API training covers everything you need to know to begin working with the Java Persistence API in a very short time. It covers all the important concepts necessary to access and update data stored in relational databases. It includes an extensive series of labs to exercise all major capabilities.

Class Goals

  • Understand the JPA architecture
  • Learn to create JPA based applications
  • Understand and use JPA to map persistent objects to the database
  • Learn to create JPA persistence units, and understand JPA persistence contexts and the Entity Lifecycle
  • Learn to use the JPA EntityManager
  • Learn to work with queries and JPQL (Java Persistence Query Language), as well as the Criteria API (JPA 2)
  • Understand and work with collections & associations
  • Learn to use versioning support for optimistic locking
  • Learn to map inheritance hierarchies using JPA
  • Learn how to performance tune your JPA applications
  • Understand JPA transaction support
  • Understand the relationship between JPA / EJB3
  • Use JPA entities from session beans (Optional)
  • Be familiar with Spring support for JPA (Optional)

Class Outline

  1. Introduction to Java Persistence API (JPA)
    1. Overview
      1. Persistence Layers, Object-Relational Mapping (ORM), JDBC
      2. JPA Overview
    2. Mapping with JPA
      1. Entities and @Entity, ids and @Id,
      2. Generated Id Values
      3. Basic Mapping Types
    3. Persistence Unit and EntityManager
      1. Persisting to the DB, the EntityManager API
      2. Persistence Units, Config, Persistence Context
      3. Retrieving Persistent Entities with find()
    4. More About Mappings
      1. Default Mappings, @Basic, @Column
      2. Field vs. Property Access
      3. Temporal (Date/Time) Mappings
    5. Logging Options (Provider based)
  2. Updates and Queries
    1. Inserting and Updating - Persisting new Entities, Updating an Instance, Removing an Instance
    2. Querying and JPQL
      1. Entity Based Queries, SELECT ,WHERE
      2. Query Interface, Executing Queries, Generic Queries (JPA 2)
      3. JPQL Operators, Expressions, and Parameters
      4. Named Queries
    3. Additional Query Capabilities
      1. Projection query, Ordering, Aggregate Query, Build Update and Delete
    4. Embedded Objects
      1. @Embeddable, @Embedded
      2. Defining and using Embedded Objects
    5. Compound Primary Keys - @EmbeddedID, @IDClass, Defining Compound Keys
  3. The Persistence Lifecycle
    1. Transaction Overview and Transactions in JPA
      1. Transaction Overview
      2. EntityTransaction API (including JTA and resource-local EntityManager)
    2. The Persistence Lifecycle
      1. JPA Entity States (New, Managed, Detached, Removed), and Entity State Diagram
      2. Persistence Context - Lifespan, Propagation
      3. Synchronization to the DB
    3. Versioning and Optimistic Locking
      1. Overview, Detached Instances
      2. Versioning, @Version, Optimistic Locking
    4. Lifecycle Callbacks
      1. @PrePersist, @PostPersist, etc.
      2. Entity Listeners, @EntityListeners
  4. Entity Relationships
    1. Relationships Overview: Object Relationships, Participants, Roles, Directionality, Cardinality
    2. Relationship Mapping
      1. Mapping Overview (1-1, 1-N, N-1, N-N)
      2. Unidirectional and Bidirectional
      3. @ManyToOne, @OneToMany, Table Structures
      4. Relationship Inverse - Owning Side
      5. Collection Types (List, Set, etc)
      6. Cascading Over Relationships (including orphanRemoval - JPA 2)
      7. @ManyToMany, @OneToOne
      8. Lazy and Eager Loading
      9. Queries Across Relationships (Inner Joins, Outer Joins, Fetch Joins)
    3. Entity Inheritance Mapping
      1. Overview
      2. Single Table Mapping
      3. Joined (Table per Subclass) Mapping
      4. Table per Concrete Class Mapping
      5. Pros and Cons
    4. Element Collections (JPA 2)
      1. Overview, Collections of Value Objects, @ElementCollection, @CollectionTable
      2. Using Element Collections
      3. Collections of Embeddables
  5. The Crietria API (JPA 2)
    1. Overview of the Criteria API
    2. Path Expressions, Building Queries (CriteriaBuilder, CriteriaQuery, Subquery, Predicate, Expression, Order, Selection, Join)
    3. Executing Queries and Accessing Results
  6. Additional JPA Capabilities
    1. XML Mapping Files
    2. Bean Validation (JPA 2)
    3. Best Practices
      1. Primary Keys, Named Queries, Lazy/Eager Loading, Transactional Semantics, Encapsulation, Report Queries
  7. Integration
    1. Data Access Objects (DAO) and Java SE Integration (Optional)
      1. DAO Overview
      2. JpaUtil Class for EntityManager management in Java SE
      3. Lifecycle Considerations
    2. Integration with EJB (Optional)
      1. Using JPA with Session Beans
      2. Container Managed (Injected) Entity Manger
      3. JTA Transactions and Lifecycle Considerations
      4. Extended Persistence Contexts
    3. Using JPA with Java Web Apps
      1. Using EntityManager in Web apps - request scoping
      2. Lazy Loading - Open EntityManager in View Pattern
    4. Integration with Spring (Optional)
      1. Injection of EntityManger, EntityManagerFactory
      2. LocalEntityManagerFactoryBean
      3. JPA/Spring Based DAO

Class Materials

Each student in our Live Online and our Onsite classes receives a comprehensive set of materials, including course notes and all the class examples.

Class Prerequisites

Experience in the following areas is required:

    Substantial prior Java development and relational database experience.

Technical Requirements

Our computer technical requirements and setup process is easy, with support just a click away.


  • Java ®, all Java-based marks, Hibernate ®, and all Hibernate-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. or its subsidiaries in the U.S. and other countries.
Client Success
  1. Independent Survey
  2. Client List
  3. Testimonials
Join The Team
  1. Learn how you can become a Webucator Trainer
  2. Career Opportunities
Locations
Compare Us
Watch 3-minute Demo Video
of Live Online Training:
Learn the benefits of online training with Webucator
Webucator is a Registered Education Provider (R.E.P.) approved by PMI to issue professional development units (PDUs) for our training courses.
© Webucator, Inc. All rights reserved. | Toll Free: 1-877-932-8228 | From outside the USA: 315-849-2724| Fax: 315-849-2723