zoukankan      html  css  js  c++  java
  • There is no getter for property named 'useName' in 'class cn.itcast.mybatis.pojo.User'

    org.apache.ibatis.exceptions.PersistenceException:
    ### Error updating database.  Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'useName' in 'class cn.itcast.mybatis.pojo.User'
    ### The error may involve defaultParameterMap
    ### The error occurred while setting parameters
    ### SQL: UPDATE tb_user  SET    user_name = ?,   password = ?,   name = ?,   age = ?,   sex = ?,   birthday = ?,   created = NOW(),   updated = NOW()  WHERE  id = ?;
    ### Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'useName' in 'class cn.itcast.mybatis.pojo.User'
        at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:154)
        at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:54)
        at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
        at com.sun.proxy.$Proxy3.updatedUser(Unknown Source)
        at cn.itcast.mybatis.mapper.UserMapperTest.testUpdatedUser(UserMapperTest.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'useName' in 'class cn.itcast.mybatis.pojo.User'
        at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:380)
        at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:170)
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:152)
        at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:48)
        at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:116)
        at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:76)
        at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:80)
        at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:61)
        at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:74)
        at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47)
        at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105)
        at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:71)
        at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152)
        ... 28 more
    SQL中的  userName写成了useName  与实体类属性对不上

  • 相关阅读:
    Global.asax的Application_BeginRequest实现url重写无后缀的代码
    Windows 2008驱动安装失败的原因及解决方法
    解决win8.1电脑无法安装手机驱动问题
    适用于Win8的Office2003_SP3精简版集成各类补丁+兼容包
    CSS 文本缩进,行间距
    自动换行后缩进怎么做(CSS)?(可用于 Li y 元素的排版)
    ApkTool反编译和重新打包
    sql server 2005 32位+64位、企业版+标准版、CD+DVD 下载地址大全
    【Lua】Lua中__index与元表(转)
    【VS2012】项目文件夹管理
  • 原文地址:https://www.cnblogs.com/javaxs/p/6009052.html
Copyright © 2011-2022 走看看