Chapter 5. Combining Persistence with CDI
In the earlier chapters, we discussed Java EE, combining several technologies such as CDI. 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.2 specification includes a reference to a persistence specification called the Java Persistence API (JPA). It is an API to create, remove, and query Java objects called entities that can be used within both a compliant EJB 3.x container and a standard Java SE environment. In Java EE 7, it has been updated to Version 2.1. You can check out the current version of the specification I the JSR 338 at https://jcp.org/en/jsr/detail?id=338.
We need to warn you that in this chapter, you have a lot of things to learn and hence concepts will be coming at you from every direction. However...