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