package com.ssm.manage.entity;

import java.io.Serializable;
import javax.persistence.*;

@Table(name = "sys_menu")
public class SysMenu implements Serializable {
    /**
     * 菜单编码
     */
    @Id
    @Column(name = "menu_id")
    private String menuId;

    /**
     * 菜单名称
     */
    @Column(name = "menu_name")
    private String menuName;

    /**
     * 上级菜单编码
     */
    @Column(name = "upper_menu_id")
    private String upperMenuId;

    /**
     * 上级菜单名称
     */
    @Column(name = "upper_menu_name")
    private String upperMenuName;

    private static final long serialVersionUID = 1L;

    /**
     * 获取菜单编码
     *
     * @return menu_id - 菜单编码
     */
    public String getMenuId() {
        return menuId;
    }

    /**
     * 设置菜单编码
     *
     * @param menuId 菜单编码
     */
    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    /**
     * 获取菜单名称
     *
     * @return menu_name - 菜单名称
     */
    public String getMenuName() {
        return menuName;
    }

    /**
     * 设置菜单名称
     *
     * @param menuName 菜单名称
     */
    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    /**
     * 获取上级菜单编码
     *
     * @return upper_menu_id - 上级菜单编码
     */
    public String getUpperMenuId() {
        return upperMenuId;
    }

    /**
     * 设置上级菜单编码
     *
     * @param upperMenuId 上级菜单编码
     */
    public void setUpperMenuId(String upperMenuId) {
        this.upperMenuId = upperMenuId;
    }

    /**
     * 获取上级菜单名称
     *
     * @return upper_menu_name - 上级菜单名称
     */
    public String getUpperMenuName() {
        return upperMenuName;
    }

    /**
     * 设置上级菜单名称
     *
     * @param upperMenuName 上级菜单名称
     */
    public void setUpperMenuName(String upperMenuName) {
        this.upperMenuName = upperMenuName;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SysMenu other = (SysMenu) that;
        return (this.getMenuId() == null ? other.getMenuId() == null : this.getMenuId().equals(other.getMenuId()))
            && (this.getMenuName() == null ? other.getMenuName() == null : this.getMenuName().equals(other.getMenuName()))
            && (this.getUpperMenuId() == null ? other.getUpperMenuId() == null : this.getUpperMenuId().equals(other.getUpperMenuId()))
            && (this.getUpperMenuName() == null ? other.getUpperMenuName() == null : this.getUpperMenuName().equals(other.getUpperMenuName()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMenuId() == null) ? 0 : getMenuId().hashCode());
        result = prime * result + ((getMenuName() == null) ? 0 : getMenuName().hashCode());
        result = prime * result + ((getUpperMenuId() == null) ? 0 : getUpperMenuId().hashCode());
        result = prime * result + ((getUpperMenuName() == null) ? 0 : getUpperMenuName().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", menuId=").append(menuId);
        sb.append(", menuName=").append(menuName);
        sb.append(", upperMenuId=").append(upperMenuId);
        sb.append(", upperMenuName=").append(upperMenuName);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}