Hi,
I'm trying to call a stored procedure written on Oracle9 by a JAVA program.
I created a mapping file which contains the following information :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 9 mai 2007 13:50:38 by Hibernate Tools 3.2.0.b9 -->
<hibernate-mapping>
<class name="com.test.bo.TestProc">
<loader query-ref="test"/>
<sql-update>Call PS_UPDATE_TEST()</sql-update>
</class>
</hibernate-mapping>
The class "TestProc" is the following :
Code:
package com.test.bo;
public class TestProc {
/** Creates a new instance of TestProc */
public TestProc() {
}
}
The DAO is the following :
Code:
public class TestProcHome extends DaoHelper {
/** Creates a new instance of TestProcHome */
public void callProc(){
Session session = sessionFactory.getCurrentSession();
try{
session.beginTransaction();
session.getNamedQuery("test");
}catch (Exception e){
e.printStackTrace();
}finally{
session.getTransaction().commit();
HibernateUtil.closeSession(session);
}
}
}
But my question is the following :
- Is that necessary to declare a mapping file in order to call simply a stored procedure which is making an update ?
Because I obtain the following error :
org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/test/bo/TestProc.hbm.xml
Thanks in advance for any answer.