1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.bo;
17
18 import javax.persistence.Entity;
19 import javax.persistence.IdClass;
20 import javax.persistence.Table;
21 import javax.persistence.Transient;
22
23 import org.kuali.rice.kim.bo.Person;
24
25
26
27
28 @IdClass(org.kuali.rice.kns.bo.AdHocRoutePersonId.class)
29 @Entity
30 @Table(name="KRNS_ADHOC_RTE_ACTN_RECIP_T")
31 public class AdHocRoutePerson extends AdHocRouteRecipient {
32
33 private static final long serialVersionUID = 1L;
34
35 @Transient
36 private transient Person person;
37
38 public AdHocRoutePerson() {
39 setType(PERSON_TYPE);
40 }
41
42 @Override
43 public void setType(Integer type) {
44 if (!PERSON_TYPE.equals(type)) {
45 throw new IllegalArgumentException("cannot change type to " + type);
46 }
47 super.setType(type);
48 }
49
50 @Override
51 public String getName() {
52 if ( person == null || person.getPrincipalName() == null || !person.getPrincipalName().equalsIgnoreCase( getId() ) ) {
53 person = org.kuali.rice.kim.service.KIMServiceLocator.getPersonService().getPersonByPrincipalName( getId() );
54 }
55 if ( person == null ) {
56 return "";
57 }
58 return person.getName();
59 }
60
61
62 }
63