title: JPA - defining multi-column unique constraints
body: <p>Is it possible using JPA to define multiple unique constraints.</p>
  
  <pre><code>@Entity
  class Foo {
      long id;
  
       String name;
  
       MyEnum type;
  
  }
  </code></pre>
  
  <p>Foo.id should be unique as should combinations of {Foo.name, Foo.type}.<br>
  Ex.<br>
  id, name, type<br>
  1, "name1", "type1"<br>
  2, "name1", "type2"<br>
  3, "name1", "type1" // error duplicate of id = 1  </p>
  
  <p>How do I achieve this using JPA annotations?</p>
  
  <p>Thanks</p>