View Javadoc

1   /*
2    * Copyright 2006-2008 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  
17  package edu.sampleu.travel.bo;
18  
19  import java.util.LinkedHashMap;
20  
21  import javax.persistence.Column;
22  import javax.persistence.Entity;
23  import javax.persistence.FetchType;
24  import javax.persistence.Id;
25  import javax.persistence.JoinColumn;
26  import javax.persistence.OneToOne;
27  import javax.persistence.Table;
28  
29  import org.kuali.rice.kns.bo.PersistableBusinessObjectExtensionBase;
30  
31  @Entity
32  @Table(name="TRV_ACCT_EXT")
33  public class TravelAccountExtension extends PersistableBusinessObjectExtensionBase {
34      
35      @Id
36  	@Column(name="acct_num")
37  	private String number;
38      
39      @Column(name="acct_type")
40  	private String accountTypeCode;
41      
42      @OneToOne(fetch=FetchType.EAGER)
43  	@JoinColumn(name="acct_type", insertable=false, updatable=false)
44  	private TravelAccountType accountType; 
45      
46      public String getNumber() {
47          return number;
48      }
49  
50      public void setNumber(String number) {
51          this.number = number;
52      }
53  
54      @Override
55      protected LinkedHashMap toStringMapper() {
56          LinkedHashMap propMap = new LinkedHashMap();
57          propMap.put("number", getNumber());
58          propMap.put("accountTypeCode", getAccountTypeCode());
59          return propMap;
60      }
61  
62      public String getAccountTypeCode() {
63          return accountTypeCode;
64      }
65  
66      public void setAccountTypeCode(String accountTypeCode) {
67          this.accountTypeCode = accountTypeCode;
68      }
69  
70  	public TravelAccountType getAccountType() {
71  		return accountType;
72  	}
73  
74  	public void setAccountType(TravelAccountType accountType) {
75  		this.accountType = accountType;
76  	}
77  
78   
79  }