Subversion Repositories SmartDukaan

Rev

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