package cn.com.capcloud.core.system.role;

import cn.com.capcloud.core.system.user.User;
import com.fasterxml.jackson.annotation.JsonBackReference;

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

/**
 * 角色实体类
 * @author zgsheng
 *
 */
@Entity
@Table(name="tbl_system_role")
public class Role {
	@Id
	@GeneratedValue
	private long roleId;
	/**角色名称*/
	private String roleName;
	/**角色状态*/
	
	private String roleStatus;
	private String roleTime;
	private String roleCreateUser;
	private String roleMemo;//角色描述
	private String createTime;
	private String roleCode;
	
	
	
	public String getRoleCode() {
		return roleCode;
	}
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getRoleMemo() {
		return roleMemo;
	}
	public void setRoleMemo(String roleMemo) {
		this.roleMemo = roleMemo;
	}
	
	
	@ManyToMany(cascade = CascadeType.ALL)
	@JoinTable(name = "tbl_system_roleuser",
			joinColumns = @JoinColumn(name = "role_id"),
			inverseJoinColumns = @JoinColumn(name = "user_id"))
	
	private List<User> users;

	public List<User> getUsers() {
		return users;
	}
	public void setUsers(List<User> users) {
		this.users = users;
	}
	public long getRoleId() {
		return roleId;
	}
	public void setRoleId(long roleId) {
		this.roleId = roleId;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public String getRoleStatus() {
		return roleStatus;
	}
	public void setRoleStatus(String roleStatus) {
		this.roleStatus = roleStatus;
	}
	public String getRoleTime() {
		return roleTime;
	}
	public void setRoleTime(String roleTime) {
		this.roleTime = roleTime;
	}
	public String getRoleCreateUser() {
		return roleCreateUser;
	}
	public void setRoleCreateUser(String roleCreateUser) {
		this.roleCreateUser = roleCreateUser;
	}
	 
	 

}
