To create my finder implemenations I had to do the following:
1. Declare the finder method in the home interface.
2. Create a reference to the finder method in the jaws.xml via the EJX
program.
Note that the "query" field in the ejx interface is your entire where clause
for your beans query. To use your finder methods args in the where clause,
review the java class: Format. The Format class is used by Jaws to
subsitute the finder method args into the where clause text you specify. An
example that I put together:
Finder method:
ArrayList findByParent(int custId, int parentId) throws FinderException,
RemoteException, EJBException;
ejx where clause:
cust_id = {0,number,######} AND parent_id = {1,number,#########}
The jaws module will substitute my method args into the {} as specified by
the Format class.
The actual jaws xml should look like this:
<finder>
<name>findByParent</name>
<query>cust_id = {0,number,######} AND parent_id =
{1,number,#########}</query>
<order>sibling_order</order>
</finder>
Hope this helps,
Bill Pfeiffer
Arbitration Forums, Inc
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Alex Bairov
Sent: Saturday, July 15, 2000 7:36 AM
To: [EMAIL PROTECTED]
Subject: [jBoss-User] Custom finders
I guessed I shouldn`t do anything to use finders like findByPrimaryKey,
findByField and findAll.
What should I do to help JBoss implementing finders by several fields or
with the expression like WHERE smth>23 AND smthelse LIKE .... ?
Alex Bairov.
Web Application Developer
ICQ#48691126
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]