hql查询子查询不能直接加1 ,求解
Stringhql="fromLaTreewheretreePathlike'"+path+"%'andtreeLevel=(selecttreeLevelfromLaT...
String hql="from LaTree where treePath like '"+path+"%' and
treeLevel=(select treeLevel from LaTree where treePath='"+path+"')+1";
最后那+1 有他就报错
但是我直接拿sql查询这么用就没有事
难道hql有限制?
下边值我直接写的sql
select * from la_tree where tree_path like '000001%' and tree_level=((select tree_level from la_tree where tree_path='000001')+1)
这样就能用 展开
treeLevel=(select treeLevel from LaTree where treePath='"+path+"')+1";
最后那+1 有他就报错
但是我直接拿sql查询这么用就没有事
难道hql有限制?
下边值我直接写的sql
select * from la_tree where tree_path like '000001%' and tree_level=((select tree_level from la_tree where tree_path='000001')+1)
这样就能用 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询