Re: FindBy question
Posted by
Scott Gray on
Sep 21, 2007; 6:50am
URL: http://ofbiz.116.s1.nabble.com/POS-Setup-tp148376p148395.html
Use the % wildcard
List m = findByLike("Product", UtilMisc.toMap("productId", "GZ%");
or you can use findByAnd with a list of expressions, there are plenty of
examples in the code to work from.
Regards
Scott
On 21/09/2007, skip@theDevers <
[hidden email]> wrote:
>
> Can anyone tell me if any of the findBy methods using primary keys will
> return matching records when only the first N bytes match?
>
> For example, we have lots of GZ-xxxx in the demo Product table. Are there
> any findBy methods that will return all if I do something like
>
> List m = findByxxx("Product", UtilMisc.toMap("productId", "GZ");
>
> I expect findByLike will do it, but I didnt want to do a "like" search
> where
> I might bet back "AmGZ123" and similiar. I want to get back only records
> starting with GZ.
>
> I can dig through the source, but I was hoping some of the more
> experienced
> folks could save me the trouble as I can't find documentation on it.
>
> Skip
>
>