I have MySql database with several tables. Every field in each table is not nullable. That's why I am forced to use @NotNull
annotation to each field in all my Java classes marked with @Entity
. Do I really have to do this or is there a way to tell JPA/Hibernate to treat every field NotNullable on default?
edit:
I am aware of @Column(name="something", nullable=false)
too. But still, it doesn't solve any problem - you have to write nullable=false