Introduction to the Java Persistence API 2

JAV-162 (3 Days)
4.6 out of 5 (158 reviews)  

Request Pricing

JPA 2 Training Overview

Accelebrate's JPA 2 Training: Introduction to the Java™ Persistence API 2 class teaches attendees how to implement JPA for data persistence. JPA 2 is a standard feature of Java EE 6 and later, but can also be used with Java SE applications.

Location and Pricing

Most Accelebrate courses are delivered as private, customized, on-site training at our clients' locations worldwide for groups of 3 or more attendees and are custom tailored to their specific needs. Please visit our client list to see organizations for whom we have delivered private in-house training. These courses can also be delivered as live, private online classes for groups that are geographically dispersed or wish to save on the instructor's or students' travel expenses. To receive a customized proposal and price quote for private training at your site or online, please contact us.

In addition, some courses are available as live, online classes for individuals. See a schedule of online courses.

JPA 2 Training Objectives

  • Understand the JPA architecture
  • Create JPA based applications
  • Understand and use JPA to map persistent objects to the database
  • Create JPA persistence units, and understand JPA persistence contexts
  • Use the JPA EntityManager
  • Work with queries and JPQL (Java Persistence Query Language), as well as the Criteria API (JPA 2)
  • Understand and work with collections and associations
    • Value and Entity Types
    • Bidrectional and unidirectional
    • 1-1, 1-N, N-N
  • Use versioning support for optimistic locking
  • Map inheritance hierarchies using JPA
  • Performance tune your JPA applications
  • Understanding JPA transaction support
  • Understand the relationship between JPA / EJB3
  • Use JPA entities from session beans
  • Be familiar with Spring support for JPA

JPA 2 Training Outline

Expand All | Collapse All | Printer-Friendly

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

40%

Lecture/Demo

Lab percentage

60%

Lab

Course Number:

JAV-162

Duration:

3 Days

Prerequisites:

All attendees must have substantial prior Java development and relational database experience.

Training Materials:

All JPA training students receive comprehensive courseware covering all topics in the course and a copy of APress's Pro JPA 2: Mastering the Java Persistence API.

Software Requirements:

  • At least 8GB RAM
  • Any operating system that supports Java 1.8 or later
  • JDK 7 (6 could be accommodated upon request)
  • The Java tool the students are likely to use after the class (Eclipse is recommended, but IntelliJ IDEA and other tools are supported)
  • Other free software - please contact us if you have purchased this class

Contact Us:

Accelebrate’s training classes are available for private groups of 3 or more people at your site or online anywhere worldwide.

Don't settle for a "one size fits all" public class! Have Accelebrate deliver exactly the training you want, privately at your site or online, for less than the cost of a public class.

For pricing and to learn more, please contact us.

Contact Us Train For Us

Toll-free in US/Canada:
877 849 1850
International:
+1 678 648 3113

Toll-free in US/Canada:
866 566 1228
International:
+1 404 420 2491

925B Peachtree Street, NE
PMB 378
Atlanta, GA 30309-3918
USA

Subscribe to our Newsletter:

Never miss the latest news and information from Accelebrate:

Microsoft Gold Partner

Please see our complete list of
Microsoft Official Courses

Recent Training Locations

Alabama

Huntsville

Montgomery

Birmingham

Alaska

Anchorage

Arizona

Phoenix

Tucson

Arkansas

Fayetteville

Little Rock

California

San Francisco

Oakland

San Jose

Orange County

Los Angeles

Sacramento

San Diego

Colorado

Denver

Boulder

Colorado Springs

Connecticut

Hartford

DC

Washington

Florida

Fort Lauderdale

Miami

Jacksonville

Orlando

Saint Petersburg

Tampa

Georgia

Atlanta

Augusta

Savannah

Idaho

Boise

Illinois

Chicago

Indiana

Indianapolis

Iowa

Ceder Rapids

Des Moines

Kansas

Wichita

Kentucky

Lexington

Louisville

Louisiana

Banton Rouge

New Orleans

Maine

Portland

Maryland

Annapolis

Baltimore

Hagerstown

Frederick

Massachusetts

Springfield

Boston

Cambridge

Michigan

Ann Arbor

Detroit

Grand Rapids

Minnesota

Saint Paul

Minneapolis

Mississippi

Jackson

Missouri

Kansas City

St. Louis

Nebraska

Lincoln

Omaha

Nevada

Reno

Las Vegas

New Jersey

Princeton

New Mexico

Albuquerque

New York

Buffalo

Albany

White Plains

New York City

North Carolina

Charlotte

Durham

Raleigh

Ohio

Canton

Akron

Cincinnati

Cleveland

Columbus

Dayton

Oklahoma

Tulsa

Oklahoma City

Oregon

Portland

Pennsylvania

Pittsburgh

Philadelphia

Rhode Island

Providence

South Carolina

Columbia

Charleston

Spartanburg

Greenville

Tennessee

Memphis

Nashville

Knoxville

Texas

Dallas

El Paso

Houston

San Antonio

Austin

Utah

Salt Lake City

Virginia

Richmond

Alexandria

Arlington

Washington

Tacoma

Seattle

West Virginia

Charleston

Wisconsin

Madison

Milwaukee

Alberta

Edmonton

Calgary

British Columbia

Vancouver

Nova Scotia

Halifax

Ontario

Ottawa

Toronto

Quebec

Montreal

Puerto Rico

San Juan

© 2013-2019 Accelebrate, Inc. All Rights Reserved. All trademarks are owned by their respective owners.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.