org.hibernate.hql.ast.QuerySyntaxException:, found '>' near line 1, column 39org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '>' near line 1, column 39 [from com.sqlt.model.Topic where count > 30 and subjectid=4 order by id]at org.
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 12:12:33
org.hibernate.hql.ast.QuerySyntaxException:, found '>' near line 1, column 39org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '>' near line 1, column 39 [from com.sqlt.model.Topic where count > 30 and subjectid=4 order by id]at org.
org.hibernate.hql.ast.QuerySyntaxException:, found '>' near line 1, column 39
org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '>' near line 1, column 39 [from com.sqlt.model.Topic where count > 30 and subjectid=4 order by id]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
at com.sqlt.dao.daoImp.TopicDAOImp.findTopicByFour(TopicDAOImp.java:127)
at com.sqlt.action.LoginAction.selectLiuyanInfoView(LoginAction.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
我的Dao类中的部分代码如下:public List findTopicByTwentyOne()
{
session=HibernateSessionFactory.getSession();
try{
ts=session.beginTransaction();
Query query=session.createQuery("from Topic where count>30 and subjectid=21 order by id");
List list=query.list();
ts.commit();
return list;
}catch(Exception e)
{
e.printStackTrace();
return null;
}
}
org.hibernate.hql.ast.QuerySyntaxException:, found '>' near line 1, column 39org.hibernate.hql.ast.QuerySyntaxException: expecting OPEN, found '>' near line 1, column 39 [from com.sqlt.model.Topic where count > 30 and subjectid=4 order by id]at org.
你先试试你的hql有没有问题,你这样弄会很麻烦的,首先你得确定你的hql没问题才行.你的myeclipse里面有个hql 编辑工具 ,你输入你的hql查询下.