-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NHibernate & SP to insert, update, delete
PostPosted: Mon Apr 30, 2007 1:44 am 
Newbie

Joined: Tue Mar 13, 2007 10:52 am
Posts: 3
Hello guys and thanks for this great tool!

My question is regarding the ability of NHibernate to do inserts, updates and deletes through stored procedures.
Reading the documentation for the 1.2 release, I know that it is possible using ?, like <sql-insert>exec myProc ?, ?, ?</sql-insert>.

I understand that the order in which NHibernate gives the parameters is the order of items in the mapping file.

Now:
1. Is it possible to use a syntax like :Name, :Surname etc instead of "?" ?
2. If not, how can I map a parameter flag that isn't in the database table, but I need to pass it to my SP?

Cheers,
Raul


Top
 Profile  
 
 Post subject: Re: NHibernate & SP to insert, update, delete
PostPosted: Mon Apr 30, 2007 11:04 am 
Newbie

Joined: Mon Jan 29, 2007 2:03 am
Posts: 11
ra00l wrote:
Now:
1. Is it possible to use a syntax like :Name, :Surname etc instead of "?" ?
2. If not, how can I map a parameter flag that isn't in the database table, but I need to pass it to my SP?

Cheers,
Raul


Hi Raul,

1.) Internally the insert/update/delete sql is passed to a command object w/c expects all its passed parameters as "?"
2.) the sql inserts/updates/deletes are meant to be used as a quick CRUD for your entity and also it make use of your existing CRUD sps w/c most probably uses all the fields of your table as parameters.

hth


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.