title: Doctrine create foreign key
body: <p>I'm having trouble with foreign keys in doctrine. I have a "User"-table and a "Orders"-table. Now I want to have a foreign key from userID in the orders-table to the id in the user-table. The orders-entity looks like:</p>
  
  <pre><code>&lt;?php
  
  namespace Application\TestBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * @ORM\Table(
   *  name="Orders",
   *  options={"collate"="utf8_general_ci",
   *   "charset"="utf8",
   *   "engine"="InnoDB"
   *  }
   * )
   * @ORM\Entity(repositoryClass="Application\TestBundle\Entity\OrdersRepository")
   */
  class Orders
  {
      /**
       * @var integer
       *
       * @ORM\Column(
       *  name="id",
       *  unique=true,
       *  type="integer",
       *  options={"unsigned"=true}
       * )
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      /**
       * @var integer
       *
       * @ORM\Column(
       *  name="userID",
       *  type="integer",
       *  nullable=false,
       *  options={"unsigned"=true}
       * )
       * @ORM\OneToOne(targetEntity="User")
       * @ORM\JoinColumn(name="userID", referencedColumnName="id")
       */
      private $userID;
  
      // ...
  }
  </code></pre>
  
  <p>The user-entity looks like:</p>
  
  <pre><code>&lt;?php
  
  namespace Application\TestBundle\Entity;
  
  use Doctrine\ORM\Mapping as ORM;
  
  /**
   * @ORM\Table(
   *  name="User",
   *  options={"collate"="utf8_general_ci",
   *   "charset"="utf8",
   *   "engine"="InnoDB"
   *  }
   * )
   * @ORM\Entity(repositoryClass="Application\TestBundle\Entity\UserRepository")
   */
  class User
  {
      /**
       * @var integer
       *
       * @ORM\Column(
       *  name="id",
       *  unique=true,
       *  type="integer",
       *  options={"unsigned"=true}
       * )
       * @ORM\Id
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      private $id;
  
      // ...
  }
  </code></pre>
  
  <p>Unfortunately <strong>no foreign key will be set</strong>. It is not in the SQL-query. What am I doing wrong?</p>