package com.qxueyou.scc.sys.model; import java.io.Serializable; import java.util.*; import javax.persistence.*; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.NamedQuery; import javax.persistence.Table; import org.hibernate.annotations.*; import org.hibernate.annotations.Cache; import org.springframework.format.annotation.DateTimeFormat; import com.fasterxml.jackson.annotation.JsonIgnore; import com.qxueyou.scc.user.model.UserRole; /** * The persistent class for the sys_menu database table. * */ @Entity @Table(name = "sys_menu") @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @NamedQuery(name = "SysMenu.findAll", query = "SELECT s FROM SysMenu s") public class SysMenu implements Serializable { private static final long serialVersionUID = 1L; @Id @GeneratedValue(generator = "hibernate-uuid") @GenericGenerator(name = "hibernate-uuid", strategy = "uuid") @Column(name = "MENU_ID", unique = true, nullable = false, length = 32) private String menuId; @Column(name = "URL", length = 255) private String url; @Column(name = "ICON_URL", length = 255) private String iconUrl; @Column(name = "NAME", length = 128) private String name; @Column(name = "FULL_PATH", length = 255) private String fullPath; @Column(name = "PARENT_MENU_ID") private String parentMenuId; @Column(name = "DIR") private boolean dir; @Column(name = "hover") private String hover; @Column(name = "icon") private String icon; @Column(name = "LEVEL") private int level; @Column(name = "MENU_ORDER") private int menuOrder; @Column(name = "OPEN_TYPE") private int openType; @Column(name = "CREATE_ID", nullable = false, length = 32) private String createId; @Column(name = "CREATE_TIME", nullable = false) @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; @Column(name = "CREATOR", nullable = false, length = 100) private String creator; @Column(name = "DELETE_FLAG", nullable = false) private boolean deleteFlag; @Column(name = "UPDATE_ID", length = 32) private String updateId; @Column(name = "UPDATE_TIME", nullable = false) @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; @Column(name = "UPDATOR", length = 100) private String updator; @ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL) @JoinTable(name = "SYS_PRIVILEGE", joinColumns = { @JoinColumn(name = "MENU_ID") }, inverseJoinColumns = { @JoinColumn(name = "ROLE_ID") }) @GeneratedValue(generator = "hibernate-uuid1") @GenericGenerator(name = "hibernate-uuid1", strategy = "uuid") @CollectionId(columns = @Column(name = "PRIVILEGE_ID"), type = @Type(type = "string"), generator = "hibernate-uuid1") @JsonIgnore private List roles; @ManyToOne(cascade = { CascadeType.ALL }) @JoinColumn(name = "PARENT_MENU_ID", referencedColumnName = "MENU_ID", updatable = false, insertable = false) @JsonIgnore private SysMenu parent; @OneToMany(mappedBy = "parent") @JsonIgnore private List children=new ArrayList<>(); @Transient private Set childrenList = new HashSet<>(); public Set getChildrenList() { return childrenList; } public void setChildrenList(Set childrenList) { this.childrenList = childrenList; } public void setOpenType(int openType) { this.openType = openType; } public boolean isDir() { return dir; } public void setDir(boolean dir) { this.dir = dir; } public int getLevel() { return level; } public void setLevel(int level) { this.level = level; } public int getMenuOrder() { return menuOrder; } public void setMenuOrder(int menuOrder) { this.menuOrder = menuOrder; } public SysMenu getParent() { return parent; } public void setParent(SysMenu parent) { this.parent = parent; } public List getChildren() { return children; } public void setChildren(List children) { this.children = children; } public List getRoles() { return roles; } public void setRoles(List roles) { this.roles = roles; } public String getMenuId() { return this.menuId; } public void setMenuId(String menuId) { this.menuId = menuId; } public String getCreateId() { return this.createId; } public void setCreateId(String createId) { this.createId = createId; } public Date getCreateTime() { return this.createTime; } public void setCreateTime(Date createTime) { this.createTime = createTime; } public String getCreator() { return this.creator; } public void setCreator(String creator) { this.creator = creator; } public boolean getDeleteFlag() { return this.deleteFlag; } public void setDeleteFlag(boolean deleteFlag) { this.deleteFlag = deleteFlag; } public String getFullPath() { return this.fullPath; } public void setFullPath(String fullPath) { this.fullPath = fullPath; } public String getIconUrl() { return this.iconUrl; } public void setIconUrl(String iconUrl) { this.iconUrl = iconUrl; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getUpdateId() { return this.updateId; } public void setUpdateId(String updateId) { this.updateId = updateId; } public Date getUpdateTime() { return this.updateTime; } public void setUpdateTime(Date updateTime) { this.updateTime = updateTime; } public String getUpdator() { return this.updator; } public void setUpdator(String updator) { this.updator = updator; } public String getUrl() { return this.url; } public void setUrl(String url) { this.url = url; } public String getParentMenuId() { return parentMenuId; } public void setParentMenuId(String parentMenuId) { this.parentMenuId = parentMenuId; } }