Coverage Report - org.kuali.rice.kim.impl.role.RoleResponsibilityBo
 
Classes in this File Line Coverage Branch Coverage Complexity
RoleResponsibilityBo
100%
10/10
50%
2/4
0
 
 1  
 /*
 2  
  * Copyright 2006-2011 The Kuali Foundation
 3  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 4  
  * you may not use this file except in compliance with the License.
 5  
  * You may obtain a copy of the License at
 6  
  *
 7  
  * http://www.opensource.org/licenses/ecl2.php
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing, software
 10  
  * distributed under the License is distributed on an "AS IS" BASIS,
 11  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
  * See the License for the specific language governing permissions and
 13  
  * limitations under the License.
 14  
  */
 15  
 
 16  
 
 17  
 
 18  
 
 19  
 
 20  
 
 21  
 package org.kuali.rice.kim.impl.role;
 22  
 
 23  
 
 24  
 import javax.persistence.Column
 25  
 import javax.persistence.Entity
 26  
 import javax.persistence.Id
 27  
 import javax.persistence.JoinColumn
 28  
 import javax.persistence.ManyToOne
 29  
 import javax.persistence.Table
 30  
 import org.hibernate.annotations.Type
 31  
 import org.kuali.rice.kim.api.role.RoleResponsibility
 32  
 import org.kuali.rice.kim.api.role.RoleResponsibilityContract
 33  
 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase
 34  
 import javax.persistence.FetchType
 35  
 import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo
 36  
 
 37  
 /**
 38  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 39  
  */
 40  
 @Entity
 41  
 @Table(name = "KRIM_ROLE_RSP_T")
 42  
 public class RoleResponsibilityBo extends PersistableBusinessObjectBase implements RoleResponsibilityContract {
 43  
     private static final long serialVersionUID = 1L;
 44  
 
 45  
     @Id
 46  
     @Column(name = "ROLE_RSP_ID")
 47  
     String roleResponsibilityId;
 48  
 
 49  
     @Column(name = "ROLE_ID")
 50  
     String roleId;
 51  
 
 52  
     @Column(name = "RSP_ID")
 53  
     String responsibilityId;
 54  
 
 55  
     @Type(type = "yes_no")
 56  
     @Column(name = "ACTV_IND")
 57  
     boolean active;
 58  
 
 59  
     @ManyToOne(targetEntity = ResponsibilityBo.class, fetch = FetchType.EAGER, cascade = [])
 60  
     @JoinColumn(name = "RSP_ID", insertable = false, updatable = false)
 61  
     ResponsibilityBo kimResponsibility;
 62  
 
 63  
 
 64  
     public static RoleResponsibility to(RoleResponsibilityBo bo) {
 65  3
         if (bo == null) { return null;}
 66  3
         return RoleResponsibility.Builder.create(bo).build();
 67  
     }
 68  
 
 69  
     public static RoleResponsibilityBo from(RoleResponsibility immutable) {
 70  5
         if (immutable == null) { return null; }
 71  
 
 72  5
         RoleResponsibilityBo bo = new RoleResponsibilityBo();
 73  5
         bo.roleResponsibilityId = immutable.roleResponsibilityId
 74  5
         bo.roleId = immutable.roleId
 75  5
         bo.responsibilityId = immutable.responsibilityId
 76  5
         bo.active = immutable.active
 77  5
         bo.versionNumber = immutable.versionNumber
 78  
 
 79  5
         return bo
 80  
     }
 81  
 
 82  
 }