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, [EMAIL PROTECTED] <[EMAIL PROTECTED]> 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
>
>