| Annotation @Check has in documentation following targets: @Target( {TYPE, METHOD, FIELD} ) When I place it over entity it properly creates "check" in the database (using hbm2ddl):
@Entity
@Check(constraints = "sex IN ('WOMAN' ,'MAN')")
@Table(name = "person")
public class Person implements Serializable{
But It doesn't work when placed over a field - check is not being created in the database at all:
@NotNull
@Column(name = "sex", nullable = false)
@Enumerated(EnumType.STRING)
@Check(constraints = "sex IN ('WOMAN' ,'MAN')")
private Sex sex;
|