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 */
016package org.kuali.rice.krad.test.document.bo;
017
018import javax.persistence.CascadeType;
019import javax.persistence.Column;
020import javax.persistence.Entity;
021import javax.persistence.FetchType;
022import javax.persistence.Id;
023import javax.persistence.JoinColumn;
024import javax.persistence.ManyToOne;
025import javax.persistence.OneToMany;
026import javax.persistence.Table;
027
028import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
029
030import java.util.List;
031
032@Entity
033@Table(name="TRV_ACCT")
034public class Account extends PersistableBusinessObjectBase {
035    private static final long serialVersionUID = 1L;
036    @Id
037    @Column(name="acct_num")
038        private String number;
039        @Column(name="acct_name")
040    private String name;
041        @Column(name="acct_fo_id")
042    private Long amId;
043
044    @OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE})
045    @JoinColumn(name="acct_num",referencedColumnName="acct_num",insertable=false,updatable=false)
046    protected List<SubAccount> subAccounts;
047
048    public Account() {}
049
050    public Account(String number, String name) {
051        super();
052        this.number = number;
053        this.name = name;
054    }
055
056    public String getName() {
057        return name;
058    }
059
060    public void setName(String name) {
061        this.name = name;
062    }
063
064    public String getNumber() {
065        return number;
066    }
067
068    public void setNumber(String number) {
069        this.number = number;
070    }
071
072    public Long getAmId() {
073        return this.amId;
074    }
075
076    public void setAmId(Long id) {
077        this.amId = id;
078    }
079
080    public List<SubAccount> getSubAccounts() {
081        return subAccounts;
082    }
083
084    public void setSubAccounts(List<SubAccount> subAccounts) {
085        this.subAccounts = subAccounts;
086    }
087}