package com.uas.platform.b2b.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 审批流设置
 * 
 * @author hejq
 * @time 创建时间：2017年3月6日
 */
@Entity
@Table(name = "office$approvalflow")
public class ApprovalFlow implements Serializable {

	/**
	 * 序列
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "app_id")
	private Long id;

	/**
	 * 企业uu
	 */
	@Column(name = "app_enuu")
	private Long enuu;

	/**
	 * 企业名称
	 */
	@Column(name = "app_enname")
	private String enname;

	/**
	 * 设置人uu
	 */
	@Column(name = "app_useruu")
	private Long useruu;

	/**
	 * 姓名
	 */
	@Column(name = "app_username")
	private String username;

	/**
	 * 审批流名称
	 */
	@Column(name = "app_appname")
	private String appname;

	/**
	 * 审批流节点
	 */
	@OneToMany(mappedBy = "approvalflow", cascade = { CascadeType.REFRESH, CascadeType.PERSIST, CascadeType.REMOVE,
			CascadeType.MERGE }, fetch = FetchType.EAGER)
	@OrderBy("nodelev")
	private Set<FlowNode> flowNodes;

	/**
	 * 是否有条件<br>
	 * 1. 是<br>
	 * 0. 否
	 * 
	 */
	@Column(name = "app_iscondition")
	private Short iscondition;

	/**
	 * 审批流标识
	 */
	@Column(name = "app_caller")
	private String caller;

	/**
	 * 更新时间
	 */
	@Column(name = "app_date")
	private Date date;

	public Long getId() {
		return id;
	}

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

	public Long getEnuu() {
		return enuu;
	}

	public void setEnuu(Long enuu) {
		this.enuu = enuu;
	}

	public String getEnname() {
		return enname;
	}

	public void setEnname(String enname) {
		this.enname = enname;
	}

	public Long getUseruu() {
		return useruu;
	}

	public void setUseruu(Long useruu) {
		this.useruu = useruu;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public Set<FlowNode> getFlowNodes() {
		return flowNodes;
	}

	public void setFlowNodes(Set<FlowNode> flowNodes) {
		this.flowNodes = flowNodes;
	}

	public Short getIscondition() {
		return iscondition;
	}

	public void setIscondition(Short iscondition) {
		this.iscondition = iscondition;
	}

	public String getAppname() {
		return appname;
	}

	public void setAppname(String appname) {
		this.appname = appname;
	}

	public String getCaller() {
		return caller;
	}

	public void setCaller(String caller) {
		this.caller = caller;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

}
