Zoltán Tamási
2017-08-22 09:18:17 UTC
We have an NHibernate mapping where we have to use custom stored procedures
for inserts, updates and deletes. We have the mapping as follows.
<class name="MyNamespace.MyClass" table="[MYTABLE]">
<id name="Id" column="MYTABLE_ID"></id>
...
<sql-insert check="none">
EXECUTE SP_MY_TABLE_INSERT
@p1 = ?,
@p2 = ?
</sql-insert>
</class>
We use `check="none"` due to some legacy reasons.
The above mentioned stored procedure returns the inserted ID as a scalar.
However, when we commit the NHibernate transaction, the returned ID is not
populated into the entity instance so we still see the value 0 in the Id
property.
How could we teach NHibernate that the returned scalar should be treated as
the inserted ID?
for inserts, updates and deletes. We have the mapping as follows.
<class name="MyNamespace.MyClass" table="[MYTABLE]">
<id name="Id" column="MYTABLE_ID"></id>
...
<sql-insert check="none">
EXECUTE SP_MY_TABLE_INSERT
@p1 = ?,
@p2 = ?
</sql-insert>
</class>
We use `check="none"` due to some legacy reasons.
The above mentioned stored procedure returns the inserted ID as a scalar.
However, when we commit the NHibernate transaction, the returned ID is not
populated into the entity instance so we still see the value 0 in the Id
property.
How could we teach NHibernate that the returned scalar should be treated as
the inserted ID?
--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nhusers+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.