JPA Training: The Java Persistence API

Print

Request an offer for classroom delivery of this course

Register for a Live Web Conference Course

Course duration

Course Outline

This course offers a comprehensive and detail-oriented treatment of the Java Persistence API (JPA) for developers interested in implementing persistence tiers for enterprise applications. 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. The course then moves into advanced topics including JPA-2.0 mapping options, the Criteria API, lifecycle hooks, JSR-303 validation, locking, and caching. Students will complete the course with a firm understanding of JPA architecture and plenty of hands-on exercise in entity mapping, persistence operations, and JPQL.

Course software includes two schemas: a fairly simple human-resources model (6 tables, 253 rows) for early chapters and a more sophisticated pharmacy schema (14 tables, 4255 rows) for the latter half of the course. The pharmacy schema is based on an open-source project and made available to Capstone Courseware by special permission.

This version of the course supports JPA 2.0 with a choice of two providers: EclipseLink 2.3, which is pre-configured for course exercises, and Hibernate® 4.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 at least here and there, to illustrate portability and for comparison's sake over 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.

  1. Introduction to JPA
    1. Object/Relational Mapping
    2. Mismatches Between Relational and Object Models
    3. The Java Persistence API
    4. JPA History
    5. JPA Architecture
    6. Entity Metadata
    7. The Entity Manager
    8. JPA Providers
  2. Object/Relational Mapping
    1. Annotations
    2. JavaBean Standards
    3. Property, Field, and Mixed Access
    4. Table and Column Mapping
    5. Primary Keys and Generation
    6. Type Mappings
    7. Temporal and Enumerated Types
    8. Embedded Types
    9. Entity Relationships
    10. @ManyToOne Relationships
    11. @OneToOne Relationships
    12. @OneToMany Relationships
    13. @ManyToMany Relationships
    14. Eager and Lazy Loading
  3. 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
  4. JPQL
    1. The Java Persistence Query Language
    2. Query Structure
    3. Path Expressions
    4. Filtering
    5. Scalar Functions
    6. Operators and Precedence
    7. between, like, in
    8. is null, is empty
    9. Ordering
    10. Aliases
    11. Grouping
    12. Aggregate Functions
    13. Joins
    14. Constructors
  5. 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
  6. The Criteria API
    1. History of the Criteria API
    2. Criteria Query Structure
    3. The MetaModel API and Query Type Safety
    4. Tuples
    5. Joins
    6. Predicates
    7. Building Expressions
    8. Ordering
    9. Grouping
    10. Encapsulating Persistence Logic
    11. Façades
    12. Range Queries
  7. Lifecycle and Validation
    1. Lifecycle Events
    2. Method Annotations
    3. Entity Listeners
    4. JSR-303 Validation
    5. Constraint Annotations
    6. Validation Modes
    7. Validation Groups
  8. Locking and Caching
    1. Concurrency
    2. Optimistic Locking
    3. Optimistic Read Locking
    4. Optimistic Write Locking
    5. Pessimistic Locking
    6. Caching
    7. Persistence Context as Transactional Cache
    8. Shared (2nd-level) Cache
    9. Locking and Caching "Do's and Don'ts"

InterSource Geneva, a premier Information Technology training firm, offers over 400 different courses on server, database and programming technologies, as well as end-user classes for the most popular office, graphics and design applications. We serve clients in Switzerland (Geneva, Lausanne, Bern, Basel, Zurich) and throughout Europe (France, Germany, Austria, Finland, Sweden, England, Netherlands, Spain, etc.).


InterSource offers custom, private courses at client sites, standard public courses in our Geneva classroom, and online training via live Web conference. Training is offered in English and many other languages (Francais, Deutsch, Espanol, Italiano.)


For an overall view of our offerings, please visit us at www.intersource.ch.