my dog learned polymorphism
The moose likes Object Relational Mapping and the fly likes Calling Stored proc using Hibernate @NamedNativeQuery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Calling Stored proc using Hibernate @NamedNativeQuery" Watch "Calling Stored proc using Hibernate @NamedNativeQuery" New topic

Calling Stored proc using Hibernate @NamedNativeQuery

Ashiish Sharma

Joined: Sep 16, 2009
Posts: 1

I am a newbie in hibernate, I am using @javax.persistence.NamedNativeQuery to resolve my stored proc calls from hibernate to mysql but i am getting errors.

Please help:

My persistent class is:

My mysql stored proc is:

The main method that is calling this code is as:

My hibernate config file is as :

On code execution i am getting following error/exception:

Please help what is going wrong and help me get it corrected. Also refer me to suitable links where i can learn more about this technique.

My stack is:

Mysql Version 14.12 Distrib 5.0.67
Hibernate 3

Thanks in advance

I agree. Here's the link:
subject: Calling Stored proc using Hibernate @NamedNativeQuery
It's not a secret anymore!