In earlier chapters we covered lots of Java EE ground, combining several technologies such as the CDI API. The examples so far, however, are based on a false assumption – that all the information can be stored in memory. In this chapter, we will show how to use a persistent data store for our application in the form of a standard relational database.
The Enterprise JavaBeans (EJB) 3.0 specification includes a persistence specification called the Java Persistence API (JPA). It is an API for creating, removing, and querying Java objects called entities that can be used within both a compliant EJB 3.0 Container and a standard Java SE environment.
There is a lot of ground to cover in this chapter and concepts will be coming at you from every direction. But at the end of it, you will be able to appreciate exactly how to create and deploy a complete Java EE 6 application.
Specifically, we will discuss the following topics:
The key elements of JPA
How to create...