title: doctrine2: undefined index - many-to-one with non default referencedColumnName does not persist entity
body: <p>I'm using Symfony 2.1.2.</p>
  
  <p>I have two entities and define a [many-to-one (bidirectional)] (1) association between them. I don't want to use the primary key for the foreign key (referencedColumnName). I want to use another integer unique column: customer_no</p>
  
  <pre><code>/**
   * @ORM\Entity
   * @ORM\Table(name="t_myuser")
   */
  class MyUser extends BaseEntity // provides an id (pk)
  {
      /**
       * @ORM\ManyToOne(targetEntity="Customer", inversedBy="user")
       * @ORM\JoinColumn(name="customer_no", referencedColumnName="customer_no", nullable=false)
       */
      public $customer;
  }
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="t_customer")
   */
  class Customer extends BaseEntity // provides an id (pk)
  {
      /**
       * @ORM\Column(type="integer", unique=true, nullable=false)
       */
      public $customer_no;
  
      /**
       * @ORM\OneToMany(targetEntity="MyUser", mappedBy="customer")
       */
      public $user;
  }
  </code></pre>
  
  <p>When I try to persist a MyUser entity with an Customer entity, I get this error:</p>
  
  <p>Notice: Undefined index: customer_no in ...\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php line 608</p>
  
  <p>The schema on the db looks fine, these should be the important sql schema definitions:</p>
  
  <pre><code>CREATE UNIQUE INDEX UNIQ_B4905AC83CDDA96E ON t_customer (customer_no);
  CREATE INDEX IDX_BB041B3B3CDDA96E ON t_myuser (customer_no);
  ALTER TABLE t_myuser ADD CONSTRAINT FK_BB041B3B3CDDA96E FOREIGN KEY (customer_no) 
    REFERENCES t_customer (customer_no) NOT DEFERRABLE INITIALLY IMMEDIATE;
  </code></pre>
  
  <p>So there <strong>is</strong> definitely an index for <strong>customer_no</strong></p>
  
  <p><strong>//update:</strong>
  I fix the inversedBy and mappedBy stuff, but this is not the problem.</p>
  
  <p>(1) : <a href="http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#one-to-many-bidirectional" rel="nofollow noreferrer">http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/association-mapping.html#one-to-many-bidirectional</a></p>