A home method is a business method that is not specific to one bean instance, and that is invoked on an entity bean's (local or remote) home interface. This sample shows a CMP entity bean that uses various home methods to obtain information about the persistent data the bean represents. Specifically, an ItemsBean_H EJB models the persistent data in a prefilled database table Items, representing an inventory of products. Each items has a product name, a quantity that is in stock, and a price. Various home methods are used to obtain information about the items in stock on the basis of their price.
A home method is defined in the home interface (local home interface in the example). In other words, you do not first have to obtain an instance of an entity bean before you can invoke a home method.
The ItemsBean_H EJB is run using a conversational test web service via an EJB control.
The code of the CMP entity bean is located in the homeMethods folder of the EJBs project in the SamplesApp sample application. In the file system the location is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\EJBs\homeMethods\ItemsBean_H.ejb
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 homeMethods folder of the EJBs_ClientApps project in the SamplesApp sample application. In the file system the location of the web service is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\EJBs_ClientApps\homeMethods\ItemsBeanControlTest.jws
To Run the Sample
BEA_HOME/weblogic81/samples/workshop/startWebLogic.sh