Java 在此结果集中找不到列名x,并且org.hibernate.exception.sqlgrammareexception:无法执行查询
尝试使用NamedQuery获取列表时出现此异常:Java 在此结果集中找不到列名x,并且org.hibernate.exception.sqlgrammareexception:无法执行查询,java,mysql,spring,hibernate,Java,Mysql,Spring,Hibernate,尝试使用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.
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
同时还存在另一个错误:在此结果集中找不到列名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的类来存储结果集。
使用属性页传递输入参数。
请提供此异常的解决方案。异常会告诉您第一个
?
的错误是什么?使用?在属性页中给出了查询的概念。name=findMonthlyReportModel query.isCallable=true query.entity=org.nic.eoffice.mis.efile.model.MonthlyBuisinesModel input.model=org.nic.eoffice.mis.efile.model.monthlybuisinesinputmodels请帮助我解决这个问题我没有得到这个问题