Subversion Repositories SmartDukaan

Rev

Rev 28763 | Rev 28774 | 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;
27
 
27595 tejbeer 28
	@Column(name = "employee_code")
29
	private String employeeCode;
28763 amit.gupta 30
 
31
	@Column(name = "ho_user")
32
	private String hoUser;
27595 tejbeer 33
 
34
	public String getEmployeeCode() {
35
		return employeeCode;
36
	}
37
 
38
	public void setEmployeeCode(String employeeCode) {
39
		this.employeeCode = employeeCode;
40
	}
41
 
25570 tejbeer 42
	@Column(name = "active")
43
	private Boolean active;
44
 
27595 tejbeer 45
	@Column(name = "first_name", nullable = false)
46
	private String firstName;
47
 
48
	@Column(name = "last_name")
49
	private String lastName;
50
 
51
	@Column(name = "mobile_number", unique = true, updatable = false)
52
	private String mobileNumber;
53
 
54
	@Column(name = "password")
55
	private String password;
56
 
57
	@Column(name = "created_timestamp")
58
	private LocalDateTime createdTimestamp;
59
 
60
	@Column(name = "last_login_timestap", unique = true, updatable = true)
61
	private LocalDateTime lastLoginTimestamp;
28769 amit.gupta 62
 
63
	public String getFullName() {
64
		return (this.firstName + this.lastName).trim();
65
	}
27595 tejbeer 66
 
25570 tejbeer 67
	public Boolean isActive() {
68
		return active;
69
	}
70
 
71
	public void setActive(Boolean active) {
72
		this.active = active;
73
	}
74
 
24479 amit.gupta 75
	public String getGmailId() {
76
		return gmailId;
77
	}
78
 
79
	public void setGmailId(String gmailId) {
80
		this.gmailId = gmailId;
81
	}
82
 
24383 amit.gupta 83
	public int getId() {
84
		return id;
85
	}
24330 amit.gupta 86
 
24383 amit.gupta 87
	public void setId(int id) {
88
		this.id = id;
89
	}
27595 tejbeer 90
 
27124 amit.gupta 91
	public String getName() {
92
		return this.firstName + " " + this.lastName;
93
	}
24383 amit.gupta 94
 
24330 amit.gupta 95
	public String getFirstName() {
96
		return firstName;
97
	}
98
 
99
	public void setFirstName(String firstName) {
100
		this.firstName = firstName;
101
	}
102
 
103
	public String getLastName() {
104
		return lastName;
105
	}
106
 
107
	public void setLastName(String lastName) {
108
		this.lastName = lastName;
109
	}
110
 
111
	public String getPassword() {
112
		return password;
113
	}
114
 
115
	public void setPassword(String password) {
116
		this.password = password;
117
	}
118
 
119
	@Override
120
	public int hashCode() {
121
		final int prime = 31;
122
		int result = 1;
27595 tejbeer 123
		result = prime * result + ((active == null) ? 0 : active.hashCode());
24383 amit.gupta 124
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
24330 amit.gupta 125
		result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
27595 tejbeer 126
		result = prime * result + ((employeeCode == null) ? 0 : employeeCode.hashCode());
24383 amit.gupta 127
		result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
24479 amit.gupta 128
		result = prime * result + ((gmailId == null) ? 0 : gmailId.hashCode());
24383 amit.gupta 129
		result = prime * result + id;
130
		result = prime * result + ((lastLoginTimestamp == null) ? 0 : lastLoginTimestamp.hashCode());
131
		result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
132
		result = prime * result + ((mobileNumber == null) ? 0 : mobileNumber.hashCode());
133
		result = prime * result + ((password == null) ? 0 : password.hashCode());
24330 amit.gupta 134
		return result;
135
	}
136
 
137
	@Override
138
	public boolean equals(Object obj) {
139
		if (this == obj)
140
			return true;
141
		if (obj == null)
142
			return false;
143
		if (getClass() != obj.getClass())
144
			return false;
145
		AuthUser other = (AuthUser) obj;
27595 tejbeer 146
		if (active == null) {
147
			if (other.active != null)
148
				return false;
149
		} else if (!active.equals(other.active))
150
			return false;
24383 amit.gupta 151
		if (createdTimestamp == null) {
152
			if (other.createdTimestamp != null)
153
				return false;
154
		} else if (!createdTimestamp.equals(other.createdTimestamp))
155
			return false;
24330 amit.gupta 156
		if (emailId == null) {
157
			if (other.emailId != null)
158
				return false;
159
		} else if (!emailId.equals(other.emailId))
160
			return false;
27595 tejbeer 161
		if (employeeCode == null) {
162
			if (other.employeeCode != null)
163
				return false;
164
		} else if (!employeeCode.equals(other.employeeCode))
165
			return false;
24383 amit.gupta 166
		if (firstName == null) {
167
			if (other.firstName != null)
168
				return false;
169
		} else if (!firstName.equals(other.firstName))
170
			return false;
24479 amit.gupta 171
		if (gmailId == null) {
172
			if (other.gmailId != null)
173
				return false;
174
		} else if (!gmailId.equals(other.gmailId))
175
			return false;
24383 amit.gupta 176
		if (id != other.id)
177
			return false;
178
		if (lastLoginTimestamp == null) {
179
			if (other.lastLoginTimestamp != null)
180
				return false;
181
		} else if (!lastLoginTimestamp.equals(other.lastLoginTimestamp))
182
			return false;
183
		if (lastName == null) {
184
			if (other.lastName != null)
185
				return false;
186
		} else if (!lastName.equals(other.lastName))
187
			return false;
188
		if (mobileNumber == null) {
189
			if (other.mobileNumber != null)
190
				return false;
191
		} else if (!mobileNumber.equals(other.mobileNumber))
192
			return false;
193
		if (password == null) {
194
			if (other.password != null)
195
				return false;
196
		} else if (!password.equals(other.password))
197
			return false;
24330 amit.gupta 198
		return true;
199
	}
200
 
201
	public String getEmailId() {
202
		return emailId;
203
	}
204
 
205
	public void setEmailId(String emailId) {
206
		this.emailId = emailId;
207
	}
208
 
209
	public String getMobileNumber() {
210
		return mobileNumber;
211
	}
212
 
213
	public void setMobileNumber(String mobileNumber) {
214
		this.mobileNumber = mobileNumber;
215
	}
216
 
217
	public LocalDateTime getCreatedTimestamp() {
218
		return createdTimestamp;
219
	}
220
 
221
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
222
		this.createdTimestamp = createdTimestamp;
223
	}
224
 
225
	public LocalDateTime getLastLoginTimestamp() {
226
		return lastLoginTimestamp;
227
	}
228
 
229
	public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
230
		this.lastLoginTimestamp = lastLoginTimestamp;
231
	}
232
 
25383 tejbeer 233
	public String getFormattedCreateTimestamp() {
234
		if (createdTimestamp == null) {
24383 amit.gupta 235
			return null;
236
		}
24402 amit.gupta 237
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
24383 amit.gupta 238
		return createdTimestamp.format(formatter);
25383 tejbeer 239
	}
24330 amit.gupta 240
 
241
	@Override
242
	public String toString() {
27595 tejbeer 243
		return "AuthUser [id=" + id + ", emailId=" + emailId + ", gmailId=" + gmailId + ", employeeCode=" + employeeCode
244
				+ ", active=" + active + ", firstName=" + firstName + ", lastName=" + lastName + ", mobileNumber="
245
				+ mobileNumber + ", password=" + password + ", createdTimestamp=" + createdTimestamp
246
				+ ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
24330 amit.gupta 247
	}
248
 
249
}