title: Unique Constraint Not Enforce on SchemaExport of Hibernate
body: <p>I am quite unsure why my entity class does not create my required table schema</p>
  
  <pre><code>@Entity
  @Table(name = "User")
  public class User implements Serializable {
      private Long id;
      private String loginName;
  
      @Id
      @GeneratedValue
      public Long getId() {
          return id;
      }
      @Column(name = "login_name", unique = true)
      public String getLoginName() {
          return loginName;
      }
      //other setters
  }
  </code></pre>
  
  <p>When I use the Schema export.</p>
  
  <pre><code>new SchemaExport(config).create(true, true);
  </code></pre>
  
  <p>It creates this SQL but then it does not add any unique constraints to my login_name field.</p>
  
  <pre><code>drop table User
  create table User (id bigint generated by default as identity, login_name varchar(255)primary key (id))
  </code></pre>
  
  <p>I am using Apache Derby and I have checked the reference manual of Derby and it does support the Unique constraint on the column.  I tried adding a uniqueconstraint annotation on the class but the result is the same.</p>
  
  <p>Any idea?</p>