Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to obtain boolean stored procedure call in Hibernate?

58 views
Skip to first unread message

Jaroslav Záruba

unread,
Dec 1, 2009, 12:40:33 AM12/1/09
to
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(:param1, :param2)").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.

0 new messages