Subversion Repositories SmartDukaan

Rev

Rev 22845 | Rev 23202 | 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
 */
25
@Entity
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
 
50
	@Column(length = 10, name = "mobile_number")
51
	private String mobileNumber;
52
 
53
	@Column(name = "city", length = 128)
54
	private String city;
55
 
56
	@Column(name = "pincode", length = 6)
57
	private Integer pinCode;
58
 
22845 amit.gupta 59
	private String state;
60
 
22009 ashik.ali 61
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21545 ashik.ali 62
	@Column(name="created",updatable=false)
63
	private LocalDateTime createTimestamp;
64
 
22009 ashik.ali 65
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21545 ashik.ali 66
	@Column(name="modified")
22216 ashik.ali 67
	@UpdateTimestamp
21545 ashik.ali 68
	private LocalDateTime updateTimestamp;
69
 
22845 amit.gupta 70
	@Convert(converter = LocalDateTimeAttributeConverter.class)
71
	@Column(name="activation_time")
72
	private LocalDateTime activationTime;
73
 
74
	public LocalDateTime getActivationTime() {
75
		return activationTime;
76
	}
77
 
78
	public void setActivationTime(LocalDateTime activationTime) {
79
		this.activationTime = activationTime;
80
	}
81
 
82
	public int getStatus() {
83
		return status;
84
	}
85
 
21545 ashik.ali 86
	private String username;
87
	private String password;
88
	private boolean mobile_verified;
89
	private String referral_url;
90
	private String referrer;
91
 
92
	private int group_id;
93
	@Column(columnDefinition="tinyint(1) default 0")
94
	private int status;
95
	@Column(columnDefinition="tinyint(1) default 0")
96
	private boolean activated;
97
 
98
	public int getId() {
99
		return id;
100
	}
101
 
102
	public void setId(int id) {
103
		this.id = id;
104
	}
105
 
106
	public String getFirstName() {
107
		return firstName;
108
	}
109
	public void setFirstName(String firstName) {
110
		this.firstName = firstName;
111
	}
112
	public String getLastName() {
113
		return lastName;
114
	}
115
	public void setLastName(String lastName) {
116
		this.lastName = lastName;
117
	}
118
 
119
	public String getEmailId() {
120
		return emailId;
121
	}
122
	public void setEmailId(String emailId) {
123
		this.emailId = emailId;
124
	}
125
 
126
 
127
	public String getMobileNumber() {
128
		return mobileNumber;
129
	}
130
 
131
	public void setMobileNumber(String mobileNumber) {
132
		this.mobileNumber = mobileNumber;
133
	}
134
 
135
	public String getCity() {
136
		return city;
137
	}
138
	public void setCity(String city) {
139
		this.city = city;
140
	}
141
	public Integer getPinCode() {
142
		return pinCode;
143
	}
144
	public void setPinCode(Integer pinCode) {
145
		this.pinCode = pinCode;
146
	}
147
 
148
	public LocalDateTime getCreateTimestamp() {
149
		return createTimestamp;
150
	}
151
 
152
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
153
		this.createTimestamp = createTimestamp;
154
	}
155
 
156
	public LocalDateTime getUpdateTimestamp() {
157
		return updateTimestamp;
158
	}
159
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
160
		this.updateTimestamp = updateTimestamp;
161
	}
162
 
163
	public String getUsername() {
164
		return username;
165
	}
166
 
167
	public void setUsername(String username) {
168
		this.username = username;
169
	}
170
 
171
	public String getPassword() {
172
		return password;
173
	}
174
 
175
	public void setPassword(String password) {
176
		this.password = password;
177
	}
178
 
179
	public boolean isMobile_verified() {
180
		return mobile_verified;
181
	}
182
 
183
	public void setMobile_verified(boolean mobile_verified) {
184
		this.mobile_verified = mobile_verified;
185
	}
186
 
187
	public String getReferral_url() {
188
		return referral_url;
189
	}
190
 
191
	public void setReferral_url(String referral_url) {
192
		this.referral_url = referral_url;
193
	}
194
 
195
	public int getGroup_id() {
196
		return group_id;
197
	}
198
 
199
	public void setGroup_id(int group_id) {
200
		this.group_id = group_id;
201
	}
202
 
203
	public String getReferrer() {
204
		return referrer;
205
	}
206
 
207
	public void setReferrer(String referrer) {
208
		this.referrer = referrer;
209
	}
210
 
211
	public int isStatus() {
212
		return status;
213
	}
214
 
215
	public void setStatus(int status) {
216
		this.status = status;
217
	}
218
 
219
	public boolean isActivated() {
220
		return activated;
221
	}
222
 
223
	public void setActivated(boolean activated) {
224
		this.activated = activated;
225
	}
22859 ashik.ali 226
 
227
	public String getState() {
228
		return state;
229
	}
21545 ashik.ali 230
 
22859 ashik.ali 231
	public void setState(String state) {
232
		this.state = state;
233
	}
234
 
22009 ashik.ali 235
 
21545 ashik.ali 236
	@Override
237
	public int hashCode() {
238
		final int prime = 31;
239
		int result = 1;
22009 ashik.ali 240
		result = prime * result + id;
21545 ashik.ali 241
		return result;
242
	}
243
 
244
	@Override
245
	public boolean equals(Object obj) {
246
		if (this == obj)
247
			return true;
248
		if (obj == null)
249
			return false;
250
		if (getClass() != obj.getClass())
251
			return false;
252
		User other = (User) obj;
253
		if (id != other.id)
254
			return false;
255
		return true;
256
	}
257
 
21924 ashik.ali 258
	@Override
259
	public String toString() {
260
		return "User [id=" + id + ", firstName=" + firstName + ", lastName=" + lastName + ", emailId=" + emailId
261
				+ ", mobileNumber=" + mobileNumber + ", city=" + city + ", pinCode=" + pinCode + ", createTimestamp="
262
				+ createTimestamp + ", updateTimestamp=" + updateTimestamp + ", username=" + username + ", password="
263
				+ password + ", mobile_verified=" + mobile_verified + ", referral_url=" + referral_url + ", referrer="
22009 ashik.ali 264
				+ referrer + ", group_id=" + group_id + ", status=" + status + ", activated=" + activated  + "]";
21924 ashik.ali 265
	}
21545 ashik.ali 266
 
267
}