001 /*
002 * Copyright 2006-2007 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
017 package edu.sampleu.travel.bo;
018
019 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
020
021 import javax.persistence.*;
022 import java.util.LinkedHashMap;
023
024 @Entity
025 @Table(name="TRV_ACCT")
026 public class TravelAccount extends PersistableBusinessObjectBase {
027
028 private static final long serialVersionUID = -7739303391609093875L;
029
030 @Id
031 @Column(name="acct_num")
032 private String number;
033
034 @Column(name="acct_name")
035 private String name;
036
037 @Column(name="acct_fo_id")
038 private Long foId;
039
040 @ManyToOne(fetch=FetchType.EAGER, cascade={CascadeType.PERSIST, CascadeType.MERGE})
041 @JoinColumn(name="acct_fo_id", insertable=false, updatable=false)
042 private FiscalOfficer fiscalOfficer;
043
044 public String getName() {
045 return name;
046 }
047
048 public void setName(String name) {
049 this.name = name;
050 }
051
052 public String getNumber() {
053 return number;
054 }
055
056 public void setNumber(String number) {
057 this.number = number;
058 }
059
060 public FiscalOfficer getFiscalOfficer() {
061 return fiscalOfficer;
062 }
063
064 public void setFiscalOfficer(FiscalOfficer fiscalOfficer) {
065 this.fiscalOfficer = fiscalOfficer;
066 }
067
068 public Long getFoId() {
069 return foId;
070 }
071
072 public void setFoId(Long foId) {
073 this.foId = foId;
074 }
075
076 @Override
077 protected LinkedHashMap toStringMapper() {
078 LinkedHashMap propMap = new LinkedHashMap();
079 propMap.put("number", getNumber());
080 propMap.put("name", getName());
081 return propMap;
082 }
083
084 }