package com.njcn.pojo.user;

import com.njcn.sso.pojo.user.User;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * PQS_Role角色表。增加RoleType（角色类型）、User_Index （创建角色用户ID）、UpdateTime
 * （更新角色时间）、Role_Description（角色描述）、State(角色状态)。
 */
@Table(name = "PQS_ROLE")
public class Role {

	@Id
	@Column(name = "ROLE_INDEX")
	private String roleIndex;

	@Column(name = "ROLENAME")
	private String roleName;

	@Column(name = "USER_INDEX")
	private String userIndex;

	@Column(name = "UPDATETIME")
	private Date updateTime;

	@Column(name="STATE")
	private Integer state;

	@Transient
	private User uID;

	@Column(name = "ROLE_DESCRIPTION")
	private String roleDescription;

	public String getRoleIndex() {
		return roleIndex;
	}

	public void setRoleIndex(String roleIndex) {
		this.roleIndex = roleIndex;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getUserIndex() {
		return userIndex;
	}

	public void setUserIndex(String userIndex) {
		this.userIndex = userIndex;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public User getuID() {
		return uID;
	}

	public void setuID(User uID) {
		this.uID = uID;
	}

	public String getRoleDescription() {
		return roleDescription;
	}

	public void setRoleDescription(String roleDescription) {
		this.roleDescription = roleDescription;
	}

	@Override
	public String toString() {
		return "Role{" +
				"roleIndex='" + roleIndex + '\'' +
				", roleName='" + roleName + '\'' +
				", userIndex='" + userIndex + '\'' +
				", updateTime=" + updateTime +
				", state=" + state +
				", uID=" + uID +
				", roleDescription='" + roleDescription + '\'' +
				'}';
	}
}
