Java EE Persistence

This course offers a comprehensive and detail-oriented treatment of the Java Persistence API (JPA) and its use in the Java-EE environment. We cover JPA basics including simple object/relational concepts and annotations, persistence contexts and entity managers, and configuration via persistence.xml. We get a good grounding in the Java Persistence Query Language (JPQL) and take advantage of a prepared JPQL query console to explore the two schemas on which the course's case studies are based. We then look at practical issues involved in using JPA in the enterprise context, including Java EE Bean Validation, working with server-managed data sources, dependency injection, container-managed transactions, and transaction propagation.

This version of the course supports JPA 2.1 with a choice of two providers: EclipseLink 2.6, which is pre-configured for course exercises, and Hibernate® 5.0. Switching providers is just a matter of moving a few lines in and out of XML comments in the relevant persistence.xml file, and we encourage instructors to demonstrate both providers, to illustrate portability and for comparison of some finer points.

The course also supports either the Derby or Oracle® RDBMS. Derby is bundled with the course software and is pre-configured; a script is included to change over to Oracle configurations for all exercises and schema-creation scripts are available for both.


Public Classes: Delivered live online via WebEx and guaranteed to run . Join from anywhere!

Private Classes: Delivered at your offices , or any other location of your choice.

Course Topics
  1. Understand the value of object/relational mapping and JPA's role as a standard for ORM implementations.
  2. Develop JPA entities using JPA annotations to align the Java classes, properties, and types to relational tables, columns, and types.
  3. Create entity managers and instantiate persistence contexts to perform create/retrieve/update/delete (CRUD) operations.
  4. Implement entity relationships of all cardinalities, including unidirectional and bidirectional relationships.
  5. Map composite primary keys, inheritance relationships, eager/lazy fetching, and cascading operations.
  6. Use JPQL to write object-oriented queries, and process query results.
  7. Define JSR-303 validation constraints on JPA entities and see them enforced by the JPA provider.
  8. Use server-managed data sources.
  9. Take advantage of Java-EE dependency injection to connect entity managers and factories.
  10. Use annotations to direct container-managed transactions and to control transaction propagation.
  1. Introduction to JPA
    1. Object/Relational Mapping
    2. Mismatches Between Relational and Object Models
    3. The Java Persistence API
    4. JPA Architecture
    5. Entity Metadata
    6. The Entity Manager
    7. JPA Providers
  2. Single-Table Mapping
    1. Annotations
    2. JavaBean Standards
    3. Property, Field, and Mixed Access
    4. Table and Column Mapping
    5. Primary Keys and Key Generation
    6. Type Mappings
    7. Temporal and Enumerated Types
    8. Embedded Types
    9. Converters
  3. Mapping Associations
    1. @Embeddable Types
    2. Entity Relationships
    3. @ManyToOne Relationships
    4. @OneToOne Relationships
    5. @OneToMany Relationships
    6. @ManyToMany Relationships
    7. Eager and Lazy Loading
  4. Entity Managers
    1. Putting Entities to Work
    2. persistence.xml
    3. Entity State and Transitions
    4. Managing Transactions
    5. Persistence Operations
    6. Creating Queries
    7. Named Queries
    8. Query Parameters
    9. Native Queries
    10. Stored-Procedure Queries
  5. JPQL
    1. The Java Persistence Query Language
    2. Query Structure
    3. Path Expressions
    4. Filtering
    5. Scalar Functions
    6. Using Native Functions
    7. Operators and Precedence
    8. between, like, in
    9. is null, is empty
    10. Ordering
    11. Aliases
    12. Grouping
    13. Aggregate Functions
    14. Joins
    15. Fetch Joins
    16. Constructors
    17. Updates and Deletes
  6. Persistence Components
    1. Encapsulating Persistence Logic
    2. Design Considerations
    3. Testability
    4. Transaction Control
    5. Exception Handling
    6. Generic Types
  7. Advanced Mappings
    1. Inheritance Strategies
    2. Single-Table Strategy
    3. Joined-Table Strategy
    4. Table-Per-Concrete-Class Strategy
    5. Querying Over Inheritance Relationships
    6. Secondary Tables
    7. Composite Primary Keys
    8. @IdClass and @EmbeddedId
    9. Derived Identifiers
    10. @ElementCollection
    11. Default Values
    12. @Version Fields
    13. Cascading and Orphan Removal
    14. Detachment and Merging
  8. Validation
    1. JSR-303 Validation
    2. Constraint Annotations
    3. Validation Modes
    4. Validation Groups
    5. Handling Validation Exceptions
  9. JPA in Java EE
    1. Enterprise Applications
    2. Dependency Injection
    3. Separation of Concerns
    4. JNDI
    5. JDBC Data Sources
    6. @PersistenceUnit and @PersistenceContext
    7. Container-Managed Transactions
    8. Enterprise JavaBeans
    9. @Stateful and @Stateless
    10. @EJB
    11. @TransactionAttribute
    12. Logging Transactions
    13. Impact on Exception Handling
    14. Persistence-Context Duration
    15. Extended Persistence Contexts
    16. Testability
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 is required for this Java EE class:

  • A strong Java programming background is essential for this course
  • Knowledge of relational database concepts and SQL is recommended
  • Prior experience with JDBC will be a plus but is not required.

Training for your Team

Length: 4 Days
  • Private Class for your Team
  • Online or On-location
  • Customizable
  • Expert Instructors

What people say about our training

Great knowledgeable instructor. Good personality, very friendly. Excellent quality and quantity of the information provided.
John ONeal
Journalnow/Media General
Beyond expectations for groups and individuals.
Scott Digby
The Coca-Cola Company
This course will quickly get you started with Spring framework.
Balwinder Jathaul
GSA, FAS, National Customer Service Center
Great selection of courses and great instructors.
Shane Walker
Peterson AFB

No cancelation for low enrollment

Certified Microsoft Partner

Registered Education Provider (R.E.P.)

GSA schedule pricing


Students who have taken Instructor-led Training


Organizations who trust Webucator for their Instructor-led training needs


Satisfaction guarantee and retake option


Students rated our trainers 9.30 out of 10 based on 30,406 reviews

Contact Us or call 1-877-932-8228