title: Symfony 2 Doctrine 2 update with join table query builder
body: <p>I need to transform a sql request like this one in query builder (or in the worst case in dql)</p>
  
  <pre><code>UPDATE code c, element_code ec
  SET c.url = 'test' 
  WHERE c.element_code_id = ec.id
  AND ec.project_id = 5
  AND (c.id = 1 OR c.id = 2)
  </code></pre>
  
  <p>Here is the MCD and the model</p>
  
  <p><a href="http://i.imgur.com/TvKhbGR.png?1" rel="nofollow">http://i.imgur.com/TvKhbGR.png?1</a></p>
  
  <pre><code>class Code
  {
  /**
   * @var integer $id
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;
  
  /**
   * @var string $url
   *
   * @ORM\Column(name="url", type="string", length=255, nullable=true)
   */
  protected $url;
  
  /**
   * @ORM\OneToOne(targetEntity="CodeBundle\Entity\ElementCode", inversedBy="code")
   * @ORM\JoinColumn(name="element_code_id", referencedColumnName="id")
   */
  protected $elementCode;
  }
  </code></pre>
  
  <p>=========</p>
  
  <pre><code>class ElementCode
  {
  /**
   * @var integer $id
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;
  
  /**
   * @ORM\ManyToOne(targetEntity="CodeBundle\Entity\Project", inversedBy="elementsCode")
   * @ORM\JoinColumn(name="project_id", referencedColumnName="id")
   */
  protected $project;
  
  /**
   * @ORM\OneToOne(targetEntity="CodeBundle\Entity\Code", mappedBy="elementCode")
   */
  protected $code;
  }
  </code></pre>
  
  <p>=========</p>
  
  <pre><code>class Project
  {
  /**
   * @var integer $id
   *
   * @ORM\Column(name="id", type="integer")
   * @ORM\Id
   * @ORM\GeneratedValue(strategy="AUTO")
   */
  protected $id;
  
  /**
   * @ORM\OneToMany(targetEntity="CodeBundle\Entity\ElementArbo", mappedBy="project")
   */
  protected $elementsCode;
  }
  </code></pre>
  
  <p>And here is the query builder that i've made but which doesn't work :/</p>
  
  <pre><code>$qb = $this-&gt;_em-&gt;createQueryBuilder();
  $q = $qb-&gt;update('CodeBundle:Code', 'c')
          -&gt;innerJoin('CodeBundle:ElementCode', 'ec')
  
          -&gt;set('c.url', ':url')
          -&gt;setParameter('url', 'test')
  
          -&gt;where('c.elementCode = ec.id')
          -&gt;andWhere('ec.project = :project')
          -&gt;setParameter('project', $project)
          -&gt;andWhere("c.id = 1")
          -&gt;orWhere("c.id = 2");
  </code></pre>
  
  <p>Any ideas ? Thanks :)</p>