title: JPA How add unique contraint on column for @OneToMany relation like on username
body: <p>I have a Class <code>Site</code> that represents a website and a Class <code>User</code>. A <code>Site</code> can have multiple <code>User</code>s.</p>
  
  <pre><code>class Site {
  
      private int site_ID;
  
      @OneToMany // with a join table
      private List&lt;User&gt; users;
      // ...
  }
  
  class User {
  
      private int user_ID;
  
      private String name;
  
      private String lastname;
  
      private String username;
  
      private String password;
  
  }
  </code></pre>
  
  <p>I want to allow same username to exist on all Sites, but only one by site.</p>
  
  <pre><code>Site/User/username
  1   /1   /username1
  1   /2   /username2
  2   /3   /username1
  </code></pre>
  
  <p>How can I do that?</p>