java.lang.IllegalArgumentException: node to traverse cannot be null! 处理方法

来源:互联网 发布:手机淘宝个人主页标签 编辑:程序博客网 时间:2024/06/10 14:18

java.lang.IllegalArgumentException: node to traverse cannot be null! 处理方法


一般出现这个问题是因为你的hql语句写错:

特别注意字符串与一些属性值之间的空格


例如:

//在from后面需要多加一个空格,在as o前面和后面都需多加一个空格

错误实例:String hql="from" + entityClass.getSimpleName() + "as o" + orderBy;

正确实例:String hql="from " + entityClass.getSimpleName() + " as o " + orderBy;



0 0