Home > Articles > Programming > Java

  • Print
  • + Share This
From the author of

What Are Entity Beans?

Entity beans are J2EE components that execute under the control of a J2EE application server. The application server uses an Enterprise JavaBeans (EJB) container to handle system services such as thread control, security, transaction management, database connections, and life cycle management on behalf of each bean. Entity beans reflect business data; they mirror persistent data from an underlying database. Entity beans in general are not used to fulfill a business process; their role is limited to modeling data.

The EJB specification describes two types of entity beans: Bean-Managed Persistence (BMP) and Container-Managed Persistence (CMP). With BMP entity beans, the bean developer writes the database access code that provides entity bean persistence. With CMP entity beans, the application server generates the required database access code for entity bean persistence. Furthermore, the EJB 2.0 specification includes local interfaces and container-managed relationships that allow CMP entity beans to model real-world enterprise data requirements. This includes entity beans with relationships to other entity beans. Therefore, we use CMP entity beans for this discussion.

  • + Share This
  • 🔖 Save To Your Account