Then you'll need to select a root alias ;)
I'm guessing it is `u`.

PS: As a side question, why are you building your query according to mapping 
metadata? Are you not in control of what associations are mapped?

--  
Jasper N. Brouwer
(@jaspernbrouwer)


On 3 December 2014 at 10:11:51, Andrius Kulbis ([email protected]) wrote:
> This gives me the following error
> Cannot select entity through identification variables without choosing at
> least one root entity alias.
>  
>  
> 2014 m. gruodis 3 d., trečiadienis 11:04:18 UTC+2, Jàπ (Jasper N. Brouwer)
> rašė:
> >
> > You'll probably need to use a regular join, as the associations are
> > mapped. Maybe something like this:
> >
> > foreach ($this->assoc as $key => $mapping) {
> > $queryBuilder
> > ->addSelect(substr($key, 0, 1) . ' AS ' . $key)
> > ->leftJoin(
> > 'u.' . $mapping['fieldName'],
> > substr($key, 0, 1)
> > );
> > }


-- 
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