Hi,
I use JBoss2.4.4 and I want to know if it is possible to declare a finder method in my Ejb Home which take a string in argument which represent a filter....
For example :
I've got an EJB A with : String a, int b
findByQuery("a like '%toto%' and b > '5'")
What I don't want to do :
having a session bean which accessed my DB directly because I can have some beans A deployed on DB1 and some others on DB2.
Is it possible to do this ?
Actually, I've got a method in my EJB A which parse my filter to call some more common finder like "findLikeA", "findUnLikeA", "findGreaterThanB"...
But it is not so beautiful :(
You can declare a query element like the following:
USERNAME = {0} where {0} represents the first argument. It is your responsibility that the data types match.
lekkim