I'm using Spring boot 1.5 with Hibernate 5.2, my problem is that the javax constraints annotations like @NotNull
are not translated to the database.
@Entity
public class Date extends AbstractModel {
@NotNull
@NotEmpty
protected String startDate;
@NotNull
@NotEmpty
protected String endDate;
// Getters and setters are omitted for brevity
}
This code gives no constraints on my MySQL database. I know I can use @column(nullable=false)
, but how comes that the javax annotations doesn't work?