This mailing list is in English. Obrigado!

What you are doing wrong here is: defining an ON-clause. That is how you'd 
do it in SQL. In DQL however you define the relationship between your 
entities in the mapping-information (via annotations, xml, yaml or php) and 
in the query you use that relationship. So: define a OneToOne, OneToMany, 
ManyToOne or ManyToMany relationship and use that in the query (and 
consequently no need to use a ON).


On Monday, 24 February 2014 19:46:41 UTC+1, João Carlos Santa Ana wrote:
>
> Alguém ajuda por favor.
>
> Tenho varias tabelas: endereco, identidade, cartao, contato, debitos ....
> Todas com o id da tabela do usuario.
>
> preciso fazer uma consulta que traga todas as tabelas relacionadas de uma 
> vez.
>
> Tentei fazer uma consulta simples:
>
> $query = $this->em->createQuery("SELECT i, e FROM 
> R\Entity\UsuariosIdentidade as i "
>                    . " JOIN R\Entity\UsuariosEndereco as e ON 
> e.userEndUser = i.userIUser ");
>           $result = $query->getResult();
>
> Recebo este erro:
> OBS: SILEX
>
> QueryException: [Semantical Error] line 0, col 92 near 'as e ON 
> e.userEndUser': Error: Identification Variable R\Entity\UsuariosEndereco 
> used in join path expression but was not defined before.
>
> Alguem pode dar alguma direção do que devo fazer para conseguir uma query 
> que me traga todas as tabela seja com createQueryBuilder, createQuery ou 
>  EntityRepository;
>

-- 
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/groups/opt_out.

Reply via email to