Coverage Report - org.kuali.rice.kim.bo.ui.KimDocumentRoleResponsibility
 
Classes in this File Line Coverage Branch Coverage Complexity
KimDocumentRoleResponsibility
0%
0/23
0%
0/8
1.455
 
 1  
 /*
 2  
  * Copyright 2007-2009 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.bo.ui;
 17  
 
 18  
 import org.hibernate.annotations.GenericGenerator;
 19  
 import org.hibernate.annotations.Parameter;
 20  
 import org.kuali.rice.kim.api.responsibility.Responsibility;
 21  
 import org.kuali.rice.kim.api.services.KimApiServiceLocator;
 22  
 import org.kuali.rice.kim.impl.responsibility.ResponsibilityBo;
 23  
 import org.springframework.util.AutoPopulatingList;
 24  
 
 25  
 import javax.persistence.Column;
 26  
 import javax.persistence.Entity;
 27  
 import javax.persistence.GeneratedValue;
 28  
 import javax.persistence.Id;
 29  
 import javax.persistence.IdClass;
 30  
 import javax.persistence.Table;
 31  
 import javax.persistence.Transient;
 32  
 import java.util.List;
 33  
 
 34  
 /**
 35  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 36  
  */
 37  
 @IdClass(KimDocumentRoleResponsibilityId.class)
 38  
 @Entity
 39  
 @Table(name="KRIM_PND_ROLE_RSP_T")
 40  0
 public class KimDocumentRoleResponsibility extends KimDocumentBoActivatableBase {
 41  
         
 42  
         private static final long serialVersionUID = -4465768714850961538L;
 43  
         @Id
 44  
         @GeneratedValue(generator="KRIM_ROLE_RSP_ACTN_ID_S")
 45  
         @GenericGenerator(name="KRIM_ROLE_RSP_ACTN_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters={
 46  
                         @Parameter(name="sequence_name",value="KRIM_ROLE_RSP_ACTN_ID_S"),
 47  
                         @Parameter(name="value_column",value="id")
 48  
                 })
 49  
         @Column(name="ROLE_RSP_ID")
 50  
         protected String roleResponsibilityId;
 51  
         @Column(name="ROLE_ID")
 52  
         protected String roleId;
 53  
         @Column(name="RSP_ID")
 54  
         protected String responsibilityId;
 55  
         @Transient
 56  
         protected ResponsibilityBo kimResponsibility;
 57  0
         @Transient
 58  
         protected List<KimDocumentRoleResponsibilityAction> roleRspActions = new AutoPopulatingList(KimDocumentRoleResponsibilityAction.class);
 59  
         
 60  
         public String getRoleId() {
 61  0
                 return roleId;
 62  
         }
 63  
 
 64  
         public void setRoleId(String roleId) {
 65  0
                 this.roleId = roleId;
 66  0
         }
 67  
 
 68  
         public void setRoleResponsibilityId(String roleResponsibilityId) {
 69  0
                 this.roleResponsibilityId = roleResponsibilityId;
 70  0
         }
 71  
 
 72  
         /**
 73  
          * @return the roleResponsibilityId
 74  
          */
 75  
         public String getRoleResponsibilityId() {
 76  0
                 return this.roleResponsibilityId;
 77  
         }
 78  
 
 79  
         /**
 80  
          * @return the kimResponsibility
 81  
          */
 82  
         public ResponsibilityBo getKimResponsibility() {
 83  0
                 if ( kimResponsibility == null && responsibilityId != null ) {
 84  
                         //TODO: this needs to be changed to use the KimResponsibilityInfo object
 85  
                         // but the changes are involved in the UiDocumentService based on the copyProperties method used
 86  
                         // to move the data to/from the document/real objects
 87  0
             Responsibility info = KimApiServiceLocator.getResponsibilityService().getResponsibility(getResponsibilityId());
 88  0
             kimResponsibility = ResponsibilityBo.from(info);
 89  
                 }
 90  0
                 return this.kimResponsibility;
 91  
         }
 92  
 
 93  
         /**
 94  
          * @param responsibilityId the responsibilityId to set
 95  
          */
 96  
         public void setResponsibilityId(String responsibilityId) {
 97  0
                 this.responsibilityId = responsibilityId;
 98  0
         }
 99  
 
 100  
         /**
 101  
          * @param kimResponsibility the kimResponsibility to set
 102  
          */
 103  
         public void setKimResponsibility(ResponsibilityBo kimResponsibility) {
 104  0
                 this.kimResponsibility = kimResponsibility;
 105  0
         }
 106  
 
 107  
         /**
 108  
          * @return the responsibilityId
 109  
          */
 110  
         public String getResponsibilityId() {
 111  0
                 return this.responsibilityId;
 112  
         }
 113  
 
 114  
         /**
 115  
          * @return the roleRspActions
 116  
          */
 117  
         public KimDocumentRoleResponsibilityAction getRoleRspAction() {
 118  0
                 if(this.roleRspActions!=null && this.roleRspActions.size()>0)
 119  0
                         return this.roleRspActions.get(0);
 120  0
                 return null;
 121  
         }
 122  
 
 123  
         /**
 124  
          * @return the roleRspActions
 125  
          */
 126  
         public List<KimDocumentRoleResponsibilityAction> getRoleRspActions() {
 127  0
                 return this.roleRspActions;
 128  
         }
 129  
 
 130  
         /**
 131  
          * @param roleRspActions the roleRspActions to set
 132  
          */
 133  
         public void setRoleRspActions(
 134  
                         List<KimDocumentRoleResponsibilityAction> roleRspActions) {
 135  0
                 this.roleRspActions = roleRspActions;
 136  0
         }
 137  
 
 138  
 }