今天使用hibernate,
String sql = "select count(obj.id) from " + className+" obj";出现org.hibernate.hql.ast.QuerySyntaxException: unexpected token异常,google 一阵子没效果。
后来把实体类所在的object包改成其他名字如ot,问题解决,莫非使用hibernate,实体类不能放在object包
本文讨论了在使用Hibernate时遇到的QuerySyntaxException异常问题,该异常由实体类所在的包名引起。通过将实体类的包名更改为非'object'的其他名称,成功解决了问题。
今天使用hibernate,
String sql = "select count(obj.id) from " + className+" obj";出现org.hibernate.hql.ast.QuerySyntaxException: unexpected token异常,google 一阵子没效果。
后来把实体类所在的object包改成其他名字如ot,问题解决,莫非使用hibernate,实体类不能放在object包

被折叠的 条评论
为什么被折叠?