-->
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.  [ 4 posts ] 
Author Message
 Post subject: Stored procedure must return a resultset?
PostPosted: Thu Jul 06, 2006 7:03 pm 
Newbie

Joined: Thu Jul 06, 2006 6:56 pm
Posts: 7
The following is from Hibernate 3 official doc:
"Hibernate 3 introduces support for queries via stored procedures and functions. Most of the following documentation is equivalent for both. The stored procedure/function must return a resultset ".

Does that mean: You can't use those stored procedures which don't return a resultset, like the Stored procedures to perform Update/Insert/delete?

thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 7:15 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
No, that's specifically for queries involving stored procedures. If you're using stored procedures in <sql-instert> or <sql-update> elements, then they don't return result sets.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject: Another question
PostPosted: Thu Jul 06, 2006 7:45 pm 
Newbie

Joined: Thu Jul 06, 2006 6:56 pm
Posts: 7
Thanks tenwit!

According to the example provided by Hibernate:

<class name="Person">
<id name="id">
<generator class="increment"/>
</id>
<property name="name" not-null="true"/>
<sql-insert callable="true">{call createPerson (?, ?)}</sql-insert>
<sql-delete callable="true">{? = call deletePerson (?)}</sql-delete>
<sql-update callable="true">{? = call updatePerson (?, ?)}</sql-update>
</class>

Does that mean those CUD Stored Procedures have to be attached with one class?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 9:49 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I'm not sure what you mean. They have to be called with all the correct parameters, is that what you're asking? The paragraph in the ref docs just below that example code tells you how to get the parameter order.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.