Using hibernate for data access.
I have a column in database:
varchar(40), default value is set to 0, NOT NULL
I have a case, that user sends null value, and getting error:
Error: org.hibernate.exception.ConstraintViolationException: Cannot insert the value
NULL into column 'foo', table 'MyTable'; column does not allow nulls. INSERT fails.
And the column in hibernate is defined like this:
@Column(name = "foo")
private String foo;
Where could the problem be? Must I define the default in hibernate annotations or smthing? How? Or any other suggetsions?