Book Image

Java EE 7 Development with NetBeans 8

By : David R Heffelfinger
5 (1)
Book Image

Java EE 7 Development with NetBeans 8

5 (1)
By: David R Heffelfinger

Overview of this book

Table of Contents (18 chapters)
Java EE 7 Development with NetBeans 8
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 4. Interacting with Databases through the Java Persistence API

The Java Persistence API (JPA) is an object-relational mapping (ORM) API. ORM tools help us to automate the mapping of Java objects to relational database tables. Earlier versions of J2EE used Entity Beans as the standard approach for ORM. Entity Beans attempted to always keep the data in memory synchronized with the database data, a good idea in theory, however, in practice this feature resulted in poorly performing applications.

Several ORM APIs were developed to overcome the limitations of Entity Beans, such as Hibernate, iBatis, Cayenne, and TopLink, among others.

Java EE 5 deprecated Entity Beans in favor of JPA. JPA took ideas from several ORM tools and incorporated them in the standard. As we will see in this chapter, NetBeans has several features that make development with JPA a breeze.

The following topics will be covered in this chapter:

  • Creating our first JPA entity

  • Interacting with JPA entities using EntityManager...