Subversion Repositories SmartDukaan

Rev

Rev 23221 | Rev 33305 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21720 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
21545 ashik.ali 2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
22009 ashik.ali 7
import javax.persistence.Convert;
21545 ashik.ali 8
import javax.persistence.Entity;
9
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
12
import javax.persistence.Table;
13
import javax.persistence.UniqueConstraint;
14
 
22216 ashik.ali 15
import org.hibernate.annotations.UpdateTimestamp;
16
 
22009 ashik.ali 17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
21545 ashik.ali 18
 
22009 ashik.ali 19
 
21545 ashik.ali 20
/**
21
 * This is used to store information of end user.
22
 * @author ashikali
23
 *
24
 */
23221 ashik.ali 25
@Entity(name = "dtrUser")
22580 ashik.ali 26
@Table(name="dtr.users", uniqueConstraints = {@UniqueConstraint(columnNames = {"email","mobile_number"})})
21545 ashik.ali 27
public class User implements Serializable{
28
 
29
 
30
	private static final long serialVersionUID = 1L;
31
 
32
	public User(){
33
 
34
	}
35
 
36
	@Id
37
	@Column(name="id",updatable=false, unique=true)
38
	@GeneratedValue(strategy = GenerationType.IDENTITY)
39
	private int id;
40
 
41
	@Column(name = "first_name", length = 64, nullable = false)
42
	private String firstName;
43
 
44
	@Column(name = "last_name", length = 64, nullable = false)
45
	private String lastName;
46
 
47
	@Column(length=25,name="email",unique=true)
48
	private String emailId;
49
 
23202 ashik.ali 50
	@Column(length = 25, name = "secondry_email_id", unique = true)
51
	private String secondryEmailId;
52
 
21545 ashik.ali 53
	@Column(length = 10, name = "mobile_number")
54
	private String mobileNumber;
55
 
56
	@Column(name = "city", length = 128)
57
	private String city;
58
 
59
	@Column(name = "pincode", length = 6)
60
	private Integer pinCode;
61
 
22845 amit.gupta 62
	private String state;
63
 
22009 ashik.ali 64
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21545 ashik.ali 65
	@Column(name="created",updatable=false)
66
	private LocalDateTime createTimestamp;
67
 
22009 ashik.ali 68
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21545 ashik.ali 69
	@Column(name="modified")
22216 ashik.ali 70
	@UpdateTimestamp
21545 ashik.ali 71
	private LocalDateTime updateTimestamp;
72
 
22845 amit.gupta 73
	@Convert(converter = LocalDateTimeAttributeConverter.class)
74
	@Column(name="activation_time")
75
	private LocalDateTime activationTime;
76
 
23418 ashik.ali 77
	@Convert(converter = LocalDateTimeAttributeConverter.class)
78
	@Column(name="login_timestamp")
79
	private LocalDateTime loginTimestamp;
80
 
81
	@Convert(converter = LocalDateTimeAttributeConverter.class)
82
	@Column(name="logout_timestamp")
83
	private LocalDateTime logoutTimestamp;
84
 
22845 amit.gupta 85
	public LocalDateTime getActivationTime() {
86
		return activationTime;
87
	}
88
 
89
	public void setActivationTime(LocalDateTime activationTime) {
90
		this.activationTime = activationTime;
91
	}
92
 
93
	public int getStatus() {
94
		return status;
95
	}
96
 
21545 ashik.ali 97
	private String username;
98
	private String password;
99
	private boolean mobile_verified;
100
	private String referral_url;
101
	private String referrer;
102
 
103
	private int group_id;
104
	@Column(columnDefinition="tinyint(1) default 0")
105
	private int status;
106
	@Column(columnDefinition="tinyint(1) default 0")
107
	private boolean activated;
108
 
23418 ashik.ali 109
	public LocalDateTime getLoginTimestamp() {
110
		return loginTimestamp;
111
	}
112
 
113
	public void setLoginTimestamp(LocalDateTime loginTimestamp) {
114
		this.loginTimestamp = loginTimestamp;
115
	}
116
 
117
	public LocalDateTime getLogoutTimestamp() {
118
		return logoutTimestamp;
119
	}
120
 
121
	public void setLogoutTimestamp(LocalDateTime logoutTimestamp) {
122
		this.logoutTimestamp = logoutTimestamp;
123
	}
124
 
21545 ashik.ali 125
	public int getId() {
126
		return id;
127
	}
128
 
129
	public void setId(int id) {
130
		this.id = id;
131
	}
132
 
133
	public String getFirstName() {
134
		return firstName;
135
	}
136
	public void setFirstName(String firstName) {
137
		this.firstName = firstName;
138
	}
139
	public String getLastName() {
140
		return lastName;
141
	}
142
	public void setLastName(String lastName) {
143
		this.lastName = lastName;
144
	}
145
 
146
	public String getEmailId() {
147
		return emailId;
148
	}
149
	public void setEmailId(String emailId) {
150
		this.emailId = emailId;
151
	}
152
 
23202 ashik.ali 153
	public String getSecondryEmailId() {
154
		return secondryEmailId;
155
	}
156
 
157
	public void setSecondryEmailId(String secondryEmailId) {
158
		this.secondryEmailId = secondryEmailId;
159
	}
21545 ashik.ali 160
 
161
	public String getMobileNumber() {
162
		return mobileNumber;
163
	}
164
 
165
	public void setMobileNumber(String mobileNumber) {
166
		this.mobileNumber = mobileNumber;
167
	}
168
 
169
	public String getCity() {
170
		return city;
171
	}
172
	public void setCity(String city) {
173
		this.city = city;
174
	}
175
	public Integer getPinCode() {
176
		return pinCode;
177
	}
178
	public void setPinCode(Integer pinCode) {
179
		this.pinCode = pinCode;
180
	}
181
 
182
	public LocalDateTime getCreateTimestamp() {
183
		return createTimestamp;
184
	}
185
 
186
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
187
		this.createTimestamp = createTimestamp;
188
	}
