hibernate查询语句如下:Query q = sess.createQuery("from TUserBean user,TOrgBean org "
+ "where user.userOrgId=org.orgId and org.state='A' "
+ "and user.state = 'A' start with org.orgId='"+orgId+"'
connect by prior org.orgId = org.parentOrgId order by user.createDate desc");报错信息:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: start near line 1, column 161 [from cn.com.bean.TUserBean user,cn.com.bean.TOrgBean org where user.userOrgId=org.orgId and org.state='A' and user.state = 'A' start with org.orgId='876' connect by prior org.orgId = org.parentOrgId order by user.createDate desc]是hibernate不支持start with?还是写错了?删掉start with org.orgId='"+orgId+"' connect by prior org.orgId = org.parentOrgId就不会报错。
+ "where user.userOrgId=org.orgId and org.state='A' "
+ "and user.state = 'A' start with org.orgId='"+orgId+"'
connect by prior org.orgId = org.parentOrgId order by user.createDate desc");报错信息:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: start near line 1, column 161 [from cn.com.bean.TUserBean user,cn.com.bean.TOrgBean org where user.userOrgId=org.orgId and org.state='A' and user.state = 'A' start with org.orgId='876' connect by prior org.orgId = org.parentOrgId order by user.createDate desc]是hibernate不支持start with?还是写错了?删掉start with org.orgId='"+orgId+"' connect by prior org.orgId = org.parentOrgId就不会报错。
关注.......
关注.......
String hql=from Otable from c;
Query cc=sesson.cretequeary(hql);
List list=cc.list();//list总是null,是什么原因,希望个位大家做个解释,谢谢