Chapter 9. JPA entities

 

This chapter covers

  • JPA and the impedance mismatch
  • Domain models
  • Implementing domain objects with JPA
  • Defining relationships between domain objects with JPA
  • Using inheritance with JPA domain objects

The Java Persistence API (JPA) is the Java standard to create, retrieve, update, and delete (CRUD) data from relational databases. Java has had the ability to access databases almost since its beginnings. The JDBC API gives developers direct access to the database for running SQL statements. Although powerful, JDBC is simple—it lacks many features. Because of this, many proprietary object-relational mapping (O/R mapping) tools have been developed on top of JDBC. JPA standardizes O/R mapping for both the Java SE and Java EE platforms. For developers, this means database applications created to these standards don’t include proprietary classes in the code.

9.1. Introducing JPA

9.2. Domain modeling

9.3. Implementing domain objects with JPA

9.4. Entity relationships

9.5. Mapping inheritance

9.6. Summary