Hi, I am trying to save an object to database. While the
save() statement executed
without any exception, nothing actually get saved!? I was monitoring using SQL Profiler - no INSERT statement was ever issued... What's special about this class is that it's got a composite ID - one of the key is an "Object" (ie. not intrinsic type)
Basically, alll I did was:
Code:
Dim sess As ISession
Dim item As inv_request_item
item = UIManager.GetItem()
sess = connManager.GetSession()
sess.save(item) 'NO EXCEPTION BUT NOTHING GETS SAVED
So... simple right?
Here's the mapping file:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="warehouse.to.inv_request_item, WarehouseLib" table="inv_request_item">
<composite-id>
<key-many-to-one name="ParentInvRequest" column="request_id" class="warehouse.to.InvRequest, WarehouseLib" />
<key-property name="ItemID" column= "item_id" type="Int32" />
</composite-id>
<property name="RequestedQty" column= "requested_qty" type="Decimal" />
<property name="RevisedQty" column="revised_qty" type="Decimal" />
<property name="ConfirmedQty" column= "confirmed_qty" type="Decimal" />
<property name="StatusID" column= "status_id" type="Int16" />
<property name="Remarks" column= "remarks" type="String" length="100" />
<property name="CreateBy" column= "CreateBy" type="Int32"/>
<property name="CreateDate" column= "CreateDate" type="DateTime"/>
<property name="LastUpdateBy" column= "LastUpdateBy" type="Int32"/>
<property name="LastUpdateDate" column= "LastUpdateDate" type="DateTime"/>
</class>
</hibernate-mapping>
Can anyone tells me what's wrong with this please? Thanks in advance!