The EJB 3.0 entity beans are used to model and access relational database tables. It is a completely POJO-based persistence framework that should come natural to most Java developers.
If you are familiar with Hibernate or TopLink, you will find the EJB 3.0 very intuitive, as its design model is strongly influenced by the Hibernate and TopLink approach of Object / Relational mapping. Even if you do not have much experience with complex database programming in Java, you will also find EJB 3.0 entity beans very easy to learn. All you need is to model your application data in simple POJOs. Then, with a set of simple annotations, the container figures out how to map the Java objects into tables in relational databases. Using the EntityManager
API, you can operate the relational database as if they store Java objects instead of rows of relational data.
In this hike, we will go through trails that explore the key features of the EJB 3.0 entity bean programming model and the EntityManager
API. Let's start with a discussion on how Object / Relational Mapping technology works in EJB 3.0.
Note: The EJB 3.0 entity beans are completely different from and much easier to use compared with the old EJB 2.1 entity beans.