Illegal overloaded getter method with ambiguous type for property
来源:互联网 发布:快手绝世的容颜淘宝店 编辑:程序博客网 时间:2024/06/14 01:57
Exception in thread "main" org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Illegal overloaded getter method with ambiguous type for property tradeType in class class com.honzh.biz.database.entity.OrderBase. This breaks the JavaBeans specification and can cause unpredicatble results.
解决办法:
以上问题是因为mybatis内部在进行Java反射的时候出现的问题,那么为什么会出现,因为Java会把Boolean类型的getter方法默认为is打头的或者是get打头的,如
public boolean isTradeType() {}public boolean getTradeType() {}以上两种方法,Java都会认为是bean的属性封装,那么在反射的时候,Java就不知道该get哪个tradeType了,如果解决呢,如果你的类中有
public Integer getTradeType() {return tradeType;}public boolean isTradeType() {if (StringUtils.isEmpty(getTradeType()) || (!isBuy() && isSale())) {return false;}return true;}类似以上的方法存在,那么就要注意了,把boolean 的isTradeType方法重命名一下,如换成typeOfTradeType这样就好了,Java在反射的时候就不会区分不清是什么属性。
0 0
- Illegal overloaded getter method with ambiguous type for property
- mybatis3---Illegal overloaded getter method with ambiguous type
- No getter method for property
- method is ambiguous for the type
- method is ambiguous for the type
- The method find(String, Object[]) is ambiguous for the type
- Struts报No getter method for property的问题!!!
- No getter method for property info of bean user 解决办法
- Struts程序中的No getter method for property错误问题
- No getter method for property * of bean * 解决办法
- "Illegal property type, c for appearance setter, _installAppearanceSwizzleForSetter:
- 错误:No getter method available for property XXX for bean under name XXXForm 的解决
- The method assertEquals(Object, Object) is ambiguous for the type Assert解决办法
- The method execute(Void[]) is ambiguous for the type new AsyncTask<Void,Void,Void>(){}
- java 调用方法引起歧义:The method XXX is ambiguous for the type XX
- The method iterator() is ambiguous for the type KafkaStream<byte[],byte[]>
- android The method execute(Void[]) is ambiguous for the type new AsyncTask<Void,Void,Void>(){}
- 编译错:The method createSqlQuery(String, List<Object>) is ambiguous for the type
- PAT1066(AVL)
- 杭电 HDU 1021 Fibonacci Again
- 点连通度与边连通度的求解
- 判断一个数字是否为回文数
- libcurl的简单使用
- Illegal overloaded getter method with ambiguous type for property
- 基于ngx_lua模块的waf开发实践
- 欢迎使用CSDN-markdown编辑器
- 概率论--随机事件及运算
- 一道淘汰85%面试者的百度开发者面试题
- ZOJ 2132 the most frequent number
- Windows下OpenLDAP的安装及使用(一)
- 仿微信/支付宝的密码输入框效果 android
- 训练深度神经网络的时候需要注意的一些小技巧