There is no getter for property named 'DEPARTMENT_ID' in 'class com.sccy.hr.model.RewardsPunishment'

出现这种状况一般是:

错误:

<if test="departmentId != null" >
        #{DEPARTMENT_ID,jdbcType=VARCHAR},

  </if>

正确:

<if test="departmentId != null" >
        #{departmentId,jdbcType=VARCHAR},

     </if>

写成DEPARTMENT_ID mybase会去找他的get方法,没有找不到报的错


mybatis 报错 There is no getter for property named 'xxx' in 'xxx'

04-12

[code=text]Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'is_partner' in 'class com.xfj.base.bossapp.domain.SellerAgent'rn at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:333)rn at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:160)rn at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:151)rn at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:44)rn at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:123)rn at org.apache.ibatis.builder.xml.dynamic.DynamicContext$ContextMap.get(DynamicContext.java:89)rn at org.apache.ibatis.builder.xml.dynamic.DynamicContext$ContextAccessor.getProperty(DynamicContext.java:107)rn at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1657)rn at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:92)rn at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)rn at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)rn at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:49)rn at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)rn at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:210)rn at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:333)rn at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:413)rn at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:395)rn at org.apache.ibatis.builder.xml.dynamic.OgnlCache.getValue(OgnlCache.java:42)rn at org.apache.ibatis.builder.xml.dynamic.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:32)rn at org.apache.ibatis.builder.xml.dynamic.IfSqlNode.apply(IfSqlNode.java:30)rn at org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:29)rn at org.apache.ibatis.builder.xml.dynamic.TrimSqlNode.apply(TrimSqlNode.java:42)rn at org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:29)rn at org.apache.ibatis.builder.xml.dynamic.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:37)rn at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:241)rn at org.apache.ibatis.executor.statement.BaseStatementHandler.(BaseStatementHandler.java:61)rn at org.apache.ibatis.executor.statement.PreparedStatementHandler.(PreparedStatementHandler.java:36)rn at org.apache.ibatis.executor.statement.RoutingStatementHandler.(RoutingStatementHandler.java:42)rn at org.apache.ibatis.session.Configuration.newStatementHandler(Configuration.java:348)rn at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:43)rn at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)rn at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:355)rn ... 176 more[/code]rnrn找了好久都找不到什么问题,用的方法是用工具生成的update方法

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试