I'd like to have a @Unique
constraint with Bean Validation, but that is not provided by the standard. If I would use JPA's @UniqueConstraint
I wouldn't have a unique validation and error reporting mechanism.
Is there a way to define @Unique
as a Bean Validation constraint and combine it with JPA, such that JPA creates a column with an unique constraint and checks wheter a value is unique or not?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…