View Javadoc

1   /**
2    * Copyright 2005-2011 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.test.bo;
17  
18  
19  import org.kuali.rice.kim.api.identity.Person;
20  import org.kuali.rice.kim.api.services.KimApiServiceLocator;
21  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
22  
23  import javax.persistence.Column;
24  import javax.persistence.Id;
25  import javax.persistence.Transient;
26  
27  /**
28   * This is a description of what this class does - kellerj don't forget to fill this in. 
29   * 
30   * @author Kuali Rice Team (rice.collab@kuali.org)
31   *
32   */
33  public class BOContainingPerson extends PersistableBusinessObjectBase {
34  
35  	@Id
36  	@Column(name="pk")
37  	protected String boPrimaryKey;
38  	
39  	@Column(name="prncpl_id")
40  	protected String principalId;
41  	
42  	@Transient
43  	protected Person person;
44  	
45  	public String getBoPrimaryKey() {
46  		return this.boPrimaryKey;
47  	}
48  
49  	public void setBoPrimaryKey(String boPrimaryKey) {
50  		this.boPrimaryKey = boPrimaryKey;
51  	}
52  
53  	public String getPrincipalId() {
54  		return this.principalId;
55  	}
56  
57  	public void setPrincipalId(String principalId) {
58  		this.principalId = principalId;
59  	}
60  
61  	public Person getPerson() {
62  		person = KimApiServiceLocator.getPersonService().updatePersonIfNecessary( principalId, person );
63  		return this.person;
64  	}
65  
66  	public void setPerson(Person person) {
67  		this.person = person;
68  	}
69  }