title: Doctrine composite key vs UniqueConstraint
body: <p>I am not sure, how to define uniqueness of multiple fields.</p>
  
  <p>Am I right that both my following examples do the job?</p>
  
  <p>What's the difference, what you prefer?</p>
  
  <p>First one:</p>
  
  <pre><code>/** @ORM\Id */
  private $id;
  
  /** @ORM\Id */
  private $title;
  </code></pre>
  
  <p>Second one:</p>
  
  <pre><code>/** @ORM\Table(name="productitem", uniqueConstraints={@UniqueConstraint(name="product_unique", columns={"id", "title"})})
   */
  class ProductItem
  {
  private $id;
  private $title;
  }
  </code></pre>