C
C
Chvalov2019-10-09 15:05:31
Hibernate
Chvalov, 2019-10-09 15:05:31

Where do the default values ​​come from when generating DDL in SpringBoot?

There is an Entity class:

@Entity
public class Dog {
    @Id
    private long id;

    private String name;

    private int age;
    // . . . 
}
When creating a table in Postgresql 11.X, the value of age is in the database NOT NULL, but if you add an annotation @Columnwithout parameters in which by default the nullable = truecolumn is created as intended. DOiwI.pngQuestion: where does Hibernate / JPA take default values ​​​​when generating DDL, since I used to think that you can not write an annotation @Columnif the parameters I need are already set by default

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question