java.lang.UnsupportedOperationException:org.hibernate.dialect.HSQLDialect不支持通过存储过程生成的结果集

时间:2015-10-07 04:08:18

标签: java spring hibernate stored-procedures resultset

java.lang.UnsupportedOperationException:org.hibernate.dialect.HSQLDialect不支持通过存储过程的结果集 我有一个Hibernate Spring应用程序。以下是配置文件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>

我试图从我的Java代码中调用以下过程:

List<ProfileResultObject> profilesResultSet = hibernateTemplate.findByNamedQueryAndValueBean("getSearchResults", searchCriteria);

从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)

0 个答案:

没有答案