Subversion Repositories SmartDukaan

Rev

Rev 29209 | Rev 32170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 29209 Rev 31860
Line 9... Line 9...
9
import javax.persistence.GenerationType;
9
import javax.persistence.GenerationType;
10
import javax.persistence.Id;
10
import javax.persistence.Id;
11
import javax.persistence.Table;
11
import javax.persistence.Table;
12
 
12
 
13
@Entity
13
@Entity
14
@Table(name = "auth.auth_user", schema = "auth")
14
@Table(name = "auth.auth_user")
15
public class AuthUser {
15
public class AuthUser {
16
 
16
 
17
	@Id
17
    @Id
18
	@Column
18
    @Column
19
	@GeneratedValue(strategy = GenerationType.IDENTITY)
19
    @GeneratedValue(strategy = GenerationType.IDENTITY)
20
	private int id;
20
    private int id;
21
 
21
 
22
	@Column(name = "email_id", unique = true, updatable = false)
22
    @Column(name = "`email_id`", unique = true, updatable = false)
23
	private String emailId;
23
    private String emailId;
24
 
24
 
25
	@Column(name = "gmail_id", unique = true)
25
    @Column(name = "gmail_id", unique = true)
26
	private String gmailId;
26
    private String gmailId;
27
	
27
 
28
	@Column(name = "manager_id")
28
    @Column(name = "manager_id")
29
	private int managerId;
29
    private int managerId;
30
 
30
 
31
	@Column(name = "employee_code")
31
    @Column(name = "employee_code")
32
	private String employeeCode;
32
    private String employeeCode;
33
	
33
 
34
	@Column(name = "ho_user")
34
    @Column(name = "ho_user")
35
	private boolean hoUser;
35
    private boolean hoUser;
36
	
36
 
37
	@Column(name = "active")
37
    @Column(name = "`active`")
38
	private Boolean active;
38
    private Boolean active;
39
 
39
 
40
	@Column(name = "first_name", nullable = false)
40
    @Column(name = "first_name", nullable = false)
41
	private String firstName;
41
    private String firstName;
42
 
42
 
43
	@Column(name = "last_name")
43
    @Column(name = "last_name")
44
	private String lastName;
44
    private String lastName;
45
 
45
 
46
	@Column(name = "mobile_number", unique = true, updatable = false)
46
    @Column(name = "mobile_number", unique = true, updatable = false)
47
	private String mobileNumber;
47
    private String mobileNumber;
48
 
48
 
49
	@Column(name = "password")
49
    @Column(name = "`password`")
50
	private String password;
50
    private String password;
51
 
51
 
52
	@Column(name = "created_timestamp")
52
    @Column(name = "created_timestamp")
53
	private LocalDateTime createdTimestamp;
53
    private LocalDateTime createdTimestamp;
54
 
54
 
55
	@Column(name = "last_login_timestap", unique = true, updatable = true)
55
    @Column(name = "last_login_timestap", unique = true, updatable = true)
56
	private LocalDateTime lastLoginTimestamp;
56
    private LocalDateTime lastLoginTimestamp;
57
 
57
 
58
	public String getEmployeeCode() {
58
    public String getEmployeeCode() {
59
		return employeeCode;
59
        return employeeCode;
60
	}
60
    }
61
	
61
 
62
 
62
 
63
	public boolean isHoUser() {
63
    public boolean isHoUser() {
64
		return hoUser;
64
        return hoUser;
65
	}
65
    }
66
 
66
 
67
 
67
 
68
 
68
    public void setHoUser(boolean hoUser) {
69
	public void setHoUser(boolean hoUser) {
69
        this.hoUser = hoUser;
70
		this.hoUser = hoUser;
70
    }
71
	}
71
 
72
 
72
 
73
 
73
    public Boolean getActive() {
74
 
74
        return active;
75
	public Boolean getActive() {
75
    }
76
		return active;
76
 
77
	}
77
 
78
 
78
    public void setEmployeeCode(String employeeCode) {
79
 
79
        this.employeeCode = employeeCode;
80
 
80
    }
81
	public void setEmployeeCode(String employeeCode) {
81
 
82
		this.employeeCode = employeeCode;
82
 
83
	}
83
    public int getManagerId() {
84
 
84
        return managerId;
85
	
85
    }
86
	
86
 
87
	public int getManagerId() {
87
 
88
		return managerId;
88
    public void setManagerId(int managerId) {
89
	}
89
        this.managerId = managerId;
90
 
90
    }
91
 
91
 
92
	public void setManagerId(int managerId) {
92
 
93
		this.managerId = managerId;
93
    public String getFullName() {
94
	}
94
        return (this.firstName + " " + this.lastName).trim();
95
 
95
    }
96
 
96
 
97
	public String getFullName() {
97
    public Boolean isActive() {
98
		return (this.firstName + " " + this.lastName).trim();
98
        return active;
99
	}
99
    }
100
 
100
 
101
	public Boolean isActive() {
101
    public void setActive(Boolean active) {
102
		return active;
102
        this.active = active;
103
	}
103
    }
104
 
104
 
105
	public void setActive(Boolean active) {
105
    public String getGmailId() {
106
		this.active = active;
106
        return gmailId;
107
	}
107
    }
108
 
108
 
109
	public String getGmailId() {
109
    public void setGmailId(String gmailId) {
110
		return gmailId;
110
        this.gmailId = gmailId;
111
	}
111
    }
112
 
112
 
113
	public void setGmailId(String gmailId) {
113
    public int getId() {
114
		this.gmailId = gmailId;
114
        return id;
115
	}
115
    }
116
 
116
 
117
	public int getId() {
117
    public void setId(int id) {
118
		return id;
118
        this.id = id;
119
	}
119
    }
120
 
120
 
121
	public void setId(int id) {
121
    public String getName() {
122
		this.id = id;
122
        return this.firstName + " " + this.lastName;
123
	}
123
    }
124
 
124
 
125
	public String getName() {
125
    public String getFirstName() {
126
		return this.firstName + " " + this.lastName;
126
        return firstName;
127
	}
127
    }
128
 
128
 
129
	public String getFirstName() {
129
    public void setFirstName(String firstName) {
130
		return firstName;
130
        this.firstName = firstName;
131
	}
131
    }
132
 
132
 
133
	public void setFirstName(String firstName) {
133
    public String getLastName() {
134
		this.firstName = firstName;
134
        return lastName;
135
	}
135
    }
136
 
136
 
137
	public String getLastName() {
137
    public void setLastName(String lastName) {
138
		return lastName;
138
        this.lastName = lastName;
139
	}
139
    }
140
 
140
 
141
	public void setLastName(String lastName) {
141
    public String getPassword() {
142
		this.lastName = lastName;
142
        return password;
143
	}
143
    }
144
 
144
 
145
	public String getPassword() {
145
    public void setPassword(String password) {
146
		return password;
146
        this.password = password;
147
	}
147
    }
148
 
148
 
149
	public void setPassword(String password) {
149
    @Override
150
		this.password = password;
150
    public int hashCode() {
151
	}
151
        final int prime = 31;
152
 
152
        int result = 1;
153
	@Override
153
        result = prime * result + ((active == null) ? 0 : active.hashCode());
154
	public int hashCode() {
154
        result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
155
		final int prime = 31;
155
        result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
156
		int result = 1;
156
        result = prime * result + ((employeeCode == null) ? 0 : employeeCode.hashCode());
157
		result = prime * result + ((active == null) ? 0 : active.hashCode());
157
        result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
158
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
158
        result = prime * result + ((gmailId == null) ? 0 : gmailId.hashCode());
159
		result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
159
        result = prime * result + id;
160
		result = prime * result + ((employeeCode == null) ? 0 : employeeCode.hashCode());
160
        result = prime * result + ((lastLoginTimestamp == null) ? 0 : lastLoginTimestamp.hashCode());
161
		result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
161
        result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
162
		result = prime * result + ((gmailId == null) ? 0 : gmailId.hashCode());
162
        result = prime * result + ((mobileNumber == null) ? 0 : mobileNumber.hashCode());
163
		result = prime * result + id;
163
        result = prime * result + ((password == null) ? 0 : password.hashCode());
164
		result = prime * result + ((lastLoginTimestamp == null) ? 0 : lastLoginTimestamp.hashCode());
164
        return result;
165
		result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
165
    }
166
		result = prime * result + ((mobileNumber == null) ? 0 : mobileNumber.hashCode());
166
 
167
		result = prime * result + ((password == null) ? 0 : password.hashCode());
167
    @Override
168
		return result;
168
    public boolean equals(Object obj) {
169
	}
169
        if (this == obj)
170
 
170
            return true;
171
	@Override
171
        if (obj == null)
172
	public boolean equals(Object obj) {
172
            return false;
173
		if (this == obj)
173
        if (getClass() != obj.getClass())
174
			return true;
174
            return false;
175
		if (obj == null)
175
        AuthUser other = (AuthUser) obj;
176
			return false;
176
        if (active == null) {
177
		if (getClass() != obj.getClass())
177
            if (other.active != null)
178
			return false;
178
                return false;
179
		AuthUser other = (AuthUser) obj;
179
        } else if (!active.equals(other.active))
180
		if (active == null) {
180
            return false;
181
			if (other.active != null)
181
        if (createdTimestamp == null) {
182
				return false;
182
            if (other.createdTimestamp != null)
183
		} else if (!active.equals(other.active))
183
                return false;
184
			return false;
184
        } else if (!createdTimestamp.equals(other.createdTimestamp))
185
		if (createdTimestamp == null) {
185
            return false;
186
			if (other.createdTimestamp != null)
186
        if (emailId == null) {
187
				return false;
187
            if (other.emailId != null)
188
		} else if (!createdTimestamp.equals(other.createdTimestamp))
188
                return false;
189
			return false;
189
        } else if (!emailId.equals(other.emailId))
190
		if (emailId == null) {
190
            return false;
191
			if (other.emailId != null)
191
        if (employeeCode == null) {
192
				return false;
192
            if (other.employeeCode != null)
193
		} else if (!emailId.equals(other.emailId))
193
                return false;
194
			return false;
194
        } else if (!employeeCode.equals(other.employeeCode))
195
		if (employeeCode == null) {
195
            return false;
196
			if (other.employeeCode != null)
196
        if (firstName == null) {
197
				return false;
197
            if (other.firstName != null)
198
		} else if (!employeeCode.equals(other.employeeCode))
198
                return false;
199
			return false;
199
        } else if (!firstName.equals(other.firstName))
200
		if (firstName == null) {
200
            return false;
201
			if (other.firstName != null)
201
        if (gmailId == null) {
202
				return false;
202
            if (other.gmailId != null)
203
		} else if (!firstName.equals(other.firstName))
203
                return false;
204
			return false;
204
        } else if (!gmailId.equals(other.gmailId))
205
		if (gmailId == null) {
205
            return false;
206
			if (other.gmailId != null)
206
        if (id != other.id)
207
				return false;
207
            return false;
208
		} else if (!gmailId.equals(other.gmailId))
208
        if (lastLoginTimestamp == null) {
209
			return false;
209
            if (other.lastLoginTimestamp != null)
210
		if (id != other.id)
210
                return false;
211
			return false;
211
        } else if (!lastLoginTimestamp.equals(other.lastLoginTimestamp))
212
		if (lastLoginTimestamp == null) {
212
            return false;
213
			if (other.lastLoginTimestamp != null)
213
        if (lastName == null) {
214
				return false;
214
            if (other.lastName != null)
215
		} else if (!lastLoginTimestamp.equals(other.lastLoginTimestamp))
215
                return false;
216
			return false;
216
        } else if (!lastName.equals(other.lastName))
217
		if (lastName == null) {
217
            return false;
218
			if (other.lastName != null)
218
        if (mobileNumber == null) {
219
				return false;
219
            if (other.mobileNumber != null)
220
		} else if (!lastName.equals(other.lastName))
220
                return false;
221
			return false;
221
        } else if (!mobileNumber.equals(other.mobileNumber))
222
		if (mobileNumber == null) {
222
            return false;
223
			if (other.mobileNumber != null)
223
        if (password == null) {
224
				return false;
224
            if (other.password != null)
225
		} else if (!mobileNumber.equals(other.mobileNumber))
225
                return false;
226
			return false;
226
        } else if (!password.equals(other.password))
227
		if (password == null) {
227
            return false;
228
			if (other.password != null)
228
        return true;
229
				return false;
229
    }
230
		} else if (!password.equals(other.password))
230
 
231
			return false;
231
    public String getEmailId() {
232
		return true;
232
        return emailId;
233
	}
233
    }
234
 
234
 
235
	public String getEmailId() {
235
    public void setEmailId(String emailId) {
236
		return emailId;
236
        this.emailId = emailId;
237
	}
237
    }
238
 
238
 
239
	public void setEmailId(String emailId) {
239
    public String getMobileNumber() {
240
		this.emailId = emailId;
240
        return mobileNumber;
241
	}
241
    }
242
 
242
 
243
	public String getMobileNumber() {
243
    public void setMobileNumber(String mobileNumber) {
244
		return mobileNumber;
244
        this.mobileNumber = mobileNumber;
245
	}
245
    }
246
 
246
 
247
	public void setMobileNumber(String mobileNumber) {
247
    public LocalDateTime getCreatedTimestamp() {
248
		this.mobileNumber = mobileNumber;
248
        return createdTimestamp;
249
	}
249
    }
250
 
250
 
251
	public LocalDateTime getCreatedTimestamp() {
251
    public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
252
		return createdTimestamp;
252
        this.createdTimestamp = createdTimestamp;
253
	}
253
    }
254
 
254
 
255
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
255
    public LocalDateTime getLastLoginTimestamp() {
256
		this.createdTimestamp = createdTimestamp;
256
        return lastLoginTimestamp;
257
	}
257
    }
