Entity Bean Basics

As persistent objects, an entity bean's state must be saved to the database. Entity beans have two operational styles: They either use BMP or CMP.

With BMP, the bean writer provides the code to load and persist the entity bean to the database. This usually requires JDBC code in the bean class to read and update the entity bean's fields to the database.

With CMP, the EJB container automatically provides code to persist the entity bean to the database. No JDBC code is required. The programming model for CMP changed drastically between EJB 1.1 and EJB 2.0. The EJB 2.0 CMP model offers a number of additional features for both the bean writer and the EJB container. In this chapter, we discuss only the EJB 2.0 CMP model. While the ...

Get J2EE™ Applications and BEA™ WebLogic Server™ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.