1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.test.bo;
17
18
19 import java.util.LinkedHashMap;
20
21 import javax.persistence.CascadeType;
22 import javax.persistence.Column;
23 import javax.persistence.FetchType;
24 import javax.persistence.Id;
25 import javax.persistence.ManyToOne;
26
27 import org.kuali.rice.kim.bo.Person;
28 import org.kuali.rice.kim.service.KIMServiceLocator;
29 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
30 import org.kuali.rice.kns.service.KNSServiceLocator;
31
32
33
34
35
36
37
38 public class BOContainingPerson extends PersistableBusinessObjectBase {
39
40 @Id
41 @Column(name="pk")
42 protected String boPrimaryKey;
43
44 @Column(name="prncpl_id")
45 protected String principalId;
46
47 protected Person person;
48
49 public String getBoPrimaryKey() {
50 return this.boPrimaryKey;
51 }
52
53 public void setBoPrimaryKey(String boPrimaryKey) {
54 this.boPrimaryKey = boPrimaryKey;
55 }
56
57 public String getPrincipalId() {
58 return this.principalId;
59 }
60
61 public void setPrincipalId(String principalId) {
62 this.principalId = principalId;
63 }
64
65 public Person getPerson() {
66 person = KIMServiceLocator.getPersonService().updatePersonIfNecessary( principalId, person );
67 return this.person;
68 }
69
70 public void setPerson(Person person) {
71 this.person = person;
72 }
73
74
75
76
77 @SuppressWarnings("unchecked")
78 @Override
79 protected LinkedHashMap toStringMapper() {
80 LinkedHashMap m = new LinkedHashMap();
81 m.put( "boPrimaryKey", boPrimaryKey );
82 m.put( "principalId", principalId );
83 return m;
84 }
85
86 }