Answer the question
In order to leave comments, you need to log in
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 @Column
without parameters in which by default the nullable = true
column is created as intended. Question: where does Hibernate / JPA take default values when generating DDL, since I used to think that you can not write an annotation @Column
if 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 questionAsk a Question
731 491 924 answers to any question