| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
package org.kuali.rice.kew.engine.node; |
| 18 | |
|
| 19 | |
import java.io.Serializable; |
| 20 | |
|
| 21 | |
import javax.persistence.CascadeType; |
| 22 | |
import javax.persistence.Column; |
| 23 | |
import javax.persistence.Entity; |
| 24 | |
import javax.persistence.FetchType; |
| 25 | |
import javax.persistence.Id; |
| 26 | |
import javax.persistence.JoinColumn; |
| 27 | |
import javax.persistence.ManyToOne; |
| 28 | |
import javax.persistence.OneToOne; |
| 29 | |
import javax.persistence.PrePersist; |
| 30 | |
import javax.persistence.Table; |
| 31 | |
import javax.persistence.Version; |
| 32 | |
|
| 33 | |
import org.kuali.rice.core.jpa.annotations.Sequence; |
| 34 | |
import org.kuali.rice.core.util.OrmUtils; |
| 35 | |
import org.kuali.rice.kew.doctype.bo.DocumentType; |
| 36 | |
import org.kuali.rice.kew.service.KEWServiceLocator; |
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
|
| 43 | |
|
| 44 | |
|
| 45 | |
|
| 46 | |
@Entity |
| 47 | |
@Table(name="KREW_DOC_TYP_PROC_T") |
| 48 | |
@Sequence(name="KREW_RTE_NODE_S",property="processId") |
| 49 | 0 | public class Process implements Serializable { |
| 50 | |
|
| 51 | |
private static final long serialVersionUID = -6338857095673479752L; |
| 52 | |
|
| 53 | |
@Id |
| 54 | |
@Column(name="DOC_TYP_PROC_ID") |
| 55 | |
private Long processId; |
| 56 | |
@Column(name="NM") |
| 57 | |
private String name; |
| 58 | |
@ManyToOne(fetch=FetchType.EAGER) |
| 59 | |
@JoinColumn(name="DOC_TYP_ID") |
| 60 | |
private DocumentType documentType; |
| 61 | |
@OneToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST, CascadeType.MERGE}) |
| 62 | |
@JoinColumn(name="INIT_RTE_NODE_ID") |
| 63 | |
private RouteNode initialRouteNode; |
| 64 | 0 | @Column(name="INIT_IND") |
| 65 | |
private boolean initial = false; |
| 66 | |
@Version |
| 67 | |
@Column(name="VER_NBR") |
| 68 | |
private Integer lockVerNbr; |
| 69 | |
|
| 70 | |
public Long getProcessId() { |
| 71 | 0 | return processId; |
| 72 | |
} |
| 73 | |
public void setProcessId(Long processId) { |
| 74 | 0 | this.processId = processId; |
| 75 | 0 | } |
| 76 | |
public DocumentType getDocumentType() { |
| 77 | 0 | return documentType; |
| 78 | |
} |
| 79 | |
public void setDocumentType(DocumentType documentType) { |
| 80 | 0 | this.documentType = documentType; |
| 81 | 0 | } |
| 82 | |
public RouteNode getInitialRouteNode() { |
| 83 | 0 | return initialRouteNode; |
| 84 | |
} |
| 85 | |
public void setInitialRouteNode(RouteNode initialRouteNode) { |
| 86 | 0 | this.initialRouteNode = initialRouteNode; |
| 87 | 0 | } |
| 88 | |
public String getName() { |
| 89 | 0 | return name; |
| 90 | |
} |
| 91 | |
public void setName(String name) { |
| 92 | 0 | this.name = name; |
| 93 | 0 | } |
| 94 | |
public boolean isInitial() { |
| 95 | 0 | return initial; |
| 96 | |
} |
| 97 | |
public void setInitial(boolean initial) { |
| 98 | 0 | this.initial = initial; |
| 99 | 0 | } |
| 100 | |
public Integer getLockVerNbr() { |
| 101 | 0 | return lockVerNbr; |
| 102 | |
} |
| 103 | |
public void setLockVerNbr(Integer lockVerNbr) { |
| 104 | 0 | this.lockVerNbr = lockVerNbr; |
| 105 | 0 | } |
| 106 | |
|
| 107 | |
@PrePersist |
| 108 | |
public void beforeInsert(){ |
| 109 | 0 | OrmUtils.populateAutoIncValue(this, KEWServiceLocator.getEntityManagerFactory().createEntityManager()); |
| 110 | 0 | } |
| 111 | |
|
| 112 | |
} |