title: Doctrine not found entity id
body: <p>i have a problem mapping entities in Doctrine 2 (with Symfony2). Symfony says that error is in Perfil entity, but the Doctrine section profiler says that the error is en Funcion entity.</p>
  
  <p>This is the error (on the browser):</p>
  
  <blockquote>
    <p>The column id must be mapped to a field in class
    AppsManantiales\CommonBundle\Entity\Perfil since it is referenced by a
    join column of another class.</p>
  </blockquote>
  
  <p>But, in the profiler:</p>
  
  <blockquote>
    <p>AppsManantiales\CommonBundle\Entity\Funcion: The referenced column
    name 'id' has to be a primary key column on the target entity class
    'AppsManantiales\CommonBundle\Entity\Funcion'. The referenced column
    name 'id' has to be a primary key column on the target entity class
    'AppsManantiales\CommonBundle\Entity\Perfil'.</p>
  </blockquote>
  
  <p>This is the relation er:</p>
  
  <p><img src="https://i.stack.imgur.com/vixEh.png" alt="enter image description here"></p>
  
  <p>The Perfil entity, basically is:</p>
  
  <pre><code>class Perfil implements RoleInterface{
  
      /**
       * @ORM\Id
       * @ORM\Column(type="integer", length=10)
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $idperfil;
  
     /**
      * @ORM\ManyToMany(targetEntity="Funcion", mappedBy="perfiles")
      * @ORM\JoinTable(name="perfil_funcion",
      *      joinColumns={@ORM\JoinColumn(name="perfil", referencedColumnName="idperfil")},
      *      inverseJoinColumns={@ORM\JoinColumn(name="funcion", referencedColumnName="idfuncion")}
      *  )
      */
      protected $funciones;
  
      // More code...
  }
  </code></pre>
  
  <p>The Funcion entity basically is:</p>
  
  <pre><code>class Funcion {
  
      /**
       * @ORM\Id
       * @ORM\Column(type="integer", length=11)
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $idfuncion;
  
      /**
       * @ORM\ManyToMany(targetEntity="Perfil", inversedBy="funciones")
       */
      protected $perfiles;
  
      // More code...
  }
  </code></pre>
  
  <p>Any ideas ? Thanks !</p>