1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.test.document.bo;
17
18 import javax.persistence.CascadeType;
19 import javax.persistence.Column;
20 import javax.persistence.Entity;
21 import javax.persistence.FetchType;
22 import javax.persistence.Id;
23 import javax.persistence.JoinColumn;
24 import javax.persistence.ManyToOne;
25 import javax.persistence.OneToMany;
26 import javax.persistence.Table;
27
28 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
29
30 import java.util.List;
31
32 @Entity
33 @Table(name="TRV_ACCT")
34 public class Account extends PersistableBusinessObjectBase {
35 private static final long serialVersionUID = 1L;
36 @Id
37 @Column(name="acct_num")
38 private String number;
39 @Column(name="acct_name")
40 private String name;
41 @Column(name="acct_fo_id")
42 private Long amId;
43
44 @OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE})
45 @JoinColumn(name="acct_num",referencedColumnName="acct_num",insertable=false,updatable=false)
46 protected List<SubAccount> subAccounts;
47
48 public Account() {}
49
50 public Account(String number, String name) {
51 super();
52 this.number = number;
53 this.name = name;
54 }
55
56 public String getName() {
57 return name;
58 }
59
60 public void setName(String name) {
61 this.name = name;
62 }
63
64 public String getNumber() {
65 return number;
66 }
67
68 public void setNumber(String number) {
69 this.number = number;
70 }
71
72 public Long getAmId() {
73 return this.amId;
74 }
75
76 public void setAmId(Long id) {
77 this.amId = id;
78 }
79
80 public List<SubAccount> getSubAccounts() {
81 return subAccounts;
82 }
83
84 public void setSubAccounts(List<SubAccount> subAccounts) {
85 this.subAccounts = subAccounts;
86 }
87 }