renliangxa 发表于 2018-9-27 09:56:03

JEECG查询出现灵异事件org.hibernate.QueryException

执行查询时偶尔出现 org.hibernate.QueryException: : planBeginTime of: com.demo.entity.StudentEntity,查看代码StudentEntity中并没有planBeginTime这个属性,student表中也没有planBeginTime这样的字段,后来发现这个字段是另一个Entity的,什么鬼杂交了?我靠!


renliangxa 发表于 2018-9-27 10:06:19

来个异常日志吧!代码是代码生成器生成的……
org.hibernate.QueryException: could not resolve property: planBeginTime of: com.demo.entity.StudentEntity
        at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:83)
        at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:77)
        at org.hibernate.persister.entity.AbstractEntityPersister.getSubclassPropertyTableNumber(AbstractEntityPersister.java:1832)
        at org.hibernate.persister.entity.BasicEntityPropertyMapping.toColumns(BasicEntityPropertyMapping.java:61)
        at org.hibernate.persister.entity.AbstractEntityPersister.toColumns(AbstractEntityPersister.java:1807)
        at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumns(CriteriaQueryTranslator.java:522)
        at org.hibernate.loader.criteria.CriteriaQueryTranslator.getColumnsUsingProjection(CriteriaQueryTranslator.java:482)
        at org.hibernate.criterion.Order.toSqlString(Order.java:67)
        at org.hibernate.loader.criteria.CriteriaQueryTranslator.getOrderBy(CriteriaQueryTranslator.java:433)
        at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:123)
        at org.hibernate.loader.criteria.CriteriaJoinWalker.<init>(CriteriaJoinWalker.java:92)
        at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:93)
        at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1516)
        at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:374)
        at org.jeecgframework.core.common.dao.impl.GenericBaseCommonDao.getDataGridReturn(GenericBaseCommonDao.java:729)
        at org.jeecgframework.core.common.service.impl.CommonServiceImpl.getDataGridReturn(CommonServiceImpl.java:249)
        at com.demo.service.impl.StudentServiceImpl.getPageDataGridReturn(StudentServiceImpl.java:190)

admin 发表于 2018-9-27 11:54:37

hibernate实体之家有映射?

renliangxa 发表于 2018-9-27 14:11:08

admin 发表于 2018-9-27 11:54 static/image/common/back.gif
hibernate实体之家有映射?

没有,都是独立的Entity,问题是这种异常时在看后台日志时同一个分页查询偶尔出现这样的异常,仔细跟日志发现有多个getPageDataGridReturn出现Entity属性串了的情况,怀疑是不是并发访问量上去以后出现CQ组装Hibernate查询时出现了问题。

admin 发表于 2018-9-27 18:01:54

自己本机测试有没有这问题
页: [1]
查看完整版本: JEECG查询出现灵异事件org.hibernate.QueryException