189
 
190
	public LocalDateTime getUpdateTimestamp() {
191
		return updateTimestamp;
192
	}
193
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
194
		this.updateTimestamp = updateTimestamp;
195
	}
196
 
197
	public String getUsername() {
198
		return username;
199
	}
200
 
201
	public void setUsername(String username) {
202
		this.username = username;
203
	}
204
 
205
	public String getPassword() {
206
		return password;
207
	}
208
 
209
	public void setPassword(String password) {
210
		this.password = password;
211
	}
212
 
213
	public boolean isMobile_verified() {
214
		return mobile_verified;
215
	}
216
 
217
	public void setMobile_verified(boolean mobile_verified) {
218
		this.mobile_verified = mobile_verified;
219
	}
220
 
221
	public String getReferral_url() {
222
		return referral_url;
223
	}
224
 
225
	public void setReferral_url(String referral_url) {
226
		this.referral_url = referral_url;
227
	}
228
 
229
	public int getGroup_id() {
230
		return group_id;
231
	}
232
 
233
	public void setGroup_id(int group_id) {
234
		this.group_id = group_id;
235
	}
236
 
237
	public String getReferrer() {
238
		return referrer;
239
	}
240
 
241
	public void setReferrer(String referrer) {
242
		this.referrer = referrer;
243
	}
244
 
245
	public int isStatus() {
246
		return status;
247
	}
248
 
249
	public void setStatus(int status) {
250
		this.status = status;
251
	}
252
 
253
	public boolean isActivated() {
254
		return activated;
255
	}
256
 
257
	public void setActivated(boolean activated) {
258
		this.activated = activated;
259
	}
22859 ashik.ali 260
 
261
	public String getState() {
262
		return state;
263
	}
21545 ashik.ali 264
 
22859 ashik.ali 265
	public void setState(String state) {
266
		this.state = state;
267
	}
268
 
22009 ashik.ali 269
 
21545 ashik.ali 270
	@Override
271
	public int hashCode() {
272
		final int prime = 31;
273
		int result = 1;
22009 ashik.ali 274
		result = prime * result + id;
21545 ashik.ali 275
		return result;
276
	}
277
 
278
	@Override
279
	public boolean equals(Object obj) {
280
		if (this == obj)
281
			return true;
282
		if (obj == null)
283
			return false;
284
		if (getClass() != obj.getClass())
285
			return false;
286
		User other = (User) obj;
287
		if (id != other.id)
288
			return false;
289
		return true;
290
	}
291
 
21924 ashik.ali 292
	@Override
293
	public String toString() {
294
		return "User [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", emailId=" + emailId
23202 ashik.ali 295
				+ ", secondryEmailId=" + secondryEmailId + ", mobileNumber=" + mobileNumber + ", city=" + city
296
				+ ", pinCode=" + pinCode + ", state=" + state + ", createTimestamp=" + createTimestamp
23418 ashik.ali 297
				+ ", updateTimestamp=" + updateTimestamp + ", activationTime=" + activationTime + ", loginTimestamp="
298
				+ loginTimestamp + ", logoutTimestamp=" + logoutTimestamp + ", username=" + username + ", password="
299
				+ password + ", mobile_verified=" + mobile_verified + ", referral_url=" + referral_url + ", referrer="
300
				+ referrer + ", group_id=" + group_id + ", status=" + status + ", activated=" + activated + "]";
21924 ashik.ali 301
	}
21545 ashik.ali 302
 
303
}