package com.rndchina.aisin.system.modle;

import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

/**
 * 平台模块
 */
@Entity
@Table(name = "sp_plat_module")
public class PlatModule implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * 模块id
	 */
	private String id;
	/**x
	 * 创建时间
	 */
	private Date createTime;
	/**
	 * 更新时间
	 */
	private Date updateTime;
	/**
	 * 更新次数
	 */
	private Integer version;
	/**
	 * 中文名称
	 */
	private String chinese;
	/**
	 * 是否显示
	 */
	private String display;
	/**
	 * 英文名称
	 */
	private String english;
	/**
	 * 排序
	 */
	private Integer orderNum;
	/**
	 * 链接地址
	 */
	private String url;
	/**
	 * 数据所有者名称
	 */
	private Integer ownerUserId;
	/**
	 * 是否启用、停用
	 */
	private String enable;
	/**
	 * 父模块
	 */
	private PlatModule parentPlatModule;
	/**
	 * 孩子模块列表
	 */
	private List<PlatModule> platModuleChild;
	/**
	 * 逻辑删除 0正存  1 删除
	 */
	private String deleted = "0";

	// Constructors

//	private List<Command> commands = new ArrayList<Command>();

	/** default constructor */
	public PlatModule() {
	}

	// Property accessors
	@Id
	@Column(name = "id", length = 64)
	public String getId() {
		return this.id;
	}

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

	@Column(name = "createTime", length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "updateTime", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

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

	@Column(name = "version")
	public Integer getVersion() {
		return this.version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "chinese")
	public String getChinese() {
		return this.chinese;
	}

	public void setChinese(String chinese) {
		this.chinese = chinese;
	}

	@Column(name = "display")
	public String getDisplay() {
		return this.display;
	}

	public void setDisplay(String display) {
		this.display = display;
	}

	@Column(name = "english")
	public String getEnglish() {
		return this.english;
	}

	public void setEnglish(String english) {
		this.english = english;
	}

	@Column(name = "orderNum", nullable = false)
	public Integer getOrderNum() {
		return this.orderNum;
	}

	public void setOrderNum(Integer orderNum) {
		this.orderNum = orderNum;
	}

	@Column(name = "url")
	public String getUrl() {
		return this.url;
	}

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

	@Column(name = "ownerUser_id")
	public Integer getOwnerUserId() {
		return this.ownerUserId;
	}

	public void setOwnerUserId(Integer ownerUserId) {
		this.ownerUserId = ownerUserId;
	}
	
	 

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	@ManyToOne
	public PlatModule getParentPlatModule() {
		return parentPlatModule;
	}

	public void setParentPlatModule(PlatModule parentPlatModule) {
		this.parentPlatModule = parentPlatModule;
	}

	@OneToMany(cascade = CascadeType.REFRESH, fetch = FetchType.EAGER, mappedBy = "parentPlatModule")
	@OrderBy("orderNum")
	public List<PlatModule> getPlatModuleChild() {
		return platModuleChild;
	}

	public void setPlatModuleChild(List<PlatModule> platModuleChild) {
		this.platModuleChild = platModuleChild;
	}

	public String getEnable() {
		return enable;
	}
	
	public void setEnable(String enable) {
		this.enable = enable;
	}

	public String getDeleted() {
		return deleted;
	}

	public void setDeleted(String deleted) {
		this.deleted = deleted;
	}

}