首页 > 代码库 > Mybatis 错误Illegal overloaded getter method ....
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 =http://www.mamicode.com/ 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规范中有特殊性,改个名字就行了。
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。