Coverage Report - org.kuali.rice.kim.bo.ui.RoleDocumentDelegation
 
Classes in this File Line Coverage Branch Coverage Complexity
RoleDocumentDelegation
0%
0/28
0%
0/2
1.059
 
 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.Fetch;
 19  
 import org.hibernate.annotations.FetchMode;
 20  
 import org.hibernate.annotations.GenericGenerator;
 21  
 import org.hibernate.annotations.Parameter;
 22  
 import org.kuali.rice.kew.util.KEWConstants;
 23  
 import org.springframework.util.AutoPopulatingList;
 24  
 
 25  
 import javax.persistence.*;
 26  
 import java.util.List;
 27  
 
 28  
 /**
 29  
  * This is a description of what this class does - kellerj don't forget to fill this in.
 30  
  *
 31  
  * @author Kuali Rice Team (kuali-rice@googleroles.com)
 32  
  *
 33  
  */
 34  
 @IdClass(RoleDocumentDelegationId.class)
 35  
 @Entity
 36  
 @Table(name="KRIM_PND_DLGN_T")
 37  0
 public class RoleDocumentDelegation extends KimDocumentBoActivatableBase {
 38  
 
 39  
         private static final long serialVersionUID = 1L;
 40  
 
 41  
         @Id
 42  
         @GeneratedValue(generator="KRIM_DLGN_ID_S")
 43  
         @GenericGenerator(name="KRIM_DLGN_ID_S",strategy="org.kuali.rice.core.jpa.spring.RiceNumericStringSequenceStyleGenerator",parameters={
 44  
                         @Parameter(name="sequence_name",value="KRIM_DLGN_ID_S"),
 45  
                         @Parameter(name="value_column",value="id")
 46  
                 })
 47  
         @Column(name="DLGN_ID")
 48  
         protected String delegationId;
 49  
 
 50  
         @Column(name="ROLE_ID")
 51  
         protected String roleId;
 52  
 
 53  
         @Column(name="KIM_TYP_ID")
 54  
         protected String kimTypeId;
 55  
 
 56  
         @Column(name="DLGN_TYP_CD")
 57  
         protected String delegationTypeCode;
 58  
 
 59  0
         @OneToMany(targetEntity=RoleDocumentDelegationMember.class, fetch=FetchType.EAGER, cascade={CascadeType.ALL})
 60  
     @Fetch(value = FetchMode.SELECT)
 61  
         @JoinColumns({
 62  
                 @JoinColumn(name="dlgn_id",insertable=false,updatable=false),
 63  
                 @JoinColumn(name="fdoc_nbr", insertable=false, updatable=false)
 64  
         })
 65  
         private List<RoleDocumentDelegationMember> members = new AutoPopulatingList(RoleDocumentDelegationMember.class);
 66  
 
 67  0
         @Transient
 68  
         private RoleDocumentDelegationMember member = new RoleDocumentDelegationMember();
 69  
 
 70  0
         @Transient
 71  
         protected List<KimDocumentRoleQualifier> qualifiers = new AutoPopulatingList(KimDocumentRoleQualifier.class);
 72  
 
 73  
         public String getRoleId() {
 74  0
                 return this.roleId;
 75  
         }
 76  
 
 77  
         public void setRoleId(String roleId) {
 78  0
                 this.roleId = roleId;
 79  0
         }
 80  
 
 81  
         public String getKimTypeId() {
 82  0
                 return this.kimTypeId;
 83  
         }
 84  
 
 85  
         public void setKimTypeId(String typeId) {
 86  0
                 this.kimTypeId = typeId;
 87  0
         }
 88  
 
 89  
         public String getDelegationTypeCode() {
 90  0
                 return this.delegationTypeCode;
 91  
         }
 92  
 
 93  
         public void setDelegationTypeCode(String delegationTypeCode) {
 94  0
                 this.delegationTypeCode = delegationTypeCode;
 95  0
         }
 96  
 
 97  
         public String getDelegationId() {
 98  0
                 return this.delegationId;
 99  
         }
 100  
 
 101  
         public void setDelegationId(String delegationId) {
 102  0
                 this.delegationId = delegationId;
 103  0
         }
 104  
 
 105  
         /**
 106  
          * @return the qualifiers
 107  
          */
 108  
         public List<KimDocumentRoleQualifier> getQualifiers() {
 109  0
                 return this.qualifiers;
 110  
         }
 111  
 
 112  
         /**
 113  
          * @param qualifiers the qualifiers to set
 114  
          */
 115  
         public void setQualifiers(List<KimDocumentRoleQualifier> qualifiers) {
 116  0
                 this.qualifiers = qualifiers;
 117  0
         }
 118  
 
 119  
         public int getNumberOfQualifiers(){
 120  0
                 return qualifiers==null?0:qualifiers.size();
 121  
         }
 122  
 
 123  
         /**
 124  
          * @return the members
 125  
          */
 126  
         public List<RoleDocumentDelegationMember> getMembers() {
 127  0
                 return this.members;
 128  
         }
 129  
 
 130  
         /**
 131  
          * @param members the members to set
 132  
          */
 133  
         public void setMembers(List<RoleDocumentDelegationMember> members) {
 134  0
                 this.members = members;
 135  0
         }
 136  
 
 137  
         /**
 138  
          * @return the member
 139  
          */
 140  
         public RoleDocumentDelegationMember getMember() {
 141  0
                 return this.member;
 142  
         }
 143  
 
 144  
         /**
 145  
          * @param member the member to set
 146  
          */
 147  
         public void setMember(RoleDocumentDelegationMember member) {
 148  0
                 this.member = member;
 149  0
         }
 150  
 
 151  
         public boolean isDelegationPrimary(){
 152  0
                 return KEWConstants.DELEGATION_PRIMARY.equals(getDelegationTypeCode());
 153  
         }
 154  
 
 155  
         public boolean isDelegationSecondary(){
 156  0
                 return KEWConstants.DELEGATION_SECONDARY.equals(getDelegationTypeCode());
 157  
         }
 158  
 
 159  
 }