title: Doctrine bulk DQL update with join
body: <p>I need to update a large collection of entities (~100k) with a few set of values. To do this, I want to use a <a href="http://doctrine-orm.readthedocs.io/projects/doctrine-orm/en/latest/reference/batch-processing.html#dql-update" rel="nofollow" title="dql-update">DQL update Query</a>.</p>
  
  <p>The problem came from the where clause of my query. I need to filter the entities to update.</p>
  
  <pre><code>$qb-&gt;update('MyBundle/Entity/MyEntity', 'e')
  -&gt;set('e.fieldToUpdate', ':value')
  -&gt;innerJoin('e.relation', 'r')
  -&gt;where('r.filter &lt; :filter')
  -&gt;setParameters...
  </code></pre>
  
  <p>Unfortunatly joins are not supported on update and delete queries.
  And I won't be able to use a where clause with <code>e.id IN "subquery"</code> since MySQL documentation says :</p>
  
  <blockquote>
    <p>In MySQL, you cannot modify a table and select from the same table in a subquery. </p>
  </blockquote>
  
  <p>I'd like to avoid using <code>Query#iterate()</code> facility  or other solutions based on loop for performance reason, so...I don't know how to deal with this.</p>
  
  <p>It sounds like a common problem, and I may miss something very obvious...so if there is a workaround to do this, i'll be glad to read it !</p>