Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: Hibernate3 3.2.3.ga
Mapping documents:
<id name="id" type="long" column="Id">
<generator class="increment" />
</id>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
DB2 version9.1
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problem with an entity with primary key zero
Following is the description of the problem
I have an entity whose primary key is defined as
<id name="id" type="long" column="Id">
<generator class="increment" />
</id>
in its hbm mapping file
There is a row in the corresponding table for that entity in DB2 with id zero
I want to retrieve this entity with id zero, modify it and then update it in the database.
The retrieval works perfectly fine but update creates a new entity instead of updating the entity with id zero with the modification
Can any one tell me what is wrong.
Thanks in advance
Read this:
http://hibernate.org/42.html