title: Doctrine 2 - Disallow null value on foreign keys of ManyToOne relationships
body: <p>I have a ManyToOne relationship in one of my entities, like so:</p>
  
  <pre><code>class License {
      // ...
      /**
       * Customer who owns the license
       * 
       * @var \ISE\LicenseManagerBundle\Entity\Customer
       * @ORM\ManyToOne(targetEntity="Customer", inversedBy="licenses")
       * @ORM\JoinColumn(name="customer_id", referencedColumnName="id")
       */
      private $customer;
      // ...
  }
  
  class Customer {
      // ...
      /**
       * Licenses that were at one point generated for the customer
       * 
       * @var \Doctrine\Common\Collections\ArrayCollection
       * @ORM\OneToMany(targetEntity="License", mappedBy="customer")
       */
      private $licenses;
      // ...
  }
  </code></pre>
  
  <p>This generates a database schema where the "customer_id" field of the license table is allowed to be null, which is exactly what I do not want.</p>
  
  <p>Here's some code where I create a record to prove that it indeed allows null values for the reference fields:</p>
  
  <pre><code>$em = $this-&gt;get('doctrine')-&gt;getEntityManager();
  $license = new License();
  // Set some fields - not the reference fields though
  $license-&gt;setValidUntil(new \DateTime("2012-12-31"));
  $license-&gt;setCreatedAt(new \DateTime());
  // Persist the object
  $em-&gt;persist($license);
  $em-&gt;flush();
  </code></pre>
  
  <p>Basically, I don't want a License to be persisted without having a Customer assigned to it. Is there some annotation that needs to be set or should I just require a Customer object to be passed to my License's constructor?</p>
  
  <p>The database engine I use is MySQL v5.1, and I am using Doctrine 2 in a Symfony2 application.</p>