Hello,
Trying my first test with Hibernate, I used HibernateSynchroniser to generate the mapping file of a simple table (ID, text).
Hibernate Synchroniser gives me a <generator class="vm" /> for the primary key. I changed this to "identity" (as the manual said for SQL Server).
I didn't find anything about <generator class="vm" /> on the forum or in the online docs.
My problem is that I can't insert anything if I use <generator class="identity" /> (or "native") but it's okay with <generator class="vm" />.
Below, I provide the Stack trace and the generated SQL.
My question is : What is <generator class="vm" /> ???
Hibernate version: 2.1.6
Mapping documents:
<hibernate-mapping package="test">
<class name="TauxTva" table="TAUXTVA">
<id
column="TauxTVAID"
name="id"
type="int"
>
<generator class="identity" />
</id>
<property
column="TauxTVA"
length="53"
name="TauxTVA"
not-null="true"
type="float"
/>
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Can't insert NULL in column 'TauxTVAID', table 'TEST.dbo.TAUXTVA'. This column doesn't accept NULL value. INSERT a
|