0 Replies Latest reply on Jun 14, 2006 11:30 PM by k e

    how to configure @UniqueConstraint

    k e Newbie

      how do you use an object in the uniqueconstraint configuration? i want the unique constraint to be based on the user-entity's id and the name column. is this possible with this attribute?

      @Table(name = "x",
       uniqueConstraints = {@UniqueConstraint(columnNames={"user.name", "name"})})
      public class X implements Serializable
       private Integer id;
       private String name;
       private User user;
       public User getUser() {
       return user;
       public void setUser(User user) {
       this.user = user;
       @Column(updatable = true, nullable = false)
       public String getName()
       return name;
       public void setName(String name)
       this.name = name;