Doctrine2.5 getReference and merge update no works
<p>I have a strange problem with Doctrine 2.5 while try update my table UserProfile where my column BusinessActivity is a foreign key.</p>

<p>CASE 1) USING getReference()</p>

<p><code>update</code> works, but not on column BusinessActivity.</p>

<pre><code>$myid = 6;
$businessActivity = $entityManger-&gt;getReference('BusinessActivity', 6);

//$businessActivity proxy object was created correctly with id 6
$userDetails-&gt;setBusinessActivity($businessActivity);

$entityManger-&gt;merge($userDetails);
</code></pre>

<p>//FLUSH AND COMMIT</p>

<p>CASE 2) CREATING OBJECT FROM DB WITH REPOSITORY WORKS</p>

<pre><code>$rep               = $entityManager-&gt;getRepository('BusinessActivity');
$businessActivity  = $rep-&gt;findOneBy(array('idActivity' =&gt; 6);

$userDetails-&gt;setBusinessActivity($businessActivity);

//FLUSH AND COMMIT
</code></pre>

<p>Naturally, I already have id and I didn't want to execute a query with findOneBy.</p>

<p>Why does this happen?</p>