001    /*
002     * Copyright 2006-2008 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 java.util.LinkedHashMap;
020    
021    import javax.persistence.Column;
022    import javax.persistence.Entity;
023    import javax.persistence.FetchType;
024    import javax.persistence.Id;
025    import javax.persistence.JoinColumn;
026    import javax.persistence.OneToOne;
027    import javax.persistence.Table;
028    
029    import org.kuali.rice.kns.bo.PersistableBusinessObjectExtensionBase;
030    
031    @Entity
032    @Table(name="TRV_ACCT_EXT")
033    public class TravelAccountExtension extends PersistableBusinessObjectExtensionBase {
034        
035        @Id
036            @Column(name="acct_num")
037            private String number;
038        
039        @Column(name="acct_type")
040            private String accountTypeCode;
041        
042        @OneToOne(fetch=FetchType.EAGER)
043            @JoinColumn(name="acct_type", insertable=false, updatable=false)
044            private TravelAccountType accountType; 
045        
046        public String getNumber() {
047            return number;
048        }
049    
050        public void setNumber(String number) {
051            this.number = number;
052        }
053    
054        @Override
055        protected LinkedHashMap toStringMapper() {
056            LinkedHashMap propMap = new LinkedHashMap();
057            propMap.put("number", getNumber());
058            propMap.put("accountTypeCode", getAccountTypeCode());
059            return propMap;
060        }
061    
062        public String getAccountTypeCode() {
063            return accountTypeCode;
064        }
065    
066        public void setAccountTypeCode(String accountTypeCode) {
067            this.accountTypeCode = accountTypeCode;
068        }
069    
070            public TravelAccountType getAccountType() {
071                    return accountType;
072            }
073    
074            public void setAccountType(TravelAccountType accountType) {
075                    this.accountType = accountType;
076            }
077    
078     
079    }