title: Multiple unique constraints in JPA
body: <p>Is there a way to specify using JPA that there should be multiple unique constraints on different sets of columns?</p>
  
  <pre><code>@Entity
  @Table(name="person", 
         uniqueConstraints=@UniqueConstraint(columnNames={"code", "uid"}))
  public class Person {
      // Unique on code and uid
      public String code;
      public String uid;
  
      // Unique on username
      public String username;
  
      public String name;
      public String email;
  }
  </code></pre>
  
  <p>I have seen a hibernate specific annotation but I am trying to avoid vendor specific solutions as we are still deciding between hibernate and datanucleus.</p>