Feb 4th, 2010, 04:59 PM
How can I get my findBy methods to accept multiple values?
I would like to be able to find by multiple values. I modified the generated xxx_Roo_Finder.aj class so that the created query is:
Query q = em.createQuery("SELECT Pim FROM Pim AS pim WHERE pim.qcguid IN (:qcguid)");
but this failed. It threw an "invalid number" exception - the generated query had:
...WHERE (t0.qcguid IN (?)) [params=(String) 1,2])
is there a way to get it to accept a list of values that a field can be equal to instead of a single value?
Feb 4th, 2010, 09:20 PM
Roo can generate this kind of finder for you. For example if you have a collection type field called toppings, you can create a finder for your pizza object like so: findPizzasByToppings. If you generate that finder you can review the generated code to see how it would need to look like if you were interested in writing your own custom find method.
Tags for this Thread