1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package edu.sampleu.travel.bo; |
17 | |
|
18 | |
import org.apache.commons.lang.ObjectUtils; |
19 | |
import org.apache.commons.lang.StringUtils; |
20 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
21 | |
import org.kuali.rice.core.framework.persistence.jpa.annotations.Sequence; |
22 | |
import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; |
23 | |
|
24 | |
import javax.persistence.*; |
25 | |
import java.util.List; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
@Entity |
31 | |
@Table(name="TRV_ACCT_FO") |
32 | |
@Sequence(name="seq_acct_fo_id", property="id") |
33 | 0 | public class FiscalOfficer extends PersistableBusinessObjectBase { |
34 | |
|
35 | |
private static final long serialVersionUID = -4645124696676896963L; |
36 | |
|
37 | |
@Id |
38 | |
@Column(name="acct_fo_id") |
39 | |
private Long id; |
40 | |
|
41 | |
@Column(name="acct_fo_user_name") |
42 | |
private String userName; |
43 | |
|
44 | |
@Column(name="acct_fo_user_name") |
45 | |
private String firstName; |
46 | |
|
47 | |
@OneToMany(cascade={CascadeType.PERSIST, CascadeType.MERGE}, fetch=FetchType.EAGER, mappedBy="fiscalOfficer") |
48 | |
private List<TravelAccount> accounts; |
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | |
public String getFirstName() { |
54 | 0 | return this.firstName; |
55 | |
} |
56 | |
|
57 | |
|
58 | |
|
59 | |
|
60 | |
public void setFirstName(String firstName) { |
61 | 0 | this.firstName = firstName; |
62 | 0 | } |
63 | |
|
64 | |
public void setUserName(String userId) { |
65 | 0 | userName = userId; |
66 | 0 | } |
67 | |
|
68 | |
public String getUserName() { |
69 | 0 | return userName; |
70 | |
} |
71 | |
|
72 | |
public final boolean equals(Object o) { |
73 | 0 | if (o == null) return false; |
74 | 0 | if (!(o instanceof FiscalOfficer)) return false; |
75 | 0 | FiscalOfficer f = (FiscalOfficer) o; |
76 | 0 | return StringUtils.equals(userName, f.getUserName()) && |
77 | |
ObjectUtils.equals(id, f.getId()); |
78 | |
} |
79 | |
|
80 | |
public int hashCode() { |
81 | 0 | return new HashCodeBuilder().append(id).append(userName).toHashCode(); |
82 | |
} |
83 | |
|
84 | |
public Long getId() { |
85 | 0 | return id; |
86 | |
} |
87 | |
|
88 | |
public void setId(Long id) { |
89 | 0 | this.id = id; |
90 | 0 | } |
91 | |
|
92 | |
public List<TravelAccount> getAccounts() { |
93 | 0 | return accounts; |
94 | |
} |
95 | |
|
96 | |
public void setAccounts(List<TravelAccount> accounts) { |
97 | 0 | this.accounts = accounts; |
98 | 0 | } |
99 | |
} |