Hibernate: select count(*) as col_0_0_ from profession profession0_ where profession0_.dept_no=?
Hibernate: select top 12 profession0_.profession_No as profession1_1_, profession0_.profession_name as profession2_1_, profession0_.dept_no as dept3_1_ from profession profession0_ where profession0_.dept_no=? order by profession0_.profession_No desc
2009-2-16 19:10:01 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet default threw exception
java.lang.NullPointerException
at org.hibernate.tuple.AbstractEntityTuplizer.createProxy(AbstractEntityTuplizer.java:372)
at org.hibernate.persister.entity.AbstractEntityPersister.createProxy(AbstractEntityPersister.java:3121)
at org.hibernate.event.def.DefaultLoadEventListener.createProxyIfNecessary(DefaultLoadEventListener.java:232)
at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:173)
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:862)
at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:830)
at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
at org.hibernate.type.EntityType.resolve(EntityType.java:303)
at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:116)
at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
at org.hibernate.loader.Loader.doQuery(Loader.java:717)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1106)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.top.daoHibernateImpl.HibernateGeneric.pagedQuery(HibernateGeneric.java:264)
Assert.hasText(hql);
Assert.isTrue(pageNo >= 1, "pageNo should start from 1");
// Count查询
String countQueryString = PageFactory.getTotalCountHqlByHql(hql);
List countlist = this.find(countQueryString, values);
int totalCount = ((Integer) countlist.get(0)).intValue();
if (totalCount < 1) return new Page();
// 实际查询返回分页对象
Query query = createQuery(hql, values);
int startIndex = PageFactory.getStartIndex(pageNo, pageSize);
List results = query.setFirstResult(startIndex).setMaxResults(pageSize)
.list();//本行报空指针
return PageFactory.createPage(pageNo, pageSize, totalCount, results);
[b]问题补充:[/b]
大家好本问题已经解决!~
我才本站其他贴上看到了同样的贴,再此也谢谢那位仁兄!~