title: unique constraint check in JPA
body: <p>I am enforcing a unique constraint check in JPA for userid column which is enforced for all records in the user table.</p>
  
  <pre><code>@Table(name = "user",
         uniqueConstraints = @UniqueConstraint(columnNames = userid))
  </code></pre>
  
  <p>My requirement is that, the userid's within a particular organization needs to be unique and not across all organizations.</p>
  
  <p>How do I enforce such a check?</p>