English French German Italian Portuguese Russian Spanish


  • Java Training

    javaInterSource offers live instructor-led courses on all important Java-related technologies, including Apache Struts, Enterprise Java Beans (EJB), J2SE Desktop Java Enterprise Edition (Java EE), Java Fundamentals, Java Web Services, JavaServer Faces, JBoss, Java Server Pages (JSP), and Spring.

    Please refer to our detailed course outlines below.

  • About Java

    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture

    Java is general-purpose, concurrent, class-based, and object-oriented, and is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere". Java is considered by many as one of the most influential programming languages of the 20th century, and widely used from application software to web application.

    Read More

  • Course Details Java

    Classes are offered at client sites, at our Geneva training center, and via a live web conference. For detailed course outlines and scheduled classes, please see below.

    To book training, navigate to the course you need, then:

    • For scheduled online classes, register from the choices indicated.
    • If you need an alternative date, time or location, or if you want a live classroom course, click on “request an offer for this course,” to complete the form.

Fast Track to the Java Persistence API Version 2

 PDF PrintEmail

Course duration

  • 3 Days

Course Outline

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.

  • 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)
    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

    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.