Subversion Repositories SmartDukaan

Rev

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

Rev 24479 Rev 25383
Line 11... Line 11...
11
import javax.persistence.Table;
11
import javax.persistence.Table;
12
 
12
 
13
@Entity
13
@Entity
14
@Table(name = "auth.auth_user", schema = "auth")
14
@Table(name = "auth.auth_user", schema = "auth")
15
public class AuthUser {
15
public class AuthUser {
16
	
16
 
17
	@Id
17
	@Id
18
	@Column
18
	@Column
19
	@GeneratedValue(strategy = GenerationType.IDENTITY)
19
	@GeneratedValue(strategy = GenerationType.IDENTITY)
20
	private int id;
20
	private int id;
21
 
21
 
22
	@Column(name = "email_id", unique=true, updatable=false)
22
	@Column(name = "email_id", unique = true, updatable = false)
23
	private String emailId;
23
	private String emailId;
24
	
24
 
25
	@Column(name="gmail_id", unique=true)
25
	@Column(name = "gmail_id", unique = true)
26
	private String gmailId; 
26
	private String gmailId;
27
	
27
 
28
	public String getGmailId() {
28
	public String getGmailId() {
29
		return gmailId;
29
		return gmailId;
30
	}
30
	}
31
 
31
 
32
 
-
 
33
 
-
 
34
	public void setGmailId(String gmailId) {
32
	public void setGmailId(String gmailId) {
35
		this.gmailId = gmailId;
33
		this.gmailId = gmailId;
36
	}
34
	}
37
 
35
 
38
 
-
 
39
 
-
 
40
	public int getId() {
36
	public int getId() {
41
		return id;
37
		return id;
42
	}
38
	}
43
 
39
 
44
 
-
 
45
 
-
 
46
	public void setId(int id) {
40
	public void setId(int id) {
47
		this.id = id;
41
		this.id = id;
48
	}
42
	}
49
 
43
 
50
 
-
 
51
 
-
 
52
	@Column(name="first_name", nullable=false)
44
	@Column(name = "first_name", nullable = false)
53
	private String firstName;
45
	private String firstName;
54
 
46
 
55
	@Column(name="last_name")
47
	@Column(name = "last_name")
56
	private String lastName;
48
	private String lastName;
57
	
49
 
58
	public String getFirstName() {
50
	public String getFirstName() {
59
		return firstName;
51
		return firstName;
60
	}
52
	}
61
 
53
 
62
 
-
 
63
 
-
 
64
	public void setFirstName(String firstName) {
54
	public void setFirstName(String firstName) {
65
		this.firstName = firstName;
55
		this.firstName = firstName;
66
	}
56
	}
67
 
57
 
68
 
-
 
69
 
-
 
70
	public String getLastName() {
58
	public String getLastName() {
71
		return lastName;
59
		return lastName;
72
	}
60
	}
73
 
61
 
74
 
-
 
75
 
-
 
76
	public void setLastName(String lastName) {
62
	public void setLastName(String lastName) {
77
		this.lastName = lastName;
63
		this.lastName = lastName;
78
	}
64
	}
79
 
65
 
80
 
-
 
81
 
-
 
82
	public String getPassword() {
66
	public String getPassword() {
83
		return password;
67
		return password;
84
	}
68
	}
85
 
69
 
86
 
-
 
87
 
-
 
88
	public void setPassword(String password) {
70
	public void setPassword(String password) {
89
		this.password = password;
71
		this.password = password;
90
	}
72
	}
91
 
73
 
92
 
-
 
93
 
-
 
94
	@Column(name = "mobile_number", unique=true, updatable=false)
74
	@Column(name = "mobile_number", unique = true, updatable = false)
95
	private String mobileNumber;
75
	private String mobileNumber;
96
	
76
 
97
	@Column(name = "password")
77
	@Column(name = "password")
98
	private String password;
78
	private String password;
99
	
79
 
100
	@Column(name = "created_timestamp")
80
	@Column(name = "created_timestamp")
101
	private LocalDateTime createdTimestamp;
81
	private LocalDateTime createdTimestamp;
102
	
82
 
103
	@Column(name = "last_login_timestap", unique=true, updatable=true)
83
	@Column(name = "last_login_timestap", unique = true, updatable = true)
104
	private LocalDateTime lastLoginTimestamp;
84
	private LocalDateTime lastLoginTimestamp;
105
	
-
 
106
	
-
 
107
 
85
 
108
	@Override
86
	@Override
109
	public int hashCode() {
87
	public int hashCode() {
110
		final int prime = 31;
88
		final int prime = 31;
111
		int result = 1;
89
		int result = 1;
Line 119... Line 97...
119
		result = prime * result + ((mobileNumber == null) ? 0 : mobileNumber.hashCode());
97
		result = prime * result + ((mobileNumber == null) ? 0 : mobileNumber.hashCode());
120
		result = prime * result + ((password == null) ? 0 : password.hashCode());
98
		result = prime * result + ((password == null) ? 0 : password.hashCode());
121
		return result;
99
		return result;
122
	}
100
	}
123
 
101
 
124
 
-
 
125
 
-
 
126
	@Override
102
	@Override
127
	public boolean equals(Object obj) {
103
	public boolean equals(Object obj) {
128
		if (this == obj)
104
		if (this == obj)
129
			return true;
105
			return true;
130
		if (obj == null)
106
		if (obj == null)
Line 175... Line 151...
175
		} else if (!password.equals(other.password))
151
		} else if (!password.equals(other.password))
176
			return false;
152
			return false;
177
		return true;
153
		return true;
178
	}
154
	}
