当我尝试使用NamedQuery获取列表时出现此异常:
org.hibernate.exception.SQLGrammarException:
could not execute query. In detail it shows that
org.nic.eoffice.mis.core.service.ServiceException:
org.nic.eoffice.mis.core.service.ServiceException:
org.nic.eoffice.mis.dao.DAOException:
org.springframework.dao.InvalidDataAccessResourceUsageException: could not
execute query; SQL [{? = call kermis_monthlyreport(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}];
nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
并且还存在另一个错误:在此ResultSet中找不到列名count11。
{@SqlResultSetMapping(name = "MonthlyBuisinesModel", entities = @EntityResult(entityClass org.nic.eoffice.mis.efile.model.MonthlyBuisinesModel.class))
@NamedNativeQueries({
@NamedNativeQuery(name = "findMonthlyReportModel", query = "{? = call kermis_monthlyreport(:postdetailid, :fromDate, :toDate, :nature, :department, :office, :userName, :typeId, :filterQuery, :orderQuery, :startIndex, :maxResults)}", resultSetMapping = "MonthlyBuisinesModel", callable = true) })}
然后我创建名为MonthlyBuisinesModel的类来存储结果集。 使用属性页传递输入参数。 请为此例外提供解决方案。