-->
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.  [ 1 post ] 
Author Message
 Post subject: Issue with Hiberante[JPA] + Stored Procedure call
PostPosted: Mon Dec 13, 2010 5:58 am 
Newbie

Joined: Mon Dec 13, 2010 5:36 am
Posts: 1
Hi All,

Recently I was working with EclipseLink[JPA] and was able to call stored procedure[Database : MYSQL] successfully and get the result.

When I was trying to call same stored procedure with Hibernate[JPA] I was getting error;

org.hibernate.exception.SQLGrammarException: could not execute query

Is it like Hibernate[JPA] doesn’t have stored procedure call support ?

I am using hibernate-3.2.6.ga.jar, IDE: Netbeans 6.8, Server: Glassfish 3

My code snippet is given below:

Code:
    EntityManagerFactory mEmf =Persistence.createEntityManagerFactory("Persistence_Name");
    EntityManager manager = mEmf.createEntityManager();
    EntityTransaction entityTransaction = manager.getTransaction();
    ----------------------------
    --------------------------------------------

    Query query = manager.createNativeQuery("{call SP_NAME(?)}");
    query.setParameter(1,parameter1);
    List ls = query.getResultList();

    ----------------------------------------
   


Can anyone please suggest what could be the problem?

Thanks
Avi


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.