Coverage Report - org.kuali.rice.kim.bo.role.impl.RoleResponsibilityImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
RoleResponsibilityImpl
0%
0/27
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007-2008 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 responsibilitys and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kim.bo.role.impl;
 17  
 
 18  
 import java.util.LinkedHashMap;
 19  
 
 20  
 import javax.persistence.CascadeType;
 21  
 import javax.persistence.Column;
 22  
 import javax.persistence.Entity;
 23  
 import javax.persistence.FetchType;
 24  
 import javax.persistence.Id;
 25  
 import javax.persistence.JoinColumn;
 26  
 import javax.persistence.OneToOne;
 27  
 import javax.persistence.Table;
 28  
 
 29  
 import org.kuali.rice.kim.bo.role.RoleResponsibility;
 30  
 import org.kuali.rice.kim.bo.role.dto.RoleResponsibilityInfo;
 31  
 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
 32  
 
 33  
 /**
 34  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 35  
  */
 36  
 @Entity
 37  
 @Table(name="KRIM_ROLE_RSP_T")
 38  0
 public class RoleResponsibilityImpl extends PersistableBusinessObjectBase implements RoleResponsibility {
 39  
 
 40  
         private static final long serialVersionUID = 1L;
 41  
         
 42  
         @Id
 43  
         @Column(name="ROLE_RSP_ID")
 44  
         protected String roleResponsibilityId;
 45  
         @Column(name="ROLE_ID")
 46  
         protected String roleId;
 47  
         @Column(name="RSP_ID")
 48  
         protected String responsibilityId;
 49  
         @Column(name="ACTV_IND")
 50  
         protected boolean active;
 51  
         
 52  
         @OneToOne(targetEntity=KimResponsibilityImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL })
 53  
         @JoinColumn(name = "RSP_ID", insertable = false, updatable = false)
 54  
         protected KimResponsibilityImpl kimResponsibility;
 55  
 
 56  
         /**
 57  
          * @see org.kuali.rice.kim.bo.role.RoleResponsibility#getResponsibilityId()
 58  
          */
 59  
         public String getResponsibilityId() {
 60  0
                 return responsibilityId;
 61  
         }
 62  
         
 63  
         /**
 64  
          * @see org.kuali.rice.kim.bo.role.RoleResponsibility#getRoleId()
 65  
          */
 66  
         public String getRoleId() {
 67  0
                 return roleId;
 68  
         }
 69  
 
 70  
         /**
 71  
          * @see org.kuali.rice.kim.bo.role.RoleResponsibility#getRoleResponsibilityId()
 72  
          */
 73  
         public String getRoleResponsibilityId() {
 74  0
                 return roleResponsibilityId;
 75  
         }
 76  
 
 77  
         public void setResponsibilityId(String responsibilityId) {
 78  0
                 this.responsibilityId = responsibilityId;
 79  0
         }
 80  
 
 81  
         public void setRoleId(String roleId) {
 82  0
                 this.roleId = roleId;
 83  0
         }
 84  
 
 85  
         /**
 86  
          * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
 87  
          */
 88  
         @SuppressWarnings("unchecked")
 89  
         @Override
 90  
         protected LinkedHashMap toStringMapper() {
 91  0
                 LinkedHashMap m = new LinkedHashMap();
 92  0
                 m.put( "roleResponsibilityId", roleResponsibilityId );
 93  0
                 m.put( "roleId", roleId );
 94  0
                 m.put( "responsibilityId", responsibilityId );
 95  0
                 return m;
 96  
         }
 97  
 
 98  
         public boolean isActive() {
 99  0
                 return this.active;
 100  
         }
 101  
 
 102  
         public void setActive(boolean active) {
 103  0
                 this.active = active;
 104  0
         }
 105  
 
 106  
         public void setRoleResponsibilityId(String roleResponsibilityId) {
 107  0
                 this.roleResponsibilityId = roleResponsibilityId;
 108  0
         }
 109  
 
 110  
         public KimResponsibilityImpl getKimResponsibility() {
 111  0
                 return this.kimResponsibility;
 112  
         }
 113  
 
 114  
         public void setKimResponsibility(KimResponsibilityImpl kimResponsibility) {
 115  0
                 this.kimResponsibility = kimResponsibility;
 116  0
         }
 117  
 
 118  
         public RoleResponsibilityInfo toSimpleInfo() {
 119  0
                 RoleResponsibilityInfo roleResponsibilityInfo = new RoleResponsibilityInfo();
 120  0
                 roleResponsibilityInfo.setRoleId(getRoleId());
 121  0
                 roleResponsibilityInfo.setResponsibilityId(getResponsibilityId());
 122  0
                 roleResponsibilityInfo.setRoleResponsibilityId(getRoleResponsibilityId());
 123  0
                 roleResponsibilityInfo.setKimResponsibilityInfo(getKimResponsibility().toSimpleInfo());
 124  0
                 return roleResponsibilityInfo;
 125  
         }
 126  
 
 127  
 }