Subversion Repositories SmartDukaan

Rev

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