Boris,
It's possible but I think its ideologically incorrect to pass a SQL query as parameter to EB finder method.
Try to hide the SQL code inside the bean. You can simply pass an object as parameter of finder method
and finder method will construct the query from that object.
> -----Original Message-----
> From: Boris Brinza [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 06, 2002 8:26 PM
> Subject: dynamic query?
>
>
> hi there..
> i want to ask if it's possible to execute runtime-generated query in
> finder
> method.
> For example let's say i have function ejbFindByDynamicQuery(String
> query)
> in my bean and findByDynamicQuery(String query) in remote interface
> and i
> want to execute that query in parameter like that:
>
> -Client.java-
> ......
> ......
> Collection c = xy.findByDynamicQuery( "SELECT OBJECT(a) FROM XYZ AS a
> WHERE
> a.name = "xy" )
> ...and then something else
> Collection c = xy.findByDynamicQuery( "SELECT OBJECT(a) FROM ABC AS a
> WHERE
> a.foo = "1243" )
> .....
> .....
>
> is it possible or not?
> thanks a lot
>
