Regular |
|
Joined: Wed Dec 03, 2003 9:41 pm Posts: 87
|
I used h2.1rc1 with MSSQL. I configed xml like this:
<id column="book_id" name="id" type="long" unsaved-value="0">
<generator class="identity"/>
</id>
I wanted the PK column book_id's value would be filled by database. But Hibernate throws Exception when I insert record into database.
could not insert: [h2test.test.Book]
java.sql.SQLException: [Microsoft][SQLServer JDBC Driver][SQLServer]Cannot insert the value NULL into column 'book_id', table 'test.dbo.Book'; column does not allow nulls. INSERT fails.
Why?
|
|