Coverage Report - org.kuali.rice.kim.impl.identity.residency.EntityResidencyBo
 
Classes in this File Line Coverage Branch Coverage Complexity
EntityResidencyBo
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.residency
 17  
 
 18  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 19  
 import org.kuali.rice.kim.api.identity.residency.EntityResidencyContract
 20  
 import javax.persistence.Id
 21  
 import javax.persistence.GeneratedValue
 22  
 import org.hibernate.annotations.GenericGenerator
 23  
 import org.hibernate.annotations.Parameter
 24  
 import javax.persistence.Column
 25  
 import org.kuali.rice.kim.api.identity.residency.EntityResidency
 26  
 
 27  
 class EntityResidencyBo extends PersistableBusinessObjectBase implements EntityResidencyContract {
 28  
     private static final long serialVersionUID = 6577601907062646926L;
 29  
 
 30  
         @Id
 31  
         @GeneratedValue(generator="KRIM_ENTITY_RESIDENCY_ID_S")
 32  
         @GenericGenerator(name="KRIM_ENTITY_RESIDENCY_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters=[
 33  
                         @Parameter(name="sequence_name",value="KRIM_ENTITY_RESIDENCY_ID_S"),
 34  
                         @Parameter(name="value_column",value="id")
 35  
                 ])
 36  
         @Column(name = "ID")
 37  
         String id;
 38  
 
 39  
         @Column(name = "ENTITY_ID")
 40  
         String entityId;
 41  
         
 42  
         @Column(name = "DETERMINATION_METHOD")
 43  
         String determinationMethod;
 44  
         
 45  
         @Column(name = "IN_STATE")
 46  
     String inState;
 47  
     
 48  
   /*
 49  
    * Converts a mutable EntityResidencyBo to an immutable EntityResidency representation.
 50  
    * @param bo
 51  
    * @return an immutable EntityResidency
 52  
    */
 53  
   static EntityResidency to(EntityResidencyBo bo) {
 54  0
     if (bo == null) { return null }
 55  0
     return EntityResidency.Builder.create(bo).build()
 56  
   }
 57  
 
 58  
   /**
 59  
    * Creates a EntityResidencyBo business object from an immutable representation of a EntityResidency.
 60  
    * @param an immutable EntityResidency
 61  
    * @return a EntityResidencyBo
 62  
    */
 63  
   static EntityResidencyBo from(EntityResidency immutable) {
 64  0
     if (immutable == null) {return null}
 65  
 
 66  0
     EntityResidencyBo bo = new EntityResidencyBo()
 67  0
     bo.entityId = immutable.entityId
 68  0
     bo.id = immutable.id
 69  0
     bo.determinationMethod = immutable.determinationMethod
 70  0
     bo.inState = immutable.inState
 71  0
     bo.versionNumber = immutable.versionNumber
 72  0
     bo.objectId = immutable.objectId
 73  
 
 74  0
     return bo;
 75  
   }
 76  
 }