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 queryIs 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