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