Coverage Report - org.kuali.rice.kew.edl.extract.Dump
 
Classes in this File Line Coverage Branch Coverage Complexity
Dump
0%
0/46
N/A
1
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 
 17  
 package org.kuali.rice.kew.edl.extract;
 18  
 
 19  
 import java.sql.Timestamp;
 20  
 import java.text.DateFormat;
 21  
 import java.text.SimpleDateFormat;
 22  
 import java.util.ArrayList;
 23  
 import java.util.Calendar;
 24  
 import java.util.Date;
 25  
 import java.util.List;
 26  
 
 27  
 import javax.persistence.Column;
 28  
 import javax.persistence.Entity;
 29  
 import javax.persistence.Id;
 30  
 import javax.persistence.PrePersist;
 31  
 import javax.persistence.Table;
 32  
 import javax.persistence.Transient;
 33  
 import javax.persistence.Version;
 34  
 
 35  
 import org.kuali.rice.core.jpa.annotations.Sequence;
 36  
 import org.kuali.rice.core.util.OrmUtils;
 37  
 import org.kuali.rice.core.util.RiceConstants;
 38  
 import org.kuali.rice.kew.util.KEWConstants;
 39  
 import org.kuali.rice.kns.service.KNSServiceLocator;
 40  
 
 41  
 /**
 42  
  *
 43  
  *
 44  
  *
 45  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 46  
  *
 47  
  */
 48  
 @Entity
 49  
 @Table(name="KREW_EDL_DMP_T")
 50  
 @Sequence(name="KREW_EDL_DMP_T", property="docId")
 51  0
 public class Dump {
 52  
 
 53  
         private static final long serialVersionUID = -6136544551121011531L;
 54  
 
 55  
     @Id
 56  
         @Column(name="DOC_HDR_ID")
 57  
         private Long docId;
 58  
         @Column(name="DOC_TYP_NM")
 59  
         private String docTypeName;
 60  
         @Column(name="DOC_HDR_STAT_CD")
 61  
         private String docRouteStatusCode;
 62  
         @Column(name="DOC_HDR_MDFN_DT")
 63  
         private Timestamp docModificationDate;
 64  
         @Column(name="DOC_HDR_CRTE_DT")
 65  
         private Timestamp docCreationDate;
 66  
         @Column(name="DOC_HDR_TTL")
 67  
         private String docDescription;
 68  
     @Column(name="DOC_HDR_INITR_PRNCPL_ID")
 69  
         private String docInitiatorId;
 70  
     @Column(name="CRNT_NODE_NM")
 71  
         private String docCurrentNodeName;
 72  
     @Version
 73  
         @Column(name="VER_NBR")
 74  
         private Integer lockVerNbr;
 75  
 
 76  0
     @Transient
 77  
     private List<Fields> fields = new ArrayList<Fields>();
 78  
 
 79  
     @PrePersist
 80  
     public void beforeInsert(){
 81  0
         OrmUtils.populateAutoIncValue(this, KNSServiceLocator.getEntityManagerFactory().createEntityManager());
 82  0
     }
 83  
 
 84  
 
 85  
         public Timestamp getDocCreationDate() {
 86  0
                 return docCreationDate;
 87  
         }
 88  
         public void setDocCreationDate(final Timestamp docCreationDate) {
 89  0
                 this.docCreationDate = docCreationDate;
 90  0
         }
 91  
         public String getDocCurrentNodeName() {
 92  0
                 return docCurrentNodeName;
 93  
         }
 94  
         public void setDocCurrentNodeName(final String docCurrentNodeName) {
 95  0
                 this.docCurrentNodeName = docCurrentNodeName;
 96  0
         }
 97  
         public String getDocDescription() {
 98  0
                 return docDescription;
 99  
         }
 100  
         public void setDocDescription(final String docDescription) {
 101  0
                 this.docDescription = docDescription;
 102  0
         }
 103  
         public Long getDocId() {
 104  0
                 return docId;
 105  
         }
 106  
         public String getDocInitiatorId() {
 107  0
                 return docInitiatorId;
 108  
         }
 109  
         public void setDocInitiatorId(final String docInitiatorId) {
 110  0
                 this.docInitiatorId = docInitiatorId;
 111  0
         }
 112  
         public Timestamp getDocModificationDate() {
 113  0
                 return docModificationDate;
 114  
         }
 115  
         public void setDocModificationDate(final Timestamp docModificationDate) {
 116  0
                 this.docModificationDate = docModificationDate;
 117  0
         }
 118  
         public String getDocRouteStatusCode() {
 119  0
                 return docRouteStatusCode;
 120  
         }
 121  
         public void setDocRouteStatusCode(final String docRouteStatusCode) {
 122  0
                 this.docRouteStatusCode = docRouteStatusCode;
 123  0
         }
 124  
         public String getDocTypeName() {
 125  0
                 return docTypeName;
 126  
         }
 127  
         public void setDocTypeName(final String docTypeName) {
 128  0
                 this.docTypeName = docTypeName;
 129  0
         }
 130  
         public Integer getLockVerNbr() {
 131  0
                 return lockVerNbr;
 132  
         }
 133  
         public void setLockVerNbr(final Integer lockVerNbr) {
 134  0
                 this.lockVerNbr = lockVerNbr;
 135  0
         }
 136  
     public String getFormattedCreateDateTime() {
 137  0
         long time = getDocCreationDate().getTime();
 138  0
         Calendar calendar = Calendar.getInstance();
 139  0
         calendar.setTimeInMillis(time);
 140  0
         Date date = calendar.getTime();
 141  0
         DateFormat dateFormat = new SimpleDateFormat(KEWConstants.TIMESTAMP_DATE_FORMAT_PATTERN2);
 142  0
         return dateFormat.format(date);
 143  
     }
 144  
 
 145  
     public String getFormattedCreateDate() {
 146  0
         long time = getDocCreationDate().getTime();
 147  0
         Calendar calendar = Calendar.getInstance();
 148  0
         calendar.setTimeInMillis(time);
 149  0
         Date date = calendar.getTime();
 150  0
         DateFormat dateFormat = RiceConstants.getDefaultDateFormat();
 151  0
         return dateFormat.format(date);
 152  
     }
 153  
         public void setDocId(final Long docId) {
 154  0
                 this.docId = docId;
 155  0
         }
 156  
 
 157  
 
 158  
         public List<Fields> getFields() {
 159  0
                 return fields;
 160  
         }
 161  
 
 162  
         public void setFields(final List<Fields> fields) {
 163  0
                 this.fields = fields;
 164  0
         }
 165  
 
 166  
 }
 167