Java Reference
In-Depth Information
Chapter5.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 contain-
er 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 con-
cepts will be coming at you from every direction. However, at the end of it, you will be
able to appreciate exactly how to create and deploy a complete Java EE 7 application.
Specifically, we will cover the following topics:
• The key features of JPA
• How to create your entities and database schema
• How to manipulate the entities using CDI Beans and EJBs
• Delivering a frontend tier for our application using JSF and Facelets technology
Search WWH ::




Custom Search