Subversion Repositories SmartDukaan

Rev

Rev 28966 | Rev 31860 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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