Jira issue originally created by user nicokaiser:
When dealing with detached entities, e.g. with the QueryCache, you cannot use these entities as parameters for other Query.
$query = $em->createQuery('SELECT a FROM Address a WHERE a.User = ?1');
$query->setParameter(1, $user); // $user is detached
As $user is detached, the EntityManager does not have its identifier, so Query::_doExecute fails. (There is a "//TODO: Check that $value is MANAGED?" line near the failing line).
Comment created by nicokaiser:
This patch should fix Doctrine\ORM\Query to work with detached Entities.
Comment created by @beberlei:
Did some changes to the patch, but overally its now committed!
Issue was closed with resolution "Fixed"
Imported 1 attachments from Jira into https://gist.github.com/f5326cd5233646eb75cb