I have a Hibernate Spring Application. Following is my stored procedure mapping in config file profile.hbm.xml
<!-- search_profiles -->
<sql-query name="searchProfiles" callable="true" >
<return class="com.testapp.service.dataobjects.ProfileDO">
</return>
{ call get_search_results(:profileId, :loginId, :firstName, :lastName, :addressLine1, :addressLine2, :addressLine3, :city, :state, :zipCode, :country) }
</sql-query>
I am trying to invoke this procedure as follows from my Java code :
List<ProfileResultObject> profilesResultSet = hibernateTemplate.findByNamedQueryAndValueBean("getSearchResults", searchCriteria);
Getting following exception while calling this stored procedure from Java :
java.lang.UnsupportedOperationException: org.hibernate.dialect.HSQLDialect does not support resultsets via stored procedures
at org.hibernate.dialect.Dialect.registerResultSetOutParameter(Dialect.java:1262)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1713)
at org.hibernate.loader.Loader.doQuery(Loader.java:801)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
at org.hibernate.loader.Loader.doList(Loader.java:2542)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
at org.hibernate.loader.Loader.list(Loader.java:2271)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
at org.springframework.orm.hibernate3.HibernateTemplate$35.doInHibernate(HibernateTemplate.java:1028)
at org.springframework.orm.hibernate3.HibernateTemplate$35.doInHibernate(HibernateTemplate.java:1023)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.findByNamedQueryAndValueBean(HibernateTemplate.java:1023)
No comments:
Post a Comment