Santonian wrote:
Some columns that are added to the existing (and already filled) database should be @NotNull. Is there a hibernate sollution to aquirre this?
Code:
@Column(nullable = false)
Santonian wrote:
The Update itself works pretty well. The problem of couse is, that the columns are added to the existing table but they contain null values. Can I provide some kind of Default Value or something?
In hibernate annotations you can not specify default value for a column. You can use this feature if you use xml files for mapping. You can use some walkaround, it is not perfect, but it works for me. You can put default values in the constructor.
Code:
public MyClass() {
this.value = 3;
}
Maciej