休眠 HQL 问题,期望 IDENT 发现“*”
我需要从相对表中获取所有数据,所以我使用这样的东西(我会在sql中使用它)
private static final String SELECT_OOPR_TO_SEND = "SELECT R.* " +
"FROM offerOrderProjectRel R, offerOrder O, project P " +
"WHERE P.id = R.project_id and O.id = R.offer_order_id " +
"and O.type = 'ORDER' and (P.status = 'PENDING' or P.status ='PROTECTED')" ;
;
@SuppressWarnings("unchecked")
public List<OfferOrderProjectRel> findAllOfferOrderToSendToSalesmans() {
Query q = getSession().createQuery(SELECT_OOPR_TO_SEND);
List<OfferOrderProjectRel> list = q.list();
return list;
}
在缓存此代码后,我收到该错误:
org.hibernate.hql.internal.ast.QuerySyntaxException: expecting IDENT, found '**' 靠近第 1 行, 列 10 [SELECT R.* FROM offerOrderProjectRel R, offerOrder O, project P WHERE P.id = R.project_id and O.id = R.offer_order_id,O.type = 'ORDER' 和 (P.status = 'PENDING' or P.status ='PROTECTED')]
那么如何从处于休眠状态的列R中获取所有数据呢?