Yep, that is possible but not following the EJB spec.
That is: the spec defines that the finder methods return a Collection which
isn't ordered. However Orion returns a ArrayList (subclass of collection)
which is ordered. So it's your lucky day, as indeed it is possible, but be
careful when you are porting your application to another J2EE platform.

BTW: It's not necessary to put "select * from " in your case.
The following is enough:
 <finder-method query="order by state $1">

Suc6,
Eddie

----- Original Message -----
From: "sergey" <[EMAIL PROTECTED]>
To: "Orion-Interest" <[EMAIL PROTECTED]>
Sent: Wednesday, September 19, 2001 4:04 PM
Subject: finder parameters


> Please help me!!!
>
>   Is there any possibility to pass order direcrtion as parameter
> of a finder? That is parameter string ("asc" or "desc") is added to
> the end of SQL?
>
> Ex.: findAllSortedByState("asc");
>
> In orion-ejb-jar.xml:
>
>             <finder-method query=" select * from SomeTable order by state
$1" partial="false">
>                 <!-- Generated SQL: " select * from SomeTable order by
state ?" -->
>                 <method>
>                     <ejb-name>SomeTable</ejb-name>
>                     <method-name>findAllSortedByState</method-name>
>                     <method-params>
>                     </method-params>
>                 </method>
>             </finder-method>
>
> In SomeTableHome.java:
>
>   public Collection findAllSortedByState(String direction) throws
RemoteException, FinderException;
>   public static final String findAllSortedByStatec_query="full: select *
from SomeTable order by state $1";
>
>
>
>

Reply via email to