001    /**
002     * Copyright 2005-2014 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.bo;
017    
018    import org.kuali.rice.krad.bo.DataObjectBase;
019    import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
020    
021    import javax.persistence.CascadeType;
022    import javax.persistence.Column;
023    import javax.persistence.Entity;
024    import javax.persistence.FetchType;
025    import javax.persistence.GeneratedValue;
026    import javax.persistence.Id;
027    import javax.persistence.JoinColumn;
028    import javax.persistence.ManyToOne;
029    import javax.persistence.Table;
030    import javax.persistence.Transient;
031    
032    /**
033     * Duplicate of {@link Account} which overrides {@link #getExtension()} to avoid
034     * automatic extension creation
035     */
036    @Entity
037    @Table(name="TRV_ACCT")
038    public class SimpleAccount extends DataObjectBase {
039    
040        @Id
041        @GeneratedValue(generator="TRVL_ID_SEQ")
042        @PortableSequenceGenerator(name="TRVL_ID_SEQ")
043        @Column(name="ACCT_NUM")
044        private String number;
045    
046        @Column(name="ACCT_NAME")
047        private String name;
048    
049        @Column(name="ACCT_FO_ID")
050        private Long amId;
051    
052        @Transient
053        private Object extension;
054    
055        public String getName() {
056            return name;
057        }
058    
059        public void setName(String name) {
060            this.name = name;
061        }
062    
063        public String getNumber() {
064            return number;
065        }
066    
067        public void setNumber(String number) {
068            this.number = number;
069        }
070    
071        public Long getAmId() {
072            return this.amId;
073        }
074    
075        public void setAmId(Long id) {
076            System.err.println("Setting AmId from " + this.amId + " to " + id);
077            this.amId = id;
078        }
079    
080        public Object getExtension() {
081            return extension;
082        }
083    
084        public void setExtension(Object extension) {
085            this.extension = extension;
086        }
087    }