In that case, Foo is the owning side of the association, so you could simple do:

    SELECT f FROM Foo f WHERE f.bars IS EMPTY

The problem here is that Bar is the owning side, so you indeed need to 
explicitly join Bar onto Foo. And you need to do a LEFT JOIN, otherwise the 
empty bars won't show up.

--  
Jasper N. Brouwer
(@jaspernbrouwer)


On 6 August 2014 at 11:01:21, Nima Sadjadi ([email protected]) wrote:
> Jasper,
> So, if it is a collection then this one should be use?
> SELECT f FROM Foo f LEFT JOIN f.bars b WHERE b IS EMPTY
> Right?


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to