179
 
155
 
180
 
-
 
181
 
-
 
182
	public String getEmailId() {
156
	public String getEmailId() {
183
		return emailId;
157
		return emailId;
184
	}
158
	}
185
 
159
 
186
 
-
 
187
 
-
 
188
	public void setEmailId(String emailId) {
160
	public void setEmailId(String emailId) {
189
		this.emailId = emailId;
161
		this.emailId = emailId;
190
	}
162
	}
191
 
163
 
192
 
-
 
193
 
-
 
194
	public String getMobileNumber() {
164
	public String getMobileNumber() {
195
		return mobileNumber;
165
		return mobileNumber;
196
	}
166
	}
197
 
167
 
198
 
-
 
199
 
-
 
200
	public void setMobileNumber(String mobileNumber) {
168
	public void setMobileNumber(String mobileNumber) {
201
		this.mobileNumber = mobileNumber;
169
		this.mobileNumber = mobileNumber;
202
	}
170
	}
203
 
171
 
204
 
-
 
205
 
-
 
206
	public LocalDateTime getCreatedTimestamp() {
172
	public LocalDateTime getCreatedTimestamp() {
207
		return createdTimestamp;
173
		return createdTimestamp;
208
	}
174
	}
209
 
175
 
210
 
-
 
211
 
-
 
212
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
176
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
213
		this.createdTimestamp = createdTimestamp;
177
		this.createdTimestamp = createdTimestamp;
214
	}
178
	}
215
 
179
 
216
 
-
 
217
 
-
 
218
	public LocalDateTime getLastLoginTimestamp() {
180
	public LocalDateTime getLastLoginTimestamp() {
219
		return lastLoginTimestamp;
181
		return lastLoginTimestamp;
220
	}
182
	}
221
 
183
 
222
 
-
 
223
 
-
 
224
	public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
184
	public void setLastLoginTimestamp(LocalDateTime lastLoginTimestamp) {
225
		this.lastLoginTimestamp = lastLoginTimestamp;
185
		this.lastLoginTimestamp = lastLoginTimestamp;
226
	}
186
	}
227
 
187
 
228
	public String getFormattedCreateTimestamp(){
188
	public String getFormattedCreateTimestamp() {
229
		if(createdTimestamp == null){
189
		if (createdTimestamp == null) {
230
			return null;
190
			return null;
231
		}
191
		}
232
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
192
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
233
		return createdTimestamp.format(formatter);
193
		return createdTimestamp.format(formatter);
234
    }
194
	}
235
 
195
 
236
	@Override
196
	@Override
237
	public String toString() {
197
	public String toString() {
238
		return "AuthUser [id=" + id + ", emailId=" + emailId + ", gmailId=" + gmailId + ", firstName=" + firstName
198
		return "AuthUser [id=" + id + ", emailId=" + emailId + ", gmailId=" + gmailId + ", firstName=" + firstName
239
				+ ", lastName=" + lastName + ", mobileNumber=" + mobileNumber + ", password=" + password
199
				+ ", lastName=" + lastName + ", mobileNumber=" + mobileNumber + ", password=" + password
240
				+ ", createdTimestamp=" + createdTimestamp + ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
200
				+ ", createdTimestamp=" + createdTimestamp + ", lastLoginTimestamp=" + lastLoginTimestamp + "]";
241
	}
201
	}
242
	
-
 
243
 
202
 
244
	
-
 
245
}
203
}