[code="java"]
public List initPermission(int postId) {
Session session=sessionFactory.getCurrentSession();
String hql="select f.* from FuncInfo f,Post p,FunPost fp where fp.postId=? and fp.funcInfoId=f.functionId";
Query query=session.createQuery(hql);
query.setInteger(0, postId);
List<FuncInfo> lists=(List<FuncInfo>)query.list();
return lists;
}
[/code]
这是方法,但是却报如下异常:
[code="java"]
15:33:07,640 DEBUG JDBCTransaction:163 - rolled back JDBC Connection
org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '*' near line 1, column 10 [select f.* from com.itsp.funcinfo.dao.model.FuncInfo f,com.itsp.userinfo.dao.model.Post p,com.itsp.userinfo.dao.model.FunPost fp where fp.postId=? and fp.funcInfoId=f.functionId]
15:33:07,531 DEBUG JDBCTransaction:54 - begin
15:33:07,531 DEBUG JDBCTransaction:59 - current autocommit status: true
15:33:07,531 DEBUG JDBCTransaction:62 - disabling autocommit
15:33:07,593 ERROR PARSER:33 - line 1:10: expecting IDENT, found '*'
15:33:07,625 DEBUG JDBCTransaction:152 - rollback
15:33:07,625 DEBUG JDBCTransaction:193 - re-enabling autocommit
15:33:07,640 DEBUG JDBCTransaction:163 - rolled back JDBC Connection
[/code]
提示hql语句语法错误,希望大家指教,非常感谢!!!