title: What does JPA @UniqueConstraint do in Hibernate?
body: <p>In Hibernate, why should I use the JPA tag:</p>
  
  <pre><code>@Table(name="tbl_sky",
      uniqueConstraints = {@UniqueConstraint(columnNames={"month", "day"})}
  )
  </code></pre>
  
  <p>I know <em>when</em> to use it. It's used when the combination of fields (tuple) of a database table is unique. It's not used when there is a composite primary key because composite primary keys are always unique. Anyway, the database already enforces this "unique constraint" relationship, so what's the point of including this tag on my Hibernate annotations? How does using this tag help Hibernate?</p>