Coverage Report - org.kuali.rice.kim.bo.reference.impl.AffiliationTypeImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
AffiliationTypeImpl
0%
0/18
0%
0/2
1.286
 
 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.reference.impl;
 17  
 
 18  
 import javax.persistence.AttributeOverride;
 19  
 import javax.persistence.AttributeOverrides;
 20  
 import javax.persistence.Column;
 21  
 import javax.persistence.Entity;
 22  
 import javax.persistence.Table;
 23  
 import javax.persistence.Transient;
 24  
 
 25  
 import org.hibernate.annotations.Type;
 26  
 import org.kuali.rice.kim.bo.reference.AffiliationType;
 27  
 import org.kuali.rice.kim.bo.reference.dto.AffiliationTypeInfo;
 28  
 import org.kuali.rice.kns.util.ObjectUtils;
 29  
 
 30  
 /**
 31  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 32  
  */
 33  
 @Entity
 34  
 @Table(name="KRIM_AFLTN_TYP_T")
 35  
 @AttributeOverrides({
 36  
         @AttributeOverride(name="code",column=@Column(name="AFLTN_TYP_CD")),
 37  
         @AttributeOverride(name="name",column=@Column(name="NM"))
 38  
 })
 39  0
 public class AffiliationTypeImpl extends KimCodeBase implements AffiliationType {
 40  
 
 41  
         private static final long serialVersionUID = 1L;
 42  
     @Type(type="yes_no")
 43  
     @Column(name="EMP_AFLTN_TYP_IND")
 44  
     protected boolean employmentAffiliationType;
 45  
 
 46  
     @Transient
 47  
     private String affiliationTypeCode;
 48  
         /**
 49  
          * @see org.kuali.rice.kim.bo.reference.AffiliationType#getAffiliationTypeCode()
 50  
          */
 51  
         public String getAffiliationTypeCode() {
 52  0
                 return getCode();
 53  
         }
 54  
 
 55  
         /**
 56  
          * @see org.kuali.rice.kim.bo.reference.AffiliationType#getAffiliationTypeName()
 57  
          */
 58  
         public String getAffiliationTypeName() {
 59  0
                 return getName();
 60  
         }
 61  
 
 62  
         /**
 63  
          * @see org.kuali.rice.kim.bo.reference.AffiliationType#setAffiliationTypeCode(java.lang.String)
 64  
          */
 65  
         public void setAffiliationTypeCode(String affiliationTypeCode) {
 66  0
                 setCode(affiliationTypeCode);
 67  0
         }
 68  
 
 69  
         /**
 70  
          * @see org.kuali.rice.kim.bo.reference.AffiliationType#setAffiliationTypeName(java.lang.String)
 71  
          */
 72  
         public void setAffiliationTypeName(String affiliationTypeName) {
 73  0
                 setName(affiliationTypeName);
 74  0
         }
 75  
 
 76  
         public boolean isEmploymentAffiliationType() {
 77  0
                 if(ObjectUtils.isNull(this.employmentAffiliationType))
 78  0
                         return false;
 79  0
                 return this.employmentAffiliationType;
 80  
         }
 81  
 
 82  
         public void setEmploymentAffiliationType(boolean employmentAffiliationType) {
 83  0
                 this.employmentAffiliationType = employmentAffiliationType;
 84  0
         }
 85  
         
 86  
         public AffiliationTypeInfo toInfo() {
 87  0
                 AffiliationTypeInfo info = new AffiliationTypeInfo();
 88  0
                 info.setCode(code);
 89  0
                 info.setName(name);
 90  0
                 info.setDisplaySortCode(displaySortCode);
 91  0
                 info.setActive(active);
 92  0
                 return info;
 93  
         }
 94  
         
 95  
 }