Java Persistence with JPA

Java Persistence with JPA

2h 8mIntermediate2023-01-04

Authors

Kesha Williams

Kesha Williams

Software Engineering Manager, Speaker, Tech Blogger

Course details

Jakarta Persistence (JPA) is the standard for mapping Java objects to databases. JPA provides several advantages over traditional data access methods like Java Database Connectivity (JDBC). In this hands-on course, Kesha Williams discusses these advantages and acquaints you with the basics of JPA, entity management, transaction management, and relationship mapping. Kesha then discusses more advanced topics like inheritance mapping strategies, Jakarta Persistence Query Language (JPQL), the Criteria API, and persistence providers. She explains how inheritance functions when working with mappings, classes, and tables. She also demonstrates how to create queries using JPQL as well as native queries.

Skills covered

APIsJavaOracleProgramming LanguagesSoftware DevelopmentOne-Off

Concepts

Introduction

  • Map Java objects to databases
  • What you should know
  • Reviewing the course project

Understanding JPA

  • Exploring the history of JPA
  • Leveraging Object-Relational Mapping (ORM)
  • Understanding JPA and its benefits
  • Demo - Configuring JPA
  • Demo - Reviewing JPA annotations
  • Challenge - Create simple employee, company, and salary classes
  • Solution - Create simple employee, company, and salary classes

Managing Entities

  • What is an entity
  • Demo - Working with the entity manager
  • Demo - Persisting entities
  • Mapping keys
  • Demo - Mapping keys
  • Implementing CRUD operations
  • Demo - CRUD operations
  • Challenge - Persist employee, company, and salary entities
  • Solution - Persist employee, company, and salary entities

Exploring Entity Relationships

  • What are entity relationships
  • Annotating a one-to-one relationship
  • Demo - Annotating a one-to-one relationship
  • Annotating a one-to-many relationship
  • Demo - Annotating a one-to-many relationship
  • Annotating a many-to-one relationship
  • Demo - Annotating a many-to-one relationship
  • Annotating a many-to-many relationship
  • Demo - Annotating a many-to-many relationship
  • Utilizing inheritance mapping strategies
  • Demo - Utilizing inheritance mapping strategies
  • Challenge - Implement a many-to-many relationship
  • Solution - Implement a many-to-many relationship

Understanding Transactions

  • What is a transaction
  • Managing transactions
  • Demo - Managing transactions
  • Challenge - Manage a transaction
  • Solution - Manage a transaction

Querying Entities

  • Querying with the Jakarta Persistence Query Language (JPQL)
  • Demo - Querying with JPQL
  • Using native queries
  • Demo - Querying with native queries
  • Leveraging the Criteria API
  • Demo - Leveraging the Criteria API
  • Challenge - Query an entity using JPQL
  • Solution - Query an entity using JPQL

Conclusion

  • Good luck on your JPA journey
80,000 Toman