001 /* 002 * Copyright 2006-2012 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 package org.kuali.rice.krad.test.document; 017 018 019 import org.kuali.rice.kim.api.identity.Person; 020 import org.kuali.rice.kim.api.services.KimApiServiceLocator; 021 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase; 022 023 import javax.persistence.Column; 024 import javax.persistence.Id; 025 import javax.persistence.Transient; 026 027 /** 028 * This is a description of what this class does - kellerj don't forget to fill this in. 029 * 030 * @author Kuali Rice Team (rice.collab@kuali.org) 031 * 032 */ 033 public class BOContainingPerson extends PersistableBusinessObjectBase { 034 035 @Id 036 @Column(name="pk") 037 protected String boPrimaryKey; 038 039 @Column(name="prncpl_id") 040 protected String principalId; 041 042 @Transient 043 protected Person person; 044 045 public String getBoPrimaryKey() { 046 return this.boPrimaryKey; 047 } 048 049 public void setBoPrimaryKey(String boPrimaryKey) { 050 this.boPrimaryKey = boPrimaryKey; 051 } 052 053 public String getPrincipalId() { 054 return this.principalId; 055 } 056 057 public void setPrincipalId(String principalId) { 058 this.principalId = principalId; 059 } 060 061 public Person getPerson() { 062 person = KimApiServiceLocator.getPersonService().updatePersonIfNecessary( principalId, person ); 063 return this.person; 064 } 065 066 public void setPerson(Person person) { 067 this.person = person; 068 } 069 }