Mybatis 错误Illegal overloaded getter method ....

错误描述:

Illegal overloaded getter method with ambiguous type for property parent in
class class cn.domain.Menu.  This breaks the JavaBeans specification and
can cause unpredicatble results.

javabean:


public class Menu {
/** 菜单id */
private Integer id;
/** 是否作为一个父节点:父节点不需要URL,permission*/
private boolean isParent;
/** 菜单名称 */
private String name;
/** 菜单备注 */
private String remark;
/** 菜单URL */
private String href;
/** 菜单图标 */
private String icon;
/** 菜单需要的权限 */
private Permission permission;
/** 上级菜单:与href属性互斥 */
private Menu parent;

public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public boolean isParent() {
return isParent;
}
public void setParent(boolean isParent) {
this.isParent = isParent;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
public String getIcon() {
return icon;
}
public void setIcon(String icon) {
this.icon = icon;
}
public Permission getPermission() {
return permission;
}
public void setPermission(Permission permission) {
this.permission = permission;
}

public Menu getParent() {
return parent;
}
public void setParent(Menu parent) {
this.parent = parent;
}

}

注意isParent属性,boolean型在javabean规范中有特殊性:.....省略。。直接看isParent的get和set方法;

错误原因就是boolean型在javabean规范中有特殊性,改个名字就行了。

Mybatis 错误Illegal overloaded getter method ....,码迷,mamicode.com

时间: 2024-10-24 20:23:28

Mybatis 错误Illegal overloaded getter method ....的相关文章

Illegal overloaded getter method with ambiguous type for propert错误解决

前言:如题,当出现了 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

mybatis There is no getter for property named 'xx' in 'class java.lang.String

用mybatis查询时,传入一个字符串传参数,且进行判断时,会报 There is no getter for property named 'moduleCode' in 'class java.lang.String 错误写法: <select id="queryAllParentModule" resultType="jobModule" parameterType="jobModule"> select modulecode,

MyBatis错误:The server time zone value &#39;?泄???????&#39; is unrecognized or represents more t

原文地址:http://blog.csdn.net/oppo5630/article/details/52162783 解决java.sql.SQLException: The server time zone value ‘XXXXXX’ is unrecognized or represents more than one time zone. 1.报错截图 使用的数据库是MySQL,驱动是6.0.3,这是由于数据库和系统时区差异所造成的,在jdbc连接的url后面加上serverTimez

Android Studio 新手常见错误:Gradle DSL method not found: &amp;#39;runProguard()&amp;#39;

在Android Studio上执行Github上的某Android开源项目,提示报错: Error:(20, 0) Gradle DSL method not found: 'runProguard()' 请教度娘后.须要将app下的build.gradle文件里: buildTypes { release { runProguard false // 已经被废弃而且停止使用了 //...... } } 替换为例如以下就可以: buildTypes { release { minifyEnab

webView.loadUrl 错误:A WebView method was called on thread &#39;JavaBridge&#39;.

String voicePath="file://"+MVOICEPATH; webView.loadUrl("javascript:voiceStopCallback('"+voicePath+"')"); 日志错误提示: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread 解决办法 w

为什么svn提交更新时会出现错误:MKCOL of &#39;...&#39;: 405 Method Not Allowed

通常,这是因为服务器上已经有了同名的文件/文件夹,而本地又要添加新的文件/文件夹. 解决办法是把本地文件复制一份到别的地方(记得去除.svn文件夹),从服务器checkout命名冲突的部分,然后用把复制的部分再复制过来,最后再checkin. 为什么svn提交更新时会出现错误:MKCOL of '...': 405 Method Not Allowed

javax.servlet.jsp.JspException: No getter method for property

javax.servlet.jsp.JspException: No getter method for property getAvailableAddres sRequest.resellerId of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968) struts-config.xml: <form-beans> <

mybatis There is no getter for property named &#39;xxxx

mybatis There is no getter for property named 'xxxx 360反馈意见截图16230322799670.png http://blog.sina.com.cn/s/blog_8ced01900101blqd.html mybatis There is no getter for property named 'xxxx

JSON: property &quot;xxx&quot; has no getter method in class &quot;...&quot;

Exception in thread "main" net.sf.json.JSONException: java.lang.NoSuchMethodException: Property 'password' has no getter method 解决:声明bean为public class xxx,必须是public,我用默认类型(class xxx)都不行 郁闷了!!!