View Javadoc

1   /*
2    * Copyright 2006-2007 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 org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
20  
21  import javax.persistence.*;
22  import java.util.LinkedHashMap;
23  
24  @Entity
25  @Table(name="TRV_ACCT")
26  public class TravelAccount extends PersistableBusinessObjectBase {
27      
28  	private static final long serialVersionUID = -7739303391609093875L;
29  	
30  	@Id
31  	@Column(name="acct_num")
32  	private String number;
33      
34  	@Column(name="acct_name")
35  	private String name;
36      
37  	@Column(name="acct_fo_id")
38  	private Long foId;
39      
40      @ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST, CascadeType.MERGE})
41  	@JoinColumn(name="acct_fo_id", insertable=false, updatable=false)
42  	private FiscalOfficer fiscalOfficer;  
43      
44      public String getName() {
45          return name;
46      }
47  
48      public void setName(String name) {
49          this.name = name;
50      }
51  
52      public String getNumber() {
53          return number;
54      }
55  
56      public void setNumber(String number) {
57          this.number = number;
58      }
59  
60      public FiscalOfficer getFiscalOfficer() {
61          return fiscalOfficer;
62      }
63  
64      public void setFiscalOfficer(FiscalOfficer fiscalOfficer) {
65          this.fiscalOfficer = fiscalOfficer;
66      }
67  
68      public Long getFoId() {
69          return foId;
70      }
71  
72      public void setFoId(Long foId) {
73          this.foId = foId;
74      }
75  
76      @Override
77      protected LinkedHashMap toStringMapper() {
78          LinkedHashMap propMap = new LinkedHashMap();
79          propMap.put("number", getNumber());
80          propMap.put("name", getName());
81          return propMap;
82      }
83      
84  }