Subversion Repositories SmartDukaan

Rev

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