posted 18 years ago
Hi,
I need to save or update an object to the database.
I use the seeion.saveOrUpdate(myobj) method but it always updates the object even the 1st time when the object is created. And hence the object is never stored to the db.
The hbm file is as follows :
<class name="MyClass" table="Mytable" lazy="true" dynamic-update="true" dynamic-insert="true">
<meta attribute="extends">MySuperClass</meta>
<cache usage=nonstrict-read-write"/>
<composite-id class="MyPK" name=Id">
<key-many-to-one column="mycolumn1" name="myColumn1" class="MyColumn1"/>
<key-many-to-one column="mycolumn2" name="myColumn2" class="MyColumn2"/>
</composite-id>
....
can anyone please tell me what is wrong ?
thanks
Gayatri