You can look at the generated SQL by using `$query->getSQL()`. That should give you an idea of how DQL is translated to SQL.
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 28 May 2014 16:22, Nebumix <[email protected]> wrote: > Nothing, it is working well, I'm just asking why it is working so, I'm not > sure to understand the logic. > Sorry if I'm too annoying, but I think is better understand. > If you can't explain, no problem. > > thanks again. > > Il giorno mercoledì 28 maggio 2014 14:53:13 UTC+1, Marco Pivetta ha > scritto: >> >> Could you define what "doesn't work" means here? >> >> Marco Pivetta >> >> http://twitter.com/Ocramius >> >> http://ocramius.github.com/ >> >> >> On 28 May 2014 10:37, Nebumix <[email protected]> wrote: >> >>> Hi, thanks for your help. >>> >>> Now I'm trying to select all user who don't have any relation. >>> >>> I have written it and it seems working well, but I don't understand why >>> it need to use b.id, because b.id doesn't exist. Can you help me again? >>> >>> >>> 'SELECT u FROM AcmeUserBundle:User u LEFT JOIN u.relClients b WHERE >>> u.roles LIKE :roles AND b.id IS NULL' >>> >>> Thanks >>> Regards >>> >>> >>> >>> >>> Il giorno martedì 27 maggio 2014 18:12:19 UTC+1, Nebumix ha scritto: >>> >>>> Amazing, now it is working, thanks a lot. >>>> >>>> Il giorno martedì 27 maggio 2014 17:58:21 UTC+1, Marco Pivetta ha >>>> scritto: >>>>> >>>>> Hi, >>>>> >>>>> You are trying to use SQL-ish syntax in DQL. >>>>> >>>>> DQL does not work with column names, but with properties of your >>>>> objects. >>>>> >>>>> The correct query is something like: >>>>> >>>>> SELECT u FROM AcmeUserBundle:User u LEFT JOIN u.relBrokers b WHERE >>>>> u.id = :id >>>>> >>>>> >>>>> Marco Pivetta >>>>> >>>>> http://twitter.com/Ocramius >>>>> >>>>> http://ocramius.github.com/ >>>>> >>>>> >>>>> On 27 May 2014 18:51, Nebumix <[email protected]> wrote: >>>>> >>>>>> Hi, I have a self referencing relationship on a entity class, using >>>>>> symfony 2. >>>>>> >>>>>> This is my class: http://pastebin.com/HFCYg7qt >>>>>> >>>>>> It created a table with the relation, with two primary key and two >>>>>> fields: broker_id, client_id >>>>>> >>>>>> I'm trying to filter a query >>>>>> >>>>>> http://pastebin.com/vPC4BVYS >>>>>> >>>>>> but I have this error, I can't understand what is the problem. >>>>>> >>>>>> [Semantical Error] line 0, col 69 near 'client_id = ': Error: Class >>>>>> Acme\UserBundle\Entity\User has no field or association named client_id >>>>>> Thanks for the help >>>>>> Regards >>>>>> >>>>>> -- >>>>>> 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. >>>>>> >>>>> >>>>> -- >>> 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. >>> >> >> -- > 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. > -- 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.
