I have a Postgres database that i have mapped with Hibernate, and everything was working fine until i had the need of adding a new attribute.
I've added an attribute "ROLE" which needs to be not null and have the value "USER" by default.
In Postgres i have ROLE VARCHAR(60) NOT NULL DEFAULT 'USER' which i believe is correct, and i also have
@Column(name = "role", length = 60, nullable = false, columnDefinition = "varchar(60) default 'USER'")
public String getRole() {
return this.role;
}
The thing is, when i try to create a new entry in my DB it fails - not-null property references a null or transient value
I've tried everything but no luck... From what i read, what i have should have worked. Can anyone help please?
Thank you.