title: PHP Doctrine - Integrity constraint violation: 1062 Duplicate entry (Primary key)
body: <p>I'm loading lots of <code>User</code> and related <code>Group</code> objects from a custom PDO query (using the Doctrine connection => $dbh = Doctrine_Manager::connection()->getDbh(); ). The query involves a cross join which isn't supported in DQL.</p>
  
  <p>I'm manually creating the objects and passing the values like so:</p>
  
  <pre><code>    foreach($pdo as $p) {    
          $u = new User();
          $u-&gt;userid = $p['userid'];
          $u-&gt;username = $['username'];
          //$u-&gt;some_field; skipped on purpose
          $u-&gt;Group-&gt;groupid = $['groupid'];
          $u-&gt;Group-&gt;groupname = $['groupname'];
          array_push($return, $set);
      }
  </code></pre>
  
  <p>I was hoping to be able to <strong>save</strong> the <code>User()</code> object (because of the <code>$u-&gt;some_field</code> which can be changed in this context). However Doctrine tries to insert and a key-constraint is violated.</p>
  
  <p>I understand that the error is thrown, however I want to be able to <strong>only</strong> update that <code>some_field</code> column (and maybe most importantly: NOT THE GROUP). <strong>Is this all even possible using the above preloading?</strong></p>