views:

31

answers:

0

I'm using Hibernate Annotations and trying to save an object. But when saving object I get:

Cannot insert the value NULL into column 'status'

The thing is that in my SQL Server 2008 configuration that field is defaulted to '0'. Now I dot not want to manually set the default value in my Java code like status='0', because I think this is a bad idea in case the database default value needs to be change.

How can I tell Hibernate Annotations to use the database default value?

Thanks in advance!!!