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就不会报错。

解决方案 »

  1.   

    start   with 有这种语法吗?
    关注.......
      

  2.   

    Query   q   =   sess.createSQLQuery(...)..
      

  3.   

    start   with 有这种语法吗? 
    关注.......
      

  4.   

    树状查询是oracle原生语法,hql是没有的,需要用原生SQL查询,
      

  5.   

    我最近遇到过hibernate+oracle查询时用junit工具测试时返回的list对象总为空是什么问题。
     String hql=from Otable from c;
    Query cc=sesson.cretequeary(hql);
    List list=cc.list();//list总是null,是什么原因,希望个位大家做个解释,谢谢