Types of Entity Beans

As we learned in Chapter 24, “Enterprise JavaBeans: An Introduction,” entity beans manage persistence in one of two ways: bean-managed persistence (BMP) or container-managed Persistence (CMP).

An entity bean that is declared to use CMP allows the container to control persistence, letting the container determine how the runtime content of the bean will be read from or written to the database. With this approach, the developer will not need to provide any code for the persistence. Instead, the application server provides a tool to describe how this persistence is managed. In EJB 1.1, there were some distinct limitations to CMP that limited its applications. In EJB 2.0, these limitations have been largely overcome with the ...

Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software 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.