@Column(name = \"userId\") @UniqueConstraint private Integer userId;
I am using these annotation for entering data into database table. i want
Here's an example of how to use @UniqueConstraint:
@Entity @Table(name = "contact", uniqueConstraints = @UniqueConstraint(columnNames = {"name", "company_id"})) public class Contact { ... }
This specifies that the combination of the "name" column and the "company_id" column will be unique.