- 浏览: 211036 次
- 性别:
- 来自: 哈尔滨
文章分类
- 全部博客 (267)
- java.lang (8)
- 问题汇总 (21)
- 异常记录 (20)
- 功能实现 (19)
- 面试总结 (25)
- 技巧总结 (8)
- 常用代码 (4)
- 编程习惯 (3)
- 编码规则 (3)
- java.util (10)
- java.io (1)
- JavaWeb (9)
- MySQL (16)
- SVN (3)
- MyBatis (11)
- Velocity (7)
- 其他知识 (10)
- 人生哲理 (1)
- 人生故事 (1)
- 自我感悟 (1)
- shiro (3)
- 基础知识 (0)
- 问题总结 (1)
- Spring 标签 (1)
- Spring (3)
- 点滴生活 (1)
- DOS (1)
- CAS (4)
- Linux (9)
- Storm (6)
- Shell (1)
- regex (1)
- Collection (4)
- poi (1)
- 经典语句 (1)
- NIO (5)
- concurrent (14)
- RPC (1)
- zookeeper (3)
- 待整理 (2)
- Hadoop (9)
- RabbitMq (2)
- flume (1)
- hive (7)
- hbase (4)
- kafka (1)
- scala (1)
- GC (0)
- java.util.concurrent.atomic (1)
- java.lang.ref (6)
- JVM (2)
- algorithm (1)
- conception (1)
- java key word (1)
- sun.misc (1)
最新评论
问题描述:
单元测试一个已离职同事的接口,运行时提示 po 类中的某个属性字段的映射找不到
问题分析:
根据描述的异常信息,在类中找到了该属性,set get 均有,mapper.xml 中映射也存在
检查代码版本,历史版本生产环境运行正常,于是对比此次新增的代码
定位到了问题所在,
po 类中 描述用户类型的字段,用的 isXXX
po 类中 又定义了常量 IsXXX 与 属性字段仅仅首字母不同
所以,Mapper.xml 中的文件在做映射处理时,首先映射的是常量的定义的字段,而该字段又没有SET GET ,因而报错
问题总结:
1.常量不要写在PO类中,而要单独写在 constant 类中
2.Boolean 类型的属性,不要以 is开头
单元测试一个已离职同事的接口,运行时提示 po 类中的某个属性字段的映射找不到
问题分析:
根据描述的异常信息,在类中找到了该属性,set get 均有,mapper.xml 中映射也存在
检查代码版本,历史版本生产环境运行正常,于是对比此次新增的代码
定位到了问题所在,
po 类中 描述用户类型的字段,用的 isXXX
po 类中 又定义了常量 IsXXX 与 属性字段仅仅首字母不同
所以,Mapper.xml 中的文件在做映射处理时,首先映射的是常量的定义的字段,而该字段又没有SET GET ,因而报错
问题总结:
1.常量不要写在PO类中,而要单独写在 constant 类中
2.Boolean 类型的属性,不要以 is开头
发表评论
-
Publishing failed with multiple errors file not found
2017-11-10 22:39 884问题场景: Java Web项目 ... -
attempted to return null from a method with a primitive return type (int)
2017-10-25 22:52 3202异常背景 mybatis mapper.xml 中 resul ... -
java.lang.UnsupportedOperationException
2017-10-24 21:42 370异常背景: 遍历集合进行元素删除操作 异常描述: Str ... -
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '
2017-10-02 18:33 643问题场景: 启动 Tomcat 时报错,org.spring ... -
为什么运行接口无返回值
2017-10-02 18:08 787问题场景: 与同事共同开发一个项目,调用其开发的接口,未接收 ... -
java.lang.OutOfMemoryError: Java heap space
2017-10-02 18:02 444问题描述: 新来的同事,安装JDK、Eclipse 、Tom ... -
No result defined for action
2017-09-26 21:56 591问题场景: 项目设计模式:SpringMVC 调试程序过程中 ... -
attempted to return null from a method with a primitive return type (double)
2017-09-26 21:58 1536问题场景: 服务启动正常,MyBatis Interface ... -
No matching bean of type dao found for depende
2017-09-26 21:46 861问题场景: 项目设计模式:Spring MVC + MyBat ... -
1030 Got error 28 from storage engine
2016-05-24 22:25 1321现象:调试程序过程中,突然报错,显示数据检索失败,数据库连接超 ... -
org.apache.shiro.session.UnknownSessionException
2015-06-27 18:19 3933问题说明: 背景:系 ... -
java Excel poi exception
2015-06-11 16:41 686一、 问题:java导出Exce ... -
The reference to entity "locale" must end with the ';' delimiter.
2015-06-02 15:12 1826问题: 修改web.xml 文件中的拦击器中的URL后 报错T ... -
xxxList not found
2015-05-20 08:51 678问题:MyBatis接口中以list作为参数类型,在mappe ... -
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2 JD
2015-05-17 16:39 608问题:运行单元测试类(比较重载与重写的区别)时报错, ERRO ... -
Result Maps collection already contains value for mapper.XXX
2015-05-14 08:53 2129问题:运行单元测试类时报错 原因:应该用resultMap来 ... -
Unable to find resource
2015-05-13 20:32 741场景: 配合JS调试时,出现上面的异常,且数据可以正常接收,程 ... -
target is null for setProperty
2015-05-13 15:00 733问题:ognl.OgnlException: target i ... -
常用mapper方法
2015-05-11 19:49 7051.insert,表中有时间字段,且字段值为当前时间,可以在m ... -
确认方法没有错误,但查询结果不正确
2015-05-07 09:37 864问题:在调试某web工程时,发现一个po.getXXX()没有 ...
相关推荐
将Xcode适配可以调试、编译、运行、打包系统版本号为iOS 13.3 版本的设备,解决"Could not find Developer Disk Image"问题 使用详情 请前往https://blog.csdn.net/u010731949/article/details/52576792
system32 directory to find a XXX.TORO file. XXXX is DeveloperID in hex format. i attached an example of such file(A870.TORO). this is for emulation of wlscgen.exe from sentinellm 7.3.0. the ...
This file contains a summary of what you will find in each of the files that make up your can_mfc application. can_mfc.h This is the main header file for the application. It includes other project ...
I was born and raised in the beautiful city of xxxxxxxxx. Upon graduating from xxxxxxxx High School, majoring in Urban Construction, I developed a strong passion for English. I embarked on this ...
1. **Channel definition, mx.messaging.channels.RTMPChannel, can not be found...** 这个错误通常出现在FluorineFX中,表示找不到RTMP通道定义。解决方法是在services-config.xml中确认是否正确配置了RTMP ...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
On these pages you can find many other useful components too. Q: Have you also created a similar formatter for C++, Java or Visual Basic? A: No, I am sorry, I have only created one for Delphi. ...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC40XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the...
TSQLDataDriverEh can not transfer queries to the server but it call global (for application) event which it is necessary to write to execute SQL expressions on the server. TBDEDataDriverEh, ...
# $(call find-copy-subdir-files,*,device/softwinner/polaris-common/rild/usb_modeswitch.d,system/etc/usb_modeswitch.d) PRODUCT_PROPERTY_OVERRIDES += \ ro.sw.embeded.telephony = false PRODUCT_...
1) execute "tar xvfz tse.XXX.gz" --------------------------- Before running the program, note Note: The program is default for normal crawling (SE). For ImgSE, you should: 1. change codes with the...
Table of Contents Summary of gdb . . . . . . . . ....Free Software ....Free Software Needs Free Documentation ....Contributors to gdb....1 A Sample gdb Session ....2 Getting In and Out of gdb ....2.1 Invoking gdb ....
will need to copy the corresponding localized resources MFC42XXX.DLL from the Microsoft Visual C++ CD-ROM onto the system or system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the ...