zoukankan      html  css  js  c++  java
  • 一个hql 关键字member(非mysql)引起的 vo 数据 保存数据库错误

    2015-03-19 14:16:29,285 ERROR [Thread-3] (DAOHelper.java:312) - updateByEntityPK:com.agileeagle.dao.webgame.entity.UnionInfo@16dc54d
    java.lang.ClassCastException: org.hibernate.hql.ast.tree.SqlNode cannot be cast to org.hibernate.hql.ast.tree.FromReferenceNode
     at org.hibernate.hql.ast.HqlSqlWalker.generateSyntheticDotNodeForNonQualifiedPropertyRef(HqlSqlWalker.java:495)
     at org.hibernate.hql.ast.HqlSqlWalker.lookupNonQualifiedProperty(HqlSqlWalker.java:488)
     at org.hibernate.hql.antlr.HqlSqlBaseWalker.propertyRef(HqlSqlBaseWalker.java:1102)
     at org.hibernate.hql.antlr.HqlSqlBaseWalker.assignment(HqlSqlBaseWalker.java:1008)
     at org.hibernate.hql.antlr.HqlSqlBaseWalker.setClause(HqlSqlBaseWalker.java:729)
     at org.hibernate.hql.antlr.HqlSqlBaseWalker.updateStatement(HqlSqlBaseWalker.java:349)
     at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:237)
     at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228)
     at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160)
     at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
     at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
     at org.hibernate.engine.query.HQLQueryPlan.<init>(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 org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:93)
     at sun.reflect.GeneratedMethodAccessor705.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
     at $Proxy22.createQuery(Unknown Source)
     at com.agileeagle.dao.core.support.HibernateBeanHelper.updateByPK(HibernateBeanHelper.java:294)
     at com.agileeagle.dao.core.DAOHelper.updateByEntityPK(DAOHelper.java:308)
     at com.agileeagle.webgame.game.service.imp.CacheService.updateEntityList(CacheService.java:60)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
     at $Proxy28.updateEntityList(Unknown Source)
     at com.agileeagle.webgame.game.service.imp.CacheStore.updateEntityList0(CacheStore.java:90)
     at com.agileeagle.webgame.game.service.imp.CacheStore.updateEntityList(CacheStore.java:120)
     at com.agileeagle.webgame.framework.cache.AbstractPersistCache.persist(AbstractPersistCache.java:432)
     at com.agileeagle.webgame.game.cache.imp.UnionCache.persist(UnionCache.java:515)
     at com.agileeagle.webgame.game.DebugGameServer$DebugThread.persist(DebugGameServer.java:150)
     at com.agileeagle.webgame.game.DebugGameServer$DebugThread.run(DebugGameServer.java:66)
    2015-03-19 14:16:29,296 ERROR [Thread-3] (CacheService.java:66) - BATCH UPDATE class com.agileeagle.dao.webgame.entity.UnionInfo SET:[{"build":1800,"dissolveSec":0,"leader":80001  。。。

    ---》 上边是三国军团对象保存数据库时发生的异常,经过不断的测试,原来是 hql 关键字异常,即我的军团中用到了 member 为成员属性,而member刚好是hql 中的关键字,所以保存出错出现异常了。在测试服过程中,原来是以为 是mysql 关键字异常,结果测试不是的,而是hql的关键字异常。

  • 相关阅读:
    inspector 只读属性
    使用MongoDB
    【Roslyn C#】Runtime环境Unity读取字符串代码
    Unity使用LoadImage 读取byte[]图片时,会出现白边问题
    团队中避免不可维护代码的措施
    Unity点到线段的最短距离
    判断点是否在多边形内部
    Unity 根据前后帧位置自动旋转
    停止Unity在运行时脚本修改重新编译的情况
    KI子线段树 / AKEE SegmentTree
  • 原文地址:https://www.cnblogs.com/wzhanke/p/4350323.html
Copyright © 2011-2022 走看看