Coverage Report - org.kuali.rice.kim.impl.identity.visa.EntityVisaBo
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityVisaBo
100%
12/12
50%
2/4
0
 
 1  
 package org.kuali.rice.kim.impl.identity.visa
 2  
 
 3  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 4  
 import org.kuali.rice.kim.api.identity.visa.EntityVisaContract
 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.visa.EntityVisa
 11  
 import javax.persistence.Entity
 12  
 import javax.persistence.Table
 13  
 
 14  
 @Entity
 15  
 @Table(name = "KRIM_ENTITY_VISA_T")
 16  
 class EntityVisaBo extends PersistableBusinessObjectBase implements EntityVisaContract {
 17  
     @Id
 18  
     @GeneratedValue(generator="KRIM_ENTITY_VISA_ID_S")
 19  
     @GenericGenerator(name="KRIM_ENTITY_VISA_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters=[
 20  
             @Parameter(name="sequence_name",value="KRIM_ENTITY_VISA_ID_S"),
 21  
             @Parameter(name="value_column",value="id")
 22  
         ])
 23  
     @Column(name = "ID")
 24  
     String id;
 25  
 
 26  
     @Column(name = "ENTITY_ID")
 27  
     String entityId;
 28  
         
 29  
     @Column(name = "VISA_TYPE_KEY")
 30  
     String visaTypeKey;
 31  
         
 32  
     @Column(name = "VISA_ENTRY")
 33  
     String visaEntry;
 34  
         
 35  
     @Column(name = "VISA_ID")
 36  
     String visaId;
 37  
     
 38  
     /*
 39  
        * Converts a mutable EntityVisaBo to an immutable EntityVisa representation.
 40  
        * @param bo
 41  
        * @return an immutable EntityVisa
 42  
        */
 43  
       static EntityVisa to(EntityVisaBo bo) {
 44  1
         if (bo == null) { return null }
 45  1
         return EntityVisa.Builder.create(bo).build()
 46  
       }
 47  
 
 48  
       /**
 49  
        * Creates a EntityVisaBo business object from an immutable representation of a EntityVisa.
 50  
        * @param an immutable EntityVisa
 51  
        * @return a EntityVisaBo
 52  
        */
 53  
       static EntityVisaBo from(EntityVisa immutable) {
 54  1
         if (immutable == null) {return null}
 55  
 
 56  1
         EntityVisaBo bo = new EntityVisaBo()
 57  1
         bo.id = immutable.id
 58  1
         bo.entityId = immutable.entityId
 59  1
         bo.visaTypeKey = immutable.visaTypeKey
 60  1
         bo.visaEntry = immutable.visaEntry
 61  1
         bo.visaId = immutable.visaId
 62  1
         bo.versionNumber = immutable.versionNumber
 63  1
         bo.objectId = immutable.objectId
 64  
 
 65  1
         return bo;
 66  
       }
 67  
 }