Sergey,
AFAIK order of the method params is the order of the wild cards $1 $2 etc. I
do this all of the time. Go to the finder-method partial="false" query="do
the down an dirty with sql and my $1 card and $2 card" should read "do the
down and dirty with sql an my asc card and desc card" if the arguments to
the method were "asc" and "desc", respectively.
Of course this isn't really good sql, but I'm just having some fun.
Regards,
the elephantwalker
www.elephantwalker.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of sergey
Sent: Wednesday, September 19, 2001 7:04 AM
To: Orion-Interest
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";