Value Constraint in a Class using Spring Tools

Viewed 19

I'm using Spring Tools for a project. Is there a way of constraint a column with a unique value?

For example, some like this:

@Entity
@Table(name = "seg_usuario")
public class User implements Serializable {
       @Id
       @GeneratedValue(strategy = GenerationType.IDENTITY)
       private Integer id;

       @Column(uniqueValue="ESTGRL")
       private String state;
}
0 Answers
Related