Web server version - Creating CMP entity beans from an imported data

Creating CMP entity beans from an imported data source To add a finder to a 1.1 entity bean, 1 Right-click the name of the bean in the bean representation in the EJB designer and choose Add|Finder on the context menu that appears or click the Add icon on the toolbar and choose Finder. A new finder method appears at the bottom of the bean along with the finder s inspector. 2 Use the inspector to give the finder a new name. 3 Choose whether the finder should return an instance of the bean or java.util.Collection. By default, JBuilder inserts the name of the bean s remote interface. 4 Specify the parameters passed to the finder, giving both the data types and the parameter names as the value of Input Parameters. For example, java.lang.String lastName. 5 Accept the default value of Home as the Home Interface. 6 In the Where Clause box, specify the SQL Where clause to return the entities that you want. Adding an ejbSelect method Note Only EJB 2.0 components can have ejbSelect methods. EJB QL is also used to create abstract ejbSelect() methods. Such methods allow you to use EJB QL to find objects or values related to the state of an entity bean without exposing the results to the client. To add an ejbSelect() method, 1 Right-click the name of the bean in the bean representation in the EJB designer and choose Add|Select on the context menu that appears. A new select method appears at the bottom of the bean along with the method s inspector. 2 Use the inspector to give the method a new name. The EJB designer will add a prefix of ejbSelect to the method name you specify. For example, if you specify the name AllLineItems in the inspector, the EJB designer places an abstract ejbSelectAllLineItems() method in the bean class. 3 Specify whether the method should return an instance of the bean, a java.util.Collection, or java.util.Set. By default, JBuilder inserts the remote or locale interface of the bean, depending on whether the bean is declared as remote or local. 4 Specify the parameters passed to the ejbSelect() method, giving both the data type and the parameter name as the value of Input Parameters. For example, java.lang.String lastName. 5 Select a mapping from the Result Type Mapping drop-down list. Chapter 6: Creating entity beans with the EJB designer 59
Don’t want to have just any web hosting, but web hosting provider who will share the same beliefs? You have found them. Our Church Web Hosting company will treat in you in appropriate way, the one you are accustomed to.

Leave a Reply