Entity of type 'AppBundle\Entity\User' for IDs id(155) was not found
<p>When I iterate over users of one group (group#users and it's a ManyToOne relationship) to display the users emails, I get this error <code>Entity of type 'AppBundle\Entity\User' for IDs id(155) was not found</code>. However, when I display the user for which the exception is raised I see this:</p>

<pre><code>// In my controller
dump($groups[0]-&gt;getUser());

// Output
User {#761 ▼
  +__isInitialized__: false
  #id: 155
  #email: null
  #firstName: null
  #lastName: null
  #roles: null
   …2
}
</code></pre>

<p>Besides, this user (whose id equals 155) does exist in my database.</p>

<p><strong>UPDATE 1</strong></p>

<pre><code>public function getByCriteria(array $criteria)
{
    $qb = $this-&gt;createQueryBuilder('g');
    // ....


    return $qb
            -&gt;getQuery()
            // This does NOT change anything ?? Isn't this supposed to load related user??
            // http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#temporarily-change-fetch-mode-in-dql
            -&gt;setFetchMode('class_namespace', 'user', ClassMetadata::FETCH_EAGER)
            -&gt;getResult();
}
</code></pre>