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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.