Coverage Report - org.kuali.rice.kim.impl.identity.residency.EntityResidencyBo
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityResidencyBo
100%
11/11
50%
2/4
0
 
 1  
 package org.kuali.rice.kim.impl.identity.residency
 2  
 
 3  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 4  
 import org.kuali.rice.kim.api.identity.residency.EntityResidencyContract
 5  
 import javax.persistence.Id
 6  
 import javax.persistence.GeneratedValue
 7  
 import org.hibernate.annotations.GenericGenerator
 8  
 import org.hibernate.annotations.Parameter
 9  
 import javax.persistence.Column
 10  
 import org.kuali.rice.kim.api.identity.residency.EntityResidency
 11  
 
 12  
 class EntityResidencyBo extends PersistableBusinessObjectBase implements EntityResidencyContract {
 13  
     private static final long serialVersionUID = 6577601907062646926L;
 14  
 
 15  
         @Id
 16  
         @GeneratedValue(generator="KRIM_ENTITY_RESIDENCY_ID_S")
 17  
         @GenericGenerator(name="KRIM_ENTITY_RESIDENCY_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters=[
 18  
                         @Parameter(name="sequence_name",value="KRIM_ENTITY_RESIDENCY_ID_S"),
 19  
                         @Parameter(name="value_column",value="id")
 20  
                 ])
 21  
         @Column(name = "ID")
 22  
         String id;
 23  
 
 24  
         @Column(name = "ENTITY_ID")
 25  
         String entityId;
 26  
         
 27  
         @Column(name = "DETERMINATION_METHOD")
 28  
         String determinationMethod;
 29  
         
 30  
         @Column(name = "IN_STATE")
 31  
     String inState;
 32  
     
 33  
   /*
 34  
    * Converts a mutable EntityResidencyBo to an immutable EntityResidency representation.
 35  
    * @param bo
 36  
    * @return an immutable EntityResidency
 37  
    */
 38  
   static EntityResidency to(EntityResidencyBo bo) {
 39  1
     if (bo == null) { return null }
 40  1
     return EntityResidency.Builder.create(bo).build()
 41  
   }
 42  
 
 43  
   /**
 44  
    * Creates a EntityResidencyBo business object from an immutable representation of a EntityResidency.
 45  
    * @param an immutable EntityResidency
 46  
    * @return a EntityResidencyBo
 47  
    */
 48  
   static EntityResidencyBo from(EntityResidency immutable) {
 49  1
     if (immutable == null) {return null}
 50  
 
 51  1
     EntityResidencyBo bo = new EntityResidencyBo()
 52  1
     bo.entityId = immutable.entityId
 53  1
     bo.id = immutable.id
 54  1
     bo.determinationMethod = immutable.determinationMethod
 55  1
     bo.inState = immutable.inState
 56  1
     bo.versionNumber = immutable.versionNumber
 57  1
     bo.objectId = immutable.objectId
 58  
 
 59  1
     return bo;
 60  
   }
 61  
 }