Subversion Repositories SmartDukaan

Rev

Rev 24330 | Rev 24402 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24330 Rev 24383
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.auth;
1
package com.spice.profitmandi.dao.entity.auth;
2
 
2
 
3
import java.time.LocalDateTime;
3
import java.time.LocalDateTime;
-
 
4
import java.time.format.DateTimeFormatter;
4
 
5
 
5
import javax.persistence.Column;
6
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.Entity;
-
 
8
import javax.persistence.GeneratedValue;
-
 
9
import javax.persistence.GenerationType;
7
import javax.persistence.Id;
10
import javax.persistence.Id;
8
import javax.persistence.Table;
11
import javax.persistence.Table;
9
 
12
 
10
@Entity
13
@Entity
11
@Table(name = "auth.auth_user", schema = "auth")
14
@Table(name = "auth.auth_user", schema = "auth")
12
public class AuthUser {
15
public class AuthUser {
13
	
16
	
14
	@Id
17
	@Id
-
 
18
	@Column
-
 
19
	@GeneratedValue(strategy = GenerationType.IDENTITY)
-
 
20
	private int id;
-
 
21
 
15
	@Column(name = "email_id", unique=true, updatable=false)
22
	@Column(name = "email_id", unique=true, updatable=false)
16
	private String emailId;
23
	private String emailId;
-
 
24
	
-
 
25
	public int getId() {
-
 
26
		return id;
-
 
27
	}
-
 
28
 
-
 
29
 
-
 
30
 
-
 
31
	public void setId(int id) {
-
 
32
		this.id = id;
-
 
33
	}
-
 
34
 
-
 
35
 
17
 
36
 
18
	@Column(name="first_name", nullable=false)
37
	@Column(name="first_name", nullable=false)
19
	private String firstName;
38
	private String firstName;
20
 
39
 
21
	@Column(name="last_name")
40
	@Column(name="last_name")
Line 55... Line 74...
55
		this.password = password;
74
		this.password = password;
56
	}
75
	}
57
 
76
 
58
 
77
 
59
 
78
 
60
	@Column(name = "mobile_number", unique=true)
79
	@Column(name = "mobile_number", unique=true, updatable=false)
61
	private String mobileNumber;
80
	private String mobileNumber;
62
	
81
	
63
	@Column(name = "password")
82
	@Column(name = "password")
64
	private String password;
83
	private String password;
65
	
84
	
Line 73... Line 92...
73
 
92
 
74
	@Override
93
	@Override
75
	public int hashCode() {
94
	public int hashCode() {
76
		final int prime = 31;
95
		final int prime = 31;
77
		int result = 1;
96
		int result = 1;
-
 
97
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
78
		result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
98
		result = prime * result + ((emailId == null) ? 0 : emailId.hashCode());
-
 
99
		result = prime * result + ((firstName == null) ? 0 : firstName.hashCode());
-
 
100
		result = prime * result + id;
-
 
101
		result = prime * result + ((lastLoginTimestamp == null) ? 0 : lastLoginTimestamp.hashCode());
-
 
102
		result = prime * result + ((lastName == null) ? 0 : lastName.hashCode());
-
 
103
		result = prime * result + ((mobileNumber == null) ? 0 : mobileNumber.hashCode());
-
 
104
		result = prime * result + ((password == null) ? 0 : password.hashCode());
79
		return result;
105
		return result;
80
	}
106
	}
81
 
107
 
82
 
108
 
83
 
109
 
Line 88... Line 114...
88
		if (obj == null)
114
		if (obj == null)
89
			return false;
115
			return false;
90
		if (getClass() != obj.getClass())
116
		if (getClass() != obj.getClass())
91
			return false;
117
			return false;
92
		AuthUser other = (AuthUser) obj;
118
		AuthUser other = (AuthUser) obj;
-
 
119
		if (createdTimestamp == null) {
-
 
120
			if (other.createdTimestamp != null)
-
 
121
				return false;
-
 
122
		} else if (!createdTimestamp.equals(other.createdTimestamp))
-
 
123
			return false;
93
		if (emailId == null) {
124
		if (emailId == null) {
94
			if (other.emailId != null)
125
			if (other.emailId != null)
95
				return false;
126
				return false;
96
		} else if (!emailId.equals(other.emailId))
127
		} else if (!emailId.equals(other.emailId))
97
			return false;
128
			return false;
-
 
129
		if (firstName == null) {
-
 
130
			if (other.firstName != null)
-
 
131
				return false;
-
 
132
		} else if (!firstName.equals(other.firstName))
-
 
133
			return false;
-
 
134
		if (id != other.id)
-
 
135
			return false;
-
 
136
		if (lastLoginTimestamp == null) {
-
 
137
			if (other.lastLoginTimestamp != null)
-
 
138
				return false;
-
 
139
		} else if (!lastLoginTimestamp.equals(other.lastLoginTimestamp))
-
 
140
			return false;
-
 
141
		if (lastName == null) {
-
 
142
			if (other.lastName != null)
-
 
143
				return false;
-
 
144
		} else if (!lastName.equals(other.lastName))
-
 
145
			return false;
-
 
146
		if (mobileNumber == null) {
-
 
147
			if (other.mobileNumber != null)
-
 
148
				return false;
-
 
149
		} else if (!mobileNumber.equals(other.mobileNumber))
-
 
150
			return false;
-
 
151
		if (password == null) {
-
 
152
			if (other.password != null)
-
 
153
				return false;
-
 
154
		} else if (!password.equals(other.password))
-
 
155
			return false;
98
		return true;
156
		return true;
99
	}
157
	}
100
 
158
 
101
 
159
 
102
 
160
 
Line 144... Line 202...
144
 
202
 
145
	public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
203
	public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
146
		this.lastLoginTimestamp = lastLoginTimestamp;
204
		this.lastLoginTimestamp = lastLoginTimestamp;
147
	}
205
	}
148
 
206
 
-
 
207
	public String getFormattedCreateTimestamp(){
-
 
208
		if(createdTimestamp == null){
-
 
209
			return null;
149
 
210
		}
-
 
211
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
-
 
212
		return createdTimestamp.format(formatter);
-
 
213
    }
150
 
214
 
151
	@Override
215
	@Override
152
	public String toString() {
216
	public String toString() {
153
		return "AuthUser [emailId=" + emailId + ", firstName=" + firstName + ", lastName=" + lastName
217
		return "AuthUser [id=" + id + ", emailId=" + emailId + ", firstName=" + firstName + ", lastName=" + lastName
154
				+ ", mobileNumber=" + mobileNumber + ", password=" + password + ", createdTimestamp=" + createdTimestamp
218
				+ ", mobileNumber=" + mobileNumber + ", password=" + password + ", createdTimestamp=" + createdTimestamp
155
				+ ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
219
				+ ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
156
	}
220
	}
157
	
221
	
158
 
222