I am using Hibernate over SQL Server for a web application. I was using the "increment" generator class till now and recently ran into ConstraintViolation exceptions.
So, I changed the generator to "identity" and I am getting the following error -
Cannot insert the value NULL into column 'assessment_administration_id', table 'faip.dbo.assessment_administration'; column does not allow nulls. INSERT fails.
Following is the mapping -
<class name="AssessmentAdministration" table="assessment_administration">
<id name="id" type="long" column="assessment_administration_id">
<generator class="identity" />
</id>
<property name="administrationName" column="administration_name" />
</class>
What am I doing wrong here? I looked at this post http://www.coderanch.com/t/216051/ORM/java/Hibernate-MSSQL-identity-column, but the solution is not posted.