The Bean-Managed Persistence (BMP) entity bean sample shows how to build a basic entity bean using bean-managed persistence instead of container managed persistence. This example is intended to provide a comparison between how a BMP entity bean and a CMP entity bean implement similar behavior, and to that effect implements the BMPItemBean entity bean, which is similar to the CMP entity bean ItemsBean_F in the Finder Methods Sample. The entity bean implements several persistence fields and their accessor methods, an ejbCreate method, a finder method ejbFindByPrice, and the methods that you need to explicitly define in BMP to handle database queries, that is, findByPrimaryKey, ejbLoad, ejbStore, ejbRemove, as well as setEntityContext and unsetEntityContext. The example uses JDBC to talk to a relational database.
Examining an EJB at runtime using a conversational web service via an EJB control.
The code of the BMP entity bean is located in the beanManagedPersistence folder of the EJBs project in the SamplesApp sample application. In the file system the location is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\EJBs\beanManagedPersistence
The web service that you run as a client application to test the EJB, and the EJB control that you use to locate and reference the EJB, are located in the beanManagedPersistence folder of the EJBs_ClientApps project in the SamplesApp sample application. In the file system the location is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\EJBs_ClientApps\beanManagedPersistence
To Run the Sample
BEA_HOME/weblogic81/samples/workshop/startWebLogic.sh