我收到以下异常:
HTTP Status 500 - Request processing failed;
nested exception is org.springframework.orm.hibernate3.HibernateQueryException: expecting OPEN, found '.' near line 1, column 35 [from in.bets.crm.model.User u1, in.bets.crm.model.User u2 where u1.manager is not null and u2.manager.id = u1.id];
nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '.' near line 1, column 35 [from in.bets.crm.model.User u1, in.bets.crm.model.User u2 where u1.manager is not null and u2.manager.id = u1.id]
我编写的查询如下:
users=hibernateTemplate.find("from User u1, User u2 where u1.manager is not null and u2.manager.id = u1.id");
请帮助解决此错误。 谢谢
答案 0 :(得分:0)
users = hibernateTemplate.find(“select u from User u inner join User m,其中u.manager不为null,u.manager.id = m.id”);