On Tuesday, August 22, 2017 at 6:11:05 AM UTC-4, Zoltán Tamási wrote:
>
> We have an NHibernate mapping where we have to use custom stored 
> procedures for inserts, updates and deletes. We have the mapping as follows.
>

ISession.Connection? ... .CreateCommand() ... And so on.

That's not necessarily an "insert/update" in the sense of SaveOrUpdate, but 
you would be teaching your Repository how to handle those issues.

That's assuming your underlying Provider supports Connections, creating 
Commands, etc.

BTW, works fine for me during migrations. I'm not yielding a Uuid's, per 
se, but I do yield responses back. Same applies here I expect.

   
> <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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to