The empty collection result makes perfect sense if the
default behavior is to AND criteria together.  None of
your articles have both names set (exclusion at work),
so nothing comes back.

Aren't you trying to say "Give me all the articles
where name = 'Article 1' OR name = 'Article 2'"?

If I understand correctly, I think you want to use
either the addOrCriteria or addIn methods. - MOD

--- Gregor Heinze <[EMAIL PROTECTED]> wrote:
> For the sake of simplicity, I refer to the class
> model from the tutorial
> "Advanced Object Relational Mapping techniques" to
> explain my problem. It
> seems to be quite simple but I wasn't able to figure
> it out correctly.
> All I want to do is to get all ProductGroup's which
> have an Article with the
> articleName "Article 1" _and_ an Article with the
> articleName "Article 2" in
> its allArticlesInGroup Vector.
> Using the PersistenceBroker API I wrote the
> following:
> 
> Criteria crit = new Criteria();
> crit.addEqualTo("allArticlesInGroup.articleName",
> "Article 1");
> crit.addEqualTo("allArticlesInGroup.articleName",
> "Article 2");
> Query q = QueryFactory.newQuery(ProductGroup.class,
> crit);
> 
> Unfortunately this approach does not work and I
> always get an empty result
> collection. Using only one addEqualTo statement
> works as expected but using
> two of them won't.
> Anyone has an idea how to do this? Any help is
> appreciated!
> 
> Thanks in advanced,
>  Gregor
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to