Coverage Report - org.kuali.rice.kim.bo.ui.KimDocumentBoBase
 
Classes in this File Line Coverage Branch Coverage Complexity
KimDocumentBoBase
0%
0/21
0%
0/8
1.273
 
 1  
 /*
 2  
  * Copyright 2007-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  
 package org.kuali.rice.kim.bo.ui;
 17  
 
 18  
 import java.sql.Date;
 19  
 import java.sql.Timestamp;
 20  
 import java.util.LinkedHashMap;
 21  
 
 22  
 import javax.persistence.Column;
 23  
 import javax.persistence.MappedSuperclass;
 24  
 
 25  
 import org.hibernate.annotations.Type;
 26  
 import org.kuali.rice.kns.bo.Inactivateable;
 27  
 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
 28  
 
 29  
 /**
 30  
  * This is a description of what this class does - shyu don't forget to fill this in. 
 31  
  * 
 32  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 33  
  *
 34  
  */
 35  
 @MappedSuperclass
 36  0
 public class KimDocumentBoBase  extends PersistableBusinessObjectBase implements Inactivateable {
 37  
     private static final long serialVersionUID = 9042706897191231670L;
 38  
         @Column(name="FDOC_NBR")
 39  
     protected String documentNumber;
 40  0
         @Type(type="yes_no")
 41  
         @Column(name="ACTV_IND")
 42  
     protected boolean active = true;
 43  
         @Type(type="yes_no")
 44  
         @Column(name="EDIT_FLAG")
 45  
     protected boolean edit;
 46  
 
 47  
         
 48  
         @Column(name="ACTV_FRM_DT")
 49  
         protected Timestamp activeFromDate;
 50  
         @Column(name="ACTV_TO_DT")
 51  
         protected Timestamp activeToDate;
 52  
 
 53  
         /**
 54  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 55  
          */
 56  
         @SuppressWarnings("unchecked")
 57  
         @Override
 58  
         protected LinkedHashMap toStringMapper() {
 59  0
                 LinkedHashMap m = new LinkedHashMap();
 60  0
                 m.put( "documentNumber", documentNumber );
 61  0
                 return m;
 62  
         }
 63  
 
 64  
         public String getDocumentNumber() {
 65  0
                 return this.documentNumber;
 66  
         }
 67  
 
 68  
         public void setDocumentNumber(String documentNumber) {
 69  0
                 this.documentNumber = documentNumber;
 70  0
         }
 71  
 
 72  
         public boolean isActive() {
 73  0
                 long now = System.currentTimeMillis();                
 74  0
                 return (activeFromDate == null || now > activeFromDate.getTime()) && (activeToDate == null || now < activeToDate.getTime());
 75  
         }
 76  
 
 77  
         public void setActive(boolean active) {
 78  0
                 this.active = active;
 79  0
         }
 80  
 
 81  
         public boolean isEdit() {
 82  0
                 return this.edit;
 83  
         }
 84  
 
 85  
         public void setEdit(boolean edit) {
 86  0
                 this.edit = edit;
 87  0
         }
 88  
 
 89  
         /**
 90  
          * @return the activeFromDate
 91  
          */
 92  
         public Timestamp getActiveFromDate() {
 93  0
                 return this.activeFromDate;
 94  
         }
 95  
 
 96  
         /**
 97  
          * @param activeFromDate
 98  
          *            the activeFromDate to set
 99  
          */
 100  
         public void setActiveFromDate(Timestamp activeFromDate) {
 101  0
                 this.activeFromDate = activeFromDate;
 102  0
         }
 103  
 
 104  
         /**
 105  
          * @return the activeToDate
 106  
          */
 107  
         public Timestamp getActiveToDate() {
 108  0
                 return this.activeToDate;
 109  
         }
 110  
 
 111  
         /**
 112  
          * @param activeToDate
 113  
          *            the activeToDate to set
 114  
          */
 115  
         public void setActiveToDate(Timestamp activeToDate) {
 116  0
                 this.activeToDate = activeToDate;
 117  0
         }
 118  
 
 119  
 }