Coverage Report - org.kuali.rice.kew.engine.node.Process
 
Classes in this File Line Coverage Branch Coverage Complexity
Process
0%
0/22
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  * 
 4  
  * 
 5  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 6  
  * you may not use this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  * 
 9  
  * http://www.opensource.org/licenses/ecl2.php
 10  
  * 
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 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  
  * Represents a route path defined on a {@link DocumentType}.  A Process is a named entity which
 41  
  * simply points to an initial {@link RouteNode} which represents the beginning of the Process.
 42  
  * The path of the process can then be followed using the next nodes defined on the route nodes. 
 43  
  *
 44  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 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  
 }