Hi,
I am trying to execute a named query having a call to an oracle function. The following is the mapping <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <sql-query name="getRenewalApplication" callable="true"> <return alias="application" class="TestFn"> <return-property name="COL1" column="COL1" /> <return-property name="COL2" column="COL2" /> </return> { ? = call api.test_fn(:i_application_id) } </sql-query> </hibernate-mapping>
To execute List list = null; list = getSession().getNamedQuery("getRenewalApplication") .setParameter("i_application_id", appId) .list(); This call is throwing an exception Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cls_sessionFactory' defined in class path resource [persistconfig/applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Errors in named queries: getRenewalApplication at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method)
If I remove the mapping to the java object in .hbm.xml file , the function gets executed and the return is just a list of java.lang.Objects.
Can anyone please help me out with this.
Regards Geetha
|