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 | 0 | public AdHocRoutePerson() { |
39 | 0 | setType(PERSON_TYPE); |
40 | 0 | } |
41 | |
|
42 | |
@Override |
43 | |
public void setType(Integer type) { |
44 | 0 | if (!PERSON_TYPE.equals(type)) { |
45 | 0 | throw new IllegalArgumentException("cannot change type to " + type); |
46 | |
} |
47 | 0 | super.setType(type); |
48 | 0 | } |
49 | |
|
50 | |
@Override |
51 | |
public String getName() { |
52 | 0 | if ( person == null || person.getPrincipalName() == null || !person.getPrincipalName().equalsIgnoreCase( getId() ) ) { |
53 | 0 | person = org.kuali.rice.kim.service.KIMServiceLocator.getPersonService().getPersonByPrincipalName( getId() ); |
54 | |
} |
55 | 0 | if ( person == null ) { |
56 | 0 | return ""; |
57 | |
} |
58 | 0 | return person.getName(); |
59 | |
} |
60 | |
|
61 | |
|
62 | |
} |
63 | |
|