nested exception is org.hibernate.exception.SQLGrammarException: could not execute query
2017-11-04 16:55
826 查看
<hibernate-mapping> <class>......</class> </sql-query> --> <sql-query name="check"> <![CDATA[from image i where i.account=?]]> //return不写工程会报错 alias别名 class 对应的实体类 <return alias="i" class="com.gjh.entity.ImageTarget"></return> </sql-query> </hibernate-mapping>
当我执行getHibernateTemplate().findByNamedQuery(“check”, values);就会报上面的错误
原因就是hql语句的问题,这里不能写hql语句了,当写完整的sql语句(select * from image i where i.account=?)就不会报上面的错误了
相关文章推荐
- nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
- nested exception is org.hibernate.exception.SQLGrammarException: could not get next sequence value
- org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exce
- 异常积累:org.hibernate.exception.SQLGrammarException: could not execute query-hibernate解释后的sql语句有问题
- org.hibernate.exception.SQLGrammarException: could not execute query
- 报错org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
- org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [null]; nested exception is org.hibernate.
- HTTP Status 500 - could not execute query; nested exception is org.hibernate.exception.JDBCConnectio
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query处理方式
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query处理方式
- org.hibernate.exception.SQLGrammarException: could not execute query
- [hibernate]:org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hi
- org.hibernate.exception.SQLGrammarException: could not execute query
- org.hibernate.exception.SQLGrammarException: could not execute query
- [已解决]org.hibernate.exception.SQLGrammarException: could not execute statement
- org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update问题的解决