Coverage Report - edu.sampleu.travel.bo.FiscalOfficer
 
Classes in this File Line Coverage Branch Coverage Complexity
FiscalOfficer
0%
0/21
0%
0/8
1.455
 
 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 edu.sampleu.travel.bo;
 17  
 
 18  
 import org.apache.commons.lang.ObjectUtils;
 19  
 import org.apache.commons.lang.StringUtils;
 20  
 import org.apache.commons.lang.builder.HashCodeBuilder;
 21  
 import org.kuali.rice.core.framework.persistence.jpa.annotations.Sequence;
 22  
 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
 23  
 
 24  
 import javax.persistence.CascadeType;
 25  
 import javax.persistence.Column;
 26  
 import javax.persistence.Entity;
 27  
 import javax.persistence.FetchType;
 28  
 import javax.persistence.Id;
 29  
 import javax.persistence.OneToMany;
 30  
 import javax.persistence.Table;
 31  
 import java.util.ArrayList;
 32  
 import java.util.List;
 33  
 
 34  
 /**
 35  
  * FiscalOfficer
 36  
  */
 37  
 @Entity
 38  
 @Table(name="TRV_ACCT_FO")
 39  
 @Sequence(name="seq_acct_fo_id", property="id")
 40  
 public class FiscalOfficer extends PersistableBusinessObjectBase {
 41  
         private static final long serialVersionUID = -4645124696676896963L;
 42  
 
 43  
         @Id
 44  
         @Column(name="acct_fo_id")
 45  
         private Long id;
 46  
         
 47  
         @Column(name="acct_fo_user_name")
 48  
         private String userName;
 49  
         
 50  
         @Column(name="acct_fo_user_name")
 51  
         private String firstName;
 52  
 
 53  0
         @OneToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER, mappedBy="fiscalOfficer")
 54  
         private List<TravelAccount> accounts = new ArrayList<TravelAccount>();
 55  
         
 56  0
         public FiscalOfficer() {
 57  0
                 accounts = new ArrayList<TravelAccount>();
 58  0
         }
 59  
 
 60  
         /**
 61  
          * @return the firstName
 62  
          */
 63  
         public String getFirstName() {
 64  0
                 return this.firstName;
 65  
         }
 66  
 
 67  
         /**
 68  
          * @param firstName the firstName to set
 69  
          */
 70  
         public void setFirstName(String firstName) {
 71  0
                 this.firstName = firstName;
 72  0
         }
 73  
 
 74  
         public void setUserName(String userId) {
 75  0
                 userName = userId;
 76  0
         }
 77  
 
 78  
         public String getUserName() {
 79  0
                 return userName;
 80  
         }
 81  
 
 82  
         public final boolean equals(Object o) {
 83  0
         if (o == null) return false;
 84  0
         if (!(o instanceof FiscalOfficer)) return false;
 85  0
         FiscalOfficer f = (FiscalOfficer) o;
 86  0
         return StringUtils.equals(userName, f.getUserName()) &&
 87  
                ObjectUtils.equals(id, f.getId());
 88  
         }
 89  
 
 90  
         public int hashCode() {
 91  0
             return new HashCodeBuilder().append(id).append(userName).toHashCode();
 92  
         }
 93  
 
 94  
         public Long getId() {
 95  0
                 return id;
 96  
         }
 97  
 
 98  
         public void setId(Long id) {
 99  0
                 this.id = id;
 100  0
         }
 101  
 
 102  
     public List<TravelAccount> getAccounts() {
 103  0
         return accounts;
 104  
     }
 105  
 
 106  
     public void setAccounts(List<TravelAccount> accounts) {
 107  0
         this.accounts = accounts;
 108  0
     }
 109  
 }