问题描述:hibernate 保存时遇到问题
org.hibernate.hql.ast.QuerySyntaxException: unexpected token
问题分析:
1、把报错hql 改为sql 语句在数据库环境中运行
报错:Unknown column ‘xxx’ in ‘where clause’
2、这个错误表面是没有这个字段。其实字符型数据没有加单引号也会引起这个问题。
问题解决:
把字符类型加上单引号。
参考:
问题描述:hibernate 保存时遇到问题
org.hibernate.hql.ast.QuerySyntaxException: unexpected token
问题分析:
1、把报错hql 改为sql 语句在数据库环境中运行
报错:Unknown column ‘xxx’ in ‘where clause’
2、这个错误表面是没有这个字段。其实字符型数据没有加单引号也会引起这个问题。
问题解决:
把字符类型加上单引号。
参考: