I execute:
Code:
Query query = session.createQuery("from MerchantPvStats stats");
query.setFirstResult(pageNumber * pageSize);
query.setMaxResults(pageSize);
return query.list();
And get exception:
net.sf.hibernate.QueryException: in expected: stats [from MerchantPvStats stats]
at net.sf.hibernate.hql.FromParser.token(FromParser.java:102)
at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:142)
at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:293)
at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1493)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1464)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at paging.HibernatePagingStrategy.getPage(HibernatePagingStrategy.java:28)
at paging.Main.measurePerformance(Main.java:56)
at paging.Main.run(Main.java:29)
at paging.Main.main(Main.java:24)
Could you explain me what's wrong.
Thanks in advance.