Building Database-Driven Applications with JPA

Course DateLocationDaysPriceRegister
Call for Classroom Training Dates3 $2,895Register

Course DateLocationDaysPriceRegister
Call for Live Virtual Class Dates3 $2,760Register

Building Database Driven Applications with JPA (SL-370-EE6)

Description: Persistence is the technique through which object models broker the access and manipulation of information from a relational database. JPA handles the details of how relational data is mapped to Java objects, and it standardizes Object/Relational mapping. JPA was introduced in Java EE 5, and provided a POJO-based persistence model for Java EE and Java SE applications. JPA has been enhanced in Java EE 6. The Java Persistence API (JPA) version 2.0 specification facilitates more effective and reliable (that is, more strongly typed) methodology for building object-centric criteria-based dynamic database queries. The Building Database-Driven Applications with Java Persistence API course examines the ins-and-outs of building database applications using the standard Java object-relational-mapping technology, Java Persistence API. This course covers both new features found in the Java Persistence API 2.0, as well as the features found in Java Persistence API 1.0. In this course you will learn the key
concepts found in the Java Persistence API, learn how to create robust entity models, create static and dynamic queries using Java Persistence API Query Language, and learn how to create type-safe queries with the Java Persistence API Criteria API. In addition, the course covers using the Java Persistence API within a stand-alone Java Standard Edition application, as well as within the context of a web-based Java Enterprise Edition application, including using Java Persistence API with the Enterprise JavaBeans technology.

Learn To:

  • Java Developers building components that take advantage of Java Persistence API technology or are migrating from the structured development of traditional JDBC-driven database access.
  • Java Developers interested in preparing for the Sun Certified Java Persistence Developer examination.
  • Implement business-tier functionality using Java Persistence API technology
  • Describe best practices and other advanced issues in business component development with Java Persistence API technology
  • Assemble and deploy Java Persistence API technology business-tier components on an application server, as well as in stand-alone applications
  • Create and use Query objects using the Java Persistence Query Language

Duration: 3 Days


  • Java EE Developer
  • Java Developer
  • J2EE Developer
  • Application Developers

Required Prerequisites:

  • Display experience with the Java programming language
  • Integrate existing Java code (for example, reuse existing classes created by other team members)
  • Java Programming Language, Java SE 6 (SL-275-SE6)
  • Developing Applications for the Java EE 6 Platform (FJ-310-EE6)

Suggested Prerequisites:

  • Object-Oriented Analysis and Design Using UML (OO-226)


Overview of the Java Persistence API

  • Describe the basics of Object Relational Mapping (ORM)
  • Define the key concepts of the Java Persistence API (entity, entity manager, and persistence unit)

Introducing the Auction Application

  • Describe the auction application
  • Define the domain objects of the auction application
  • Describe the implementation model for the auction system

Java Persistence API Entities

  • Describe the difference between objects and entities
  • Describe the difference between persistent fields and properties
  • Identify and use common Java Persistence API annotations, such as @Entity, @Id, @Table, and @Column

Understanding the Entity Manager

  • Describe the relationship between an entity manager, a persistence context, and a persistence unit
  • Describe the difference between a container-managed entity manager and an application-managed entity manager
  • Describe the entity life cycle

Modeling Entity Relationships

  • Examine association relationships in the data and object models
  • Use relationship properties to define associations
  • Implement one-to-one unidirectional associations
  • Implement one-to-one bidirectional associations
  • Implement many-to-one/one-to-many bidirectional associations
  • Implement many-to-many bidirectional associations
  • Implement many-to-many unidirectional associations
  • Examine fetch and cascade mode settings

Entity Inheritance and Object-Relational Mapping

  • Examine entity inheritance
  • Examining object/relational inheritance hierarchy mapping strategies
  • Inherit from an entity class
  • Inherit using a mapped superclass
  • Inherit from a non-entity class
  • Examine inheritance mapping strategies
  • Use an embeddable class

Persisting Enums and Collections

  • Persist entities that contain enums with @Enumerated
  • Persist entities that contain lists with @ElementCollection
  • Persist entities that contain maps with @ElementCollection

Introduction to Querying

  • Find an Entity by its primary key
  • Understand basic Java Persistence API query language queries
  • Understand native SQL queries
  • Understand basic Criteria API queries

Using the Java Persistence API Query Language

  • Examine the Java Persistence API query language
  • Create and use the SELECT statement
  • Create and use the UPDATE statement
  • Create and use the DELETE statement

Using the Java Persistence API Criteria API

  • Contrast queries that use the Criteria API with queries that use the Java Persistence query language
  • Describe the metamodel object approach to querying
  • Create Criteria API queries

Using the Java Persistence API in a Container

  • Use the Java Persistence API from a servlet
  • Use the Java Persistence API from a stateless session bean

Implementing Transactions and Locking

  • Describe the transaction demarcation management
  • Implement container-managed transactions (CMT)
  • Interact programmatically with an ongoing CMT transaction
  • Implement bean-managed transactions (BMT)
  • Apply transactions to the Java Persistence API

Advanced Java Persistence API Concepts

  • Specify composite primary keys
  • Override mappings with the @AttributeOverride and @AssociationOverride annotations
  • Understand entity listeners and callback methods


Course DateLocationDaysPriceRegister
Call for Classroom Training Dates3 $2,895Register

Course DateLocationDaysPriceRegister
Call for Live Virtual Class Dates3 $2,760Register