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.  [ 3 posts ] 
Author Message
 Post subject: Stored procedure documentation glitch
PostPosted: Fri Jan 13, 2006 7:06 am 
Newbie

Joined: Fri Jan 13, 2006 6:51 am
Posts: 3
Location: Crawley, United Kingdom
I thought that I'd raise this as it may save somebody else the time that I wasted looking for an answer elsewhere.

I had my first requirement to access stored procedures, via Hibernate, yesterday and based my evaluation code upon the online documentaion example (to be found at http://www.hibernate.org/hib_docs/v3/reference/en/html/querysql.html#sp_query)...

Code:
<sql-query name="selectAllEmployees_SP" callable="true">
    <return alias="emp" class="Employment">
        <return-property name="employee" column="EMPLOYEE"/>
        <return-property name="employer" column="EMPLOYER"/>
        <return-property name="startDate" column="STARTDATE"/>
        <return-property name="endDate" column="ENDDATE"/>
        <return-property name="regionCode" column="REGIONCODE"/>
        <return-property name="id" column="EID"/>
        <return-property name="salary">
            <return-column name="VALUE"/>
            <return-column name="CURRENCY"/>
        </return-property>
    </return>
    { ? = call selectAllEmployments() }
</sql-query>


I dutifully modified the names of the procedure/class/field/columns to suit my purposes and fired up the testcases.

The error that I received was as follows...

Code:
[ERROR] 58:10 (JDBCExceptionReporter.java:logExceptions:72)
Parameter #1 has not been set.


Due to the relative newness of Stored Procedure support in Hibernate and the subsequent sparse documentation, I couldn't really figure out how to resolve this issue.
Quite a bit of searching on the web resulted in me finding another example mapping file that made me realise how stupid I'd been - the opening '? =' was not required at all!

The online documentation should, in fact, read...

Code:
...
    { call selectAllEmployments() }
...


Could somebody update the docs, to prevent others from the same head scratching?

Yes, I know how stupidly obvious the solution is but - as always - it's only obvious when you know the answer!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 7:16 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
please note that the examples are for Oracle and there are differences in how each db needs to invoke the procedure.

please report this in jira with information about your db etc.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 7:24 am 
Newbie

Joined: Fri Jan 13, 2006 6:51 am
Posts: 3
Location: Crawley, United Kingdom
Max,

Thanks for the swift reply.

I'll do as you ask, please forgive me for not realising the correct procedure.

Best regards,

Bob


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.