258
 
258
 
259
	public LocalDateTime getLastLoginTimestamp() {
259
    public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
260
		return lastLoginTimestamp;
260
        this.lastLoginTimestamp = lastLoginTimestamp;
261
	}
261
    }
262
 
262
 
263
	public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
263
    public String getFormattedCreateTimestamp() {
264
		this.lastLoginTimestamp = lastLoginTimestamp;
264
        if (createdTimestamp == null) {
265
	}
265
            return null;
266
 
266
        }
267
	public String getFormattedCreateTimestamp() {
267
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
268
		if (createdTimestamp == null) {
268
        return createdTimestamp.format(formatter);
269
			return null;
269
    }
270
		}
270
 
271
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
271
    @Override
272
		return createdTimestamp.format(formatter);
272
    public String toString() {
273
	}
273
        return "AuthUser [id=" + id + ", emailId=" + emailId + ", gmailId=" + gmailId + ", employeeCode=" + employeeCode + ", active=" + active + ", firstName=" + firstName + ", lastName=" + lastName + ", mobileNumber=" + mobileNumber + ", password=" + password + ", createdTimestamp=" + createdTimestamp + ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
274
 
274
    }
275
	@Override
-
 
276
	public String toString() {
-
 
277
		return "AuthUser [id=" + id + ", emailId=" + emailId + ", gmailId=" + gmailId + ", employeeCode=" + employeeCode
-
 
278
				+ ", active=" + active + ", firstName=" + firstName + ", lastName=" + lastName + ", mobileNumber="
-
 
279
				+ mobileNumber + ", password=" + password + ", createdTimestamp=" + createdTimestamp
-
 
280
				+ ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
-
 
281
	}
-
 
282
 
275
 
283
}
276
}