One approach you could take would be to change the array to a list with the 
java.util.Arrays.asList() call. Then in your select query you would have a list that 
you could use
in your where clause as follows:
select * from table where ownerid in ($1);

so your call to findByOwner would look like:
result = home.findByOwner(java.util.Arrays.asList(<integer array>));

Jeff Hubbach

Nevin Ng wrote:

> Hi there,
>
> I'm now working on the ejb finder methods with orion, I have some basic experience 
>with it already and know how to do some basic declaration such as sub-select finder, 
>etc.
>
> I know that orion will map arg1 to $1, arg2 to $2 and so on, but how about if I want 
>to pass an array to the finder?
>
> e.g. I have a entity bean that will hold books, each of them will have an owner_id 
>field. Now I want to define a finder call:
>
> public Collection findByOwner(Integer[] ownerID) throws RemoteException, 
>FinderException;
>
> Then how could I define such argument in orion-ejb-jar.xml?!
>
> Regards,
> Nevin Ng

--
Jeff Hubbach
Internet Developer
New Media Designs, Inc.
www.nmd.com




Reply via email to