dbTalk Databases Forums  

How to obtain boolean stored procedure call in Hibernate?

comp.databases.postgresql comp.databases.postgresql


Discuss How to obtain boolean stored procedure call in Hibernate? in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jaroslav Záruba
 
Posts: n/a

Default How to obtain boolean stored procedure call in Hibernate? - 11-30-2009 , 11:40 PM






I tried the named callable query approach...
<sql-something name="..." callable="true">
{ ? = call schema.procedure(?,?) }
</sql-something>
....but what I get is either a message about native calls not being
supported or some kind of type mismatch exception. (Like stored
procedure has been executed but returned Type=4 when Type=1111 was
epxected, or vice versa.

So this is what I'm using currently:
Boolean result = (Boolean) session.createSQLQuery("select
schema.procedure(aram1, aram2)").setParameter("param1",
param1).setParameter("param2", param2).uniqueResult();

It works but I would feel better using "a proper" solution.

I have read many posts related to this but can't find a satisfying
solution. Most of them are out-of-date, using deprecated constructs.

Best regards
Jarda Z.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.