title: Doctrine 2 relationship is not working
body: <p>I have Item entity:</p>
  
  <pre><code>/**
   * Item
   *
   * @ORM\Table(name="item")
   * @ORM\Entity
   */
  class Item {
  ...
      /**
       * @var Unit
       * @ORM\Column(name="unitId", type="integer")
       * @ORM\ManyToOne(targetEntity="Unit", inversedBy="items")
       * @ORM\JoinColumn(name="unitId", referencedColumnName="id")
       */
      private $unit;
  ...
  }
  </code></pre>
  
  <p>And Unit entity:</p>
  
  <pre><code>/**
   * Unit
   *
   * @ORM\Table(name="unit")
   * @ORM\Entity
   */
  class Unit {
  ...
      /**
       * @var Item[]
       * @ORM\OneToMany(targetEntity="Item", mappedBy="unit")
       */
      private $items;
  ...
  }
  </code></pre>
  
  <p>And a code like:</p>
  
  <pre><code>$item = $this-&gt;objectManager-&gt;getRepository('Application\Main\Entity\Item')-&gt;find($id);
  $unitName = $item-&gt;getUnit()-&gt;getName();
  </code></pre>
  
  <p>Which produces error <code>Fatal error: Call to a member function getName() on a non-object</code>, what means that doctrine handles this field as simple field, not a relation field. What should I do to force Doctrine to use this field as a relationship? I have few entities with such issue, while other are working just fine. What is the reason?</p>