继前两篇博客:应用第三种方式
实体中不需要引入任何与工作流相关的任何属性,单纯的做好自己即可!例如如下申请实体(Leave):
package com.tgb.itoo.basic.entity;
import java.util.Date;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.springframework.format.annotation.DateTimeFormat;
/**
* Entity: Leave
*
* @author hejingyuan IdEntity implements Serializable
*/
@Entity
@Table(name = "OA_LEAVE")
public class L