Select methods are here simply to make your life easier, by letting the Container build the real database access code from you queries. So the process is usually something like: 1.Write a home business method 2.Implement the home business method to call the ejbSelect method that does the real data access. 3. Declare the abstract select method in your bean class 1. Write the EJB-QL for the select
How does the Container know how to implement the code for the ejbSelect method.How does one bind the ejbSelect method to the EJB-QL in the DD?
posted 14 years ago
Last step was meant to be : 4. Write the EJB-QL for the select
Ref Section 22.5 Deployment descriptor DTD of EJB Spec
<!-- The ejb-ql element contains the EJB QL query string that defines a finder or select query. This element is defined within the scope of a query element whose contents specify the finder or the select method that uses the query. The content must be a valid EJB QL query string for the entity bean for which the query is specified. The ejb-ql element must be specified for all queries that are expressible in EJB QL. -->
Example: <query> <query-method> <method-name>ejbSelectPendingLineitems</method-name> <method-params/> </query-method> <ejb-ql>SELECT OBJECT(l) FROM LineItems l WHERE l.shipped <> TRUE </ejb-ql> </query>