尝试执行此查询:
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