码迷,mamicode.com
首页 > 其他好文 > 详细

Mybatis 错误Illegal overloaded getter method ....

时间:2014-04-30 15:24:40      阅读:6857      评论:0      收藏:0      [点我收藏+]

标签:com   http   blog   style   class   div   img   code   java   log   c   

错误描述:

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:

mamicode.com,码迷
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;
    }



}
mamicode.com,码迷

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

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

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

Mybatis 错误Illegal overloaded getter method ....

标签:com   http   blog   style   class   div   img   code   java   log   c   

原文地址:http://www.cnblogs.com/moqi2013/p/3699572.html

(0)
(1)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!