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 org.apache.commons.lang.ObjectUtils;
19 import org.apache.commons.lang.StringUtils;
20 import org.hibernate.annotations.GenericGenerator;
21 import org.hibernate.annotations.Parameter;
22 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
23
24 import javax.persistence.*;
25 import java.util.List;
26
27
28
29
30
31 @Entity
32 @Table(name="TRV_ACCT_FO")
33 public class AccountManager extends PersistableBusinessObjectBase {
34
35 @Column(name="acct_fo_user_name")
36 private String userName;
37 @Id
38 @GeneratedValue(generator="TRV_FO_ID_S")
39 @GenericGenerator(name="TRV_FO_ID_S",strategy="org.hibernate.id.enhanced.SequenceStyleGenerator",parameters={
40 @Parameter(name="sequence_name",value="TRV_FO_ID_S"),
41 @Parameter(name="value_column",value="id")
42 })
43 @Column(name="acct_fo_id")
44 private Long amId;
45 @Transient
46 private String defaultType;
47 @OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST,CascadeType.MERGE,CascadeType.REMOVE})
48 @JoinColumn(name="acct_fo_id",insertable=false,updatable=false)
49 private List<Account> accounts;
50
51 public void setUserName(String userId) {
52 userName = userId;
53 }
54
55 public String getUserName() {
56 return userName;
57 }
58
59 public String getDefaultType() {
60 return this.defaultType;
61 }
62
63 public void setDefaultType(String defaultType) {
64 this.defaultType = defaultType;
65 }
66
67 public final boolean equals(Object o) {
68 if (o == null) return false;
69 if (!(o instanceof AccountManager)) return false;
70 AccountManager am = (AccountManager) o;
71 return StringUtils.equals(userName, am.getUserName()) &&
72 ObjectUtils.equals(amId, am.getAmId());
73 }
74
75
76
77
78
79
80
81
82
83
84
85 public Long getAmId() {
86 return amId;
87 }
88
89 public void setAmId(Long id) {
90 this.amId = id;
91 }
92
93 public List<Account> getAccounts() {
94 return accounts;
95 }
96
97 public void setAccounts(List<Account> accounts) {
98 this.accounts = accounts;
99 }
100 }