title: Symfony 2 not finding primary key of mapped entity
body: <p>I am having an issue with the primary key of a mapped entity not being detected by doctrine.</p>
  
  <p>I have 2 tables, users and operators.  There is a unidirectional many to one relationship between users and operators. </p>
  
  <p>User entity is defined as</p>
  
  <pre><code>XXX\SecurityBundle\Entity\User:
      type: entity
      repositoryClass: XXX\SecurityBundle\Repository\UserRepository
      table: XXX_USER
      id:
          id: 
              type: integer
              unsigned: false
              nullable: false
              column: ID
              generator:
                  strategy: AUTO
      fields:
          username:
              type: string
              length: 32
              nullable: false
              column: USERNAME
  ...
      manyToOne:
          operator:
              targetEntity: XXX\CoreDataBundle\Entity\Operator
              joinColumn:
              name: operator_id
              referencedColumnName: id
  </code></pre>
  
  <p>The operators entity defined as</p>
  
  <pre><code>XXX\CoreDataBundle\Entity\Operator:
      type: entity
      respositoryClass: XXX\CoreDataBundle\Repository\OperatorRepository
      table: OPERATORS
      id:
          id:
              type: integer
              unsigned: false
              nullable: false
              column: ID
              generator:
                  strategy: AUTO
      fields:
          operName:
              type: string
              length: 32
              nullable: false
              column: OPERATOR_NAME    
  </code></pre>
  
  <p>When validating the schema,  I receive the following error :</p>
  
  <ul>
  <li>The referenced column name 'id' has to be a primary key column on the target entity class 'XXX\CoreDataBundle\Entity\Operator'.</li>
  </ul>
  
  <p>When I try to assign an operator to a user, I receive the following error :</p>
  
  <p>[ErrorException]<br>
    Notice: Undefined index: id in vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line<br>
    607</p>
  
  <p>As far as I can see,  'id' is set as the primary key of the operator entity.  The database behind doctrine is oracle, in is in sync with the entity definitions and the primary key is set correctly on the database.</p>
  
  <p>Anyone able to spot my error in defining the mapping ?  </p>
  
  <p>I do not think the fact the entities are in different bundles is an issue as I am getting similar issues with entities in the same bundle.</p>
  
  <p>Thank you.</p>