-
Notifications
You must be signed in to change notification settings - Fork 781
Expand file tree
/
Copy pathCustomer.java
More file actions
170 lines (127 loc) · 3.56 KB
/
Customer.java
File metadata and controls
170 lines (127 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
package io.shiftleft.model;
import java.util.Date;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.validation.constraints.Pattern;
@Entity
public class Customer {
public Customer() {
}
public Customer(String customerId, int clientId, String firstName, String lastName, Date dateOfBirth, String ssn,
String socialInsurancenum, String tin, String phoneNumber, Address address, Set<Account> accounts) {
super();
this.clientId = clientId;
this.customerId = customerId;
this.firstName = firstName;
this.lastName = lastName;
this.dateOfBirth = dateOfBirth;
this.ssn = ssn;
this.socialInsurancenum = socialInsurancenum;
this.tin = tin;
this.phoneNumber = phoneNumber;
this.address = address;
this.accounts = accounts;
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
private String customerId;
private int clientId;
private String firstName;
private String lastName;
private Date dateOfBirth;
private String ssn;
private String socialInsurancenum;
private String tin;
private String phoneNumber;
@Pattern(regexp = "[0-9]{3}-[0-9]{3}-[0-9]{4}")
@OneToOne(cascade = { CascadeType.ALL })
private Address address;
@OneToMany(cascade = { CascadeType.ALL })
private Set<Account> accounts;
public long getId() {
return id;
}
public String getCustomerId() {
return customerId;
}
public int getClientId() {
return clientId;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Date getDateOfBirth() {
return dateOfBirth;
}
public String getSsn() {
return ssn;
}
public String getSocialInsurancenum() {
return socialInsurancenum;
}
public String getTin() {
return tin;
}
public String getPhoneNumber() {
return phoneNumber;
}
public Address getAddress() {
return address;
}
public Set<Account> getAccounts() {
return accounts;
}
public void setId(long id) {
this.id = id;
}
public void setCustomerId(String customerId) {
this.customerId = customerId;
}
public void setClientId(int clientId) {
this.clientId = clientId;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setDateOfBirth(Date dateOfBirth) {
this.dateOfBirth = dateOfBirth;
}
public void setSsn(String ssn) {
this.ssn = ssn;
}
public void setSocialInsurancenum(String socialInsurancenum) {
this.socialInsurancenum = socialInsurancenum;
}
public void setTin(String tin) {
this.tin = tin;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public void setAddress(Address address) {
this.address = address;
}
public void setAccounts(Set<Account> accounts) {
this.accounts = accounts;
}
@Override
public String toString() {
return "Customer [id=" + id + ", customerId=" + customerId + ", clientId=" + clientId + ", firstName=" + firstName
+ ", lastName=" + lastName + ", dateOfBirth=" + dateOfBirth + ", ssn=" + ssn + ", socialInsurancenum="
+ socialInsurancenum + ", tin=" + tin + ", phoneNumber=" + phoneNumber + ", address=" + address + ", accounts="
+ accounts + "]";
}
}