package com.huimv.admin.domain.primary;

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

@Entity
@Table(name = "sys_menu")
public class SysMenuEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private Integer id;

    @Column(name = "menu_name")
    private String menuName;

    @Column(name = "url")
    private String url;

    @Column(name = "remark")
    private String remark;

    @Column(name = "parent_id", nullable = false)
    private Integer parentId;

    @Column(name = "sort")
    private Integer sort;

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrl() {
        return url;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Integer getSort() {
        return sort;
    }

    @Transient
    private List<SysMenuEntity> children;

    public List<SysMenuEntity> getChildren() {
        return children;
    }

    public void setChildren(List<SysMenuEntity> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "SysMenuEntity{" +
                "id=" + id + '\'' +
                "menuName=" + menuName + '\'' +
                "url=" + url + '\'' +
                "remark=" + remark + '\'' +
                "parentId=" + parentId + '\'' +
                "sort=" + sort + '\'' +
                '}';
    }
}
