Re: how to search on collection attributes
zkn <[email protected]>
| Newsgroups | gmane.comp.jakarta.ojb.user |
|---|---|
| Message-ID | <[email protected]> |
If the collection of B objects is named "collectionProperty"
Criteria crit = new Criteria();
crit.addEqualTo("collectionProperty.name", "foo");
QueryByCriteria query = new QueryByCriteria(A.class, crit);
Laran Evans wrote:
> I have a parent object A which owns a collection of child objects of
> class B. B has a name attribute. How do I run the query "get me all A
> where one or more of the Bs owned by that A has a name attribute equal
> to 'Leroy Jenkins'".
>
> I've been looking through the various 1:n documentation sections on
> db.apache.org and haven't found anything that I think covers this.
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>