I have a Java bean. Now, I want to be sure that the field should be unique.
I am using the following code:
@UniqueConstraint(columnNames={"username"})
public String username;
But I'm getting some error:
@UniqueConstraint is dissallowed for this location
What's the proper way to use unique constraints?
Note: I am using play framework.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…