title: Symfony 2 - Doctrine 2 - Native Sql - Delete Query
body: <p>Instead of removing my entities one by one with </p>
  
  <pre><code>$this-&gt;em-&gt;remove($price);
  </code></pre>
  
  <p>I would like to execute a native SQL query to delete all my entities.</p>
  
  <p><strong>Here is what I tried :</strong></p>
  
  <pre><code>$sqlQuery = "delete from mytable where mytable.fieldone_id = ".$fieldoneid." and mytable.fieldtwo_id = ".$fieldtwoid.";";
  
  $query = $this-&gt;getEntityManager()-&gt;createNativeQuery($sqlQuery);
  
  $query-&gt;execute();
  </code></pre>
  
  <p><strong>It returns the following error :</strong></p>
  
  <pre><code>Catchable fatal error: Argument 2 passed to Doctrine\ORM\EntityManager::createNativeQuery() must be an instance of Doctrine\ORM\Query\ResultSetMapping, none given
  </code></pre>
  
  <p>It wants me to pass a <code>ResultSetMapping</code>, but it is a delete query...</p>
  
  <p>Can anyone please teach me how to do it?</p>