package cn.com.liandisys.ycjt.ggcx.admin.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Type;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * 角色对象.
 * 
 * @author 袁晓冬
 */
@Entity
@Table(name = "T_SYS_ROLE")
@JsonTypeName(value = "RoleEntity")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class Role implements Serializable{
	
	private static final long serialVersionUID = 1L;

	/** 记录主键 */
	private String id;
	/** 角色是否可用 */
	private Boolean avaliable;
	/** 角色代码 */
	private String code;
	/** 角色描述 */
	private String description;
	/** 角色名称 */
	private String name;
	/** 排序号 */
	private Integer orderid;

	@Type(type = "yes_no")
	public Boolean getAvaliable() {
		return this.avaliable;
	}

	@Column(nullable = false)
	public String getCode() {
		return code;
	}

	public String getDescription() {
		return description;
	}

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name = "id", length = 32)
	public String getId() {
		return id;
	}
	
	public void setId(String id){
		this.id = id;
	}

	@Column(nullable = false)
	public String getName() {
		return name;
	}

	@Column(nullable = true)
	public Integer getOrderid() {
		return orderid;
	}

	public void setAvaliable(Boolean avaliable) {
		this.avaliable = avaliable;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public void setDescription(String description) {
		this.description = description;

	}
	
	public void setName(String name) {
		this.name = name;
	}

	public void setOrderid(Integer orderid) {
		this.orderid = orderid;
	}

	public String toString() {
		return "Role [id=" + getId() + ", name=" + name + ", code=" + code + ", avaliable=" + avaliable
				+ ", description=" + description + "]";
	}
}
