-
1. Re: Dynamic query in ejb (cmp)
lafr Jul 27, 2004 5:32 PM (in response to goodmood)This works for me:
define a jboss-query for the EB with args query String and Object array for the parameters:
/**
* @jboss.query dynamic="true" signature="java.util.Collection ejbSelectGeneric(java.lang.String query, java.lang.Object[] params)"
*/
create a method for the home interface which takes the same args as the defined query and calls the query method:
/**
* @ejb.home-method
*/
public java.util.Collection ejbHomeDynamicQuery( String query, Object[] params ) throws javax.ejb.FinderException
{
return ejbSelectGeneric( query, params );
}
This method you call from you app-code:
Collection c = home.dynamicQuery(query.toString(), new Object[] {}); -
2. Re: Dynamic query in ejb (cmp)
goodmood Jul 28, 2004 5:03 AM (in response to goodmood)Youhouhouh it seems to be working.
Thanks really a lot because I didn't find the exact answer on any other website/forum.
Thanks :)
Nath.