Problems in hibernate update

1

I'm having some unforeseen issues with Hibernate in my application.

I would like to know if the annotations implementations made in the java class are taken to the database or treated only inside the system, since I added @NotNull to a field, and after restart did not take this implementation for the bank.

My configuration of Hibernate is as update , and fields are usually added when modified.

I did not understand why Hibernate did not automatically change this in the database, and led me to question whether those annotations are correct.

Thank you.

    
asked by anonymous 23.02.2016 / 00:33

1 answer

3

@NotNull is valid only on the system because it is part of the Bean Validation , if you do not want the null bank field then you can put @Column(nullable = false ) which is the specification of JPA

Ex:

@Column(nullable = false)
private String nome;
    
23.02.2016 / 01:29