could not find a getter for ... in class ... 异常的解决2007年08月31日 星期五 11:26在spring+hibernate框架的java项目开发过程中,经常会遇到这样的错误:
could not find a getter for ... in class ...
可能原因如下:
1.真的没有写getter方法(发生几率:1%)
2.*.hmb.xml文件中的属性名和pojo不一致(*.hbm.xml和*.java没衔接好,不一致),字段属性没有正确配置,比如,
*.hmb.xml中*.java的地址要明确(明确指出引用包的完整路径);映射错误;有多个主键时,对生成的联合主键配置错误;拼写错误(包括多空
格)等(发生几率:48%)
3.方法写错/方法名写错,要按照javabean的书写规范写啊,要不然打死也找不到哪儿错了(发生几率:50%)
这里提一下:get/set是不是不允许方法名中有连续两个大写字母,例如
public String getODPType(){
return this.oDPType;
}
public void setODPType(String oDPType){
this.oDPType = oDPType;
}
这样写它就会报错,报找不到getter for oDPType的错误,但下面这样写就可以了
public String odpType;
public String getOdpType(){
return this.odpType;
}
public void setOdpType(String odpType){
this.odpType = odpType;
}
4.其他不明原因(发生几率:1%)
分享到:
相关推荐
今天小编就为大家分享一篇关于Mybatis单个参数的if判断报异常There is no getter for property named 'xxx' in 'class java.lang.Integer'的解决方案,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,...
功能:批量生成属性的懒加载 getter 应用场景 :手写ui代码可以批量生成 github地址:https://github.com/hackxhj/getterMake-Xcode
m3u8文件批量下载,支持m3u8 url和下载到本地的m3u8文件,支持批量下载和多线程下载。 更新: 1.0.1 去掉其他格式支持,仅支持mp4格式的转换;优化正确处理某些m3u8中的key文件经过Base64处理过的视频;...
资源来自pypi官网。 资源全名:getty-getter-0.0a.tar.gz
The plug-in of Jmockdata what through random algorithm mock java data. Jmockdata插件通过随机算法模拟Java数据. 版本信息 Jmockdata-2.0 发布时间 2017-02-03 Jmockdata-1.0 发布时间 2017-01-04 具体...
资源来自pypi官网。 资源全名:easy-module-attribute-getter-0.9.37.tar.gz
Written for programmers with a background in high-level language programming, C# 6 for Programmers applies the Deitel signature live-code approach to teaching programming and explores Microsoft’s C# ...
nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'error_view' of bean class [com.demo.controller.action.AuthorAction]: Bean property 'error_view' is not ...
开源项目-joewalnes-go-getter.zip,go-getter: Like go get, but different
spring-service-getter-source.jar
这是Nicolas Ricquemaque的Ogg.class.php的继续,而后者又是David Grant的File_Ogg的... 注意:此项目将__not__帮助您将媒体文件转换为Ogg或将多个Ogg流一起多路复用。 它______将帮助您获取有关已转换文件的正确信息。
Available options (for this frontend in Zend_Cache factory) 4.3.6.3. Examples 4.4. Zend_Cache后端 4.4.1. Zend_Cache_Backend_File 4.4.2. Zend_Cache_Backend_Sqlite 4.4.3. Zend_Cache_Backend_...
}else{alert("Not Ok");} 78.JS中的窗口重定向:window.navigate("";); 79.JS中的打印:window.print() 80.JS中的提示输入框:window.prompt("message","defaultReply"); 81.JS中的窗口滚动条:window.scroll(x,y) 82.JS...
【IT十八掌徐培成】Java基础第25天-03.递归获取所有超类-内省获取所有属性-getter-setter.zip
The Person class should have a setter method and a getter method with public access for each attribute. In the setter methods, get rid of any leading or trailing spaces (String trim() method). For...
借助Spring获取所有带有指定注解的接口、类、对象
signs_getter_setter 标记常量,然后使用Getter-Setter ...
ES6 类(Class)的继承(extends)和自定义存(setter)取值(getter)详解,博客地址: http://blog.csdn.net/pcaxb/article/details/53784309
第二十五课 getter 设置学习目录getter 设置介绍与用法一.getter 设置介绍与用法Vuex 允许我们在 store 中定义 getter,就像计