Creating CMP entity beans from an imported data (Cheap web hosting)

Creating CMP entity beans from an imported data source Adding a finder method Finder methods allow the client to access the results of an EJB QL query. EJB QL is the query language for container-managed persistence query methods defined in the EJB 2.0 specification. An EJB QL query is a string that must contain a SELECT clause and a FROM clause, and may include a WHERE clause. To add a finder method to a CMP 2.0 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. 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 Specify whether the finder should be declared in the home or local home interface or both in the Home Interfaces field. Your choices are limited by whether the bean is declared as local or remote. 6 Specify the load state as true or false, using the drop-down list. 7 If you choose to enter a query, enter an EJB QL statement in the Query field. For example, SELECT DISTINCT OBJECT(o) FROM Order AS o, IN(o.lineItems) AS 1 WHERE 1.shipped = FALSE Some application servers also permit you to use proprietary extensions. Check your application server documentation for more information about specifying queries. The finder s inspector may have additional fields, depending on the selected application server. If you need help filling in these additional fields, consult your application server documentation. For more information about writing queries with the EJB 2.0 query language, see Enterprise JavaBeans Query Language in the J2EE tutorial on the Sun web site at http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/EJBQL.html. 58 Developing Applications with Enterprise JavaBeans
We feature a web hosting shopping cart and live support solution. Just try our web hosting shopping cartwhich provides a secure way of obtaining payments through your website.

Leave a Reply