Hibernate hql查询语法错误

时间:2018-01-28 14:11:10

标签: hibernate hql

尝试执行此查询:

public List<Product> getChildrenById(int id) {          
        String hql= " FROM Product"
                + " START WITH parent_id = ?"
            + " CONNECT BY NOCYCLE PRIOR  id = parent_id"
            + " ORDER SIBLINGS BY id"; 
        return (List<Product>) entityManager.createQuery(hql).setParameter(1, id).getResultList();
    }

我遇到语法错误:org.hibernate.hql.internal.ast.QuerySyntaxException:意外令牌:WITH靠近第1行,第44列[FROM com.example.gmao.model.Product START WITH parent_id =? CONNECT BY NOCYCLE PRIOR id = parent_id ORDER SIBLINGS BY id];

任何帮助? THX

0 个答案:

没有答案