Coverage Report - org.kuali.rice.kim.impl.identity.EntityTypeBo
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityTypeBo
0%
0/11
0%
0/8
0
 
 1  
 /**
 2  
  * Copyright 2005-2011 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.impl.identity
 17  
 
 18  
 import javax.persistence.Column
 19  
 import javax.persistence.Entity
 20  
 import javax.persistence.Id
 21  
 import javax.persistence.Table
 22  
 import org.kuali.rice.kim.api.identity.CodedAttribute
 23  
 import org.kuali.rice.kim.api.identity.CodedAttributeContract
 24  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 25  
 
 26  
 @Entity
 27  
 @Table(name="KRIM_ADDR_TYP_T")
 28  
 public class EntityTypeBo extends PersistableBusinessObjectBase implements CodedAttributeContract {
 29  
     @Id
 30  
     @Column(name="ADDR_TYP_CD")
 31  
     String code;
 32  
     @Column(name="NM")
 33  
     String name;
 34  
     @org.hibernate.annotations.Type(type="yes_no")
 35  
     @Column(name="ACTV_IND")
 36  
     boolean active;
 37  
     @Column(name="DISPLAY_SORT_CD")
 38  
     String sortCode;
 39  
 
 40  
 
 41  
     /**
 42  
    * Converts a mutable AddressTypeBo to an immutable AddressType representation.
 43  
    * @param bo
 44  
    * @return an immutable AddressType
 45  
    */
 46  
   static CodedAttribute to(EntityTypeBo bo) {
 47  0
     if (bo == null) { return null }
 48  0
     return CodedAttribute.Builder.create(bo).build()
 49  
   }
 50  
 
 51  
   /**
 52  
    * Creates a AddressType business object from an immutable representation of a AddressType.
 53  
    * @param an immutable AddressType
 54  
    * @return a AddressTypeBo
 55  
    */
 56  
   static EntityTypeBo from(CodedAttribute immutable) {
 57  0
     if (immutable == null) {return null}
 58  
 
 59  0
     EntityTypeBo bo = new EntityTypeBo()
 60  0
     bo.code = immutable.code
 61  0
     bo.name = immutable.name
 62  0
     bo.sortCode = immutable.sortCode
 63  0
     bo.active = immutable.active
 64  0
     bo.versionNumber = immutable.versionNumber
 65  0
     bo.objectId = immutable.objectId
 66  
 
 67  0
     return bo;
 68  
   }
 69  
 }