Subversion Repositories SmartDukaan

Rev

Rev 21596 | Rev 22009 | 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.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Convert;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
 
15
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
21720 ashik.ali 16
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
21545 ashik.ali 17
 
18
@Entity
21596 ashik.ali 19
@Table(name="dtr.otp",schema="dtr")
21545 ashik.ali 20
public class Otp{
21
	/**
22
	 * 
23
	 */
24
	@Id
25
	@GeneratedValue(strategy=GenerationType.IDENTITY)
26
	private int id;
27
	private String email;
28
	@Column(length = 10)
29
	private String mobile;
30
	@Column(length = 5)
31
	private String otp;
32
	@Enumerated(EnumType.STRING)
33
	private OtpType otpType;
34
	@Convert(converter = LocalDateTimeAttributeConverter.class)
35
	private LocalDateTime createdOn;
36
	@Convert(converter = LocalDateTimeAttributeConverter.class)
37
	private LocalDateTime expiryTimestamp;
38
	@Column(columnDefinition="tinyint(1) default 0")
39
	private boolean expired;
40
	@Column(columnDefinition="tinyint(1) default 0")
41
	private boolean verified;
42
	private int tryCount;
43
 
44
	public int getTryCount() {
45
		return tryCount;
46
	}
47
	public void setTryCount(int tryCount) {
48
		this.tryCount = tryCount;
49
	}
50
	public boolean isVerified() {
51
		return verified;
52
	}
53
	public void setVerified(boolean verified) {
54
		this.verified = verified;
55
	}
56
	public int getId() {
57
		return id;
58
	}
59
	public void setId(int id) {
60
		this.id = id;
61
	}
62
	public String getOtp() {
63
		return otp;
64
	}
65
	public void setOtp(String otp) {
66
		this.otp = otp;
67
	}
68
	public OtpType getOtpType() {
69
		return otpType;
70
	}
71
	public void setOtpType(OtpType otpType) {
72
		this.otpType = otpType;
73
	}
74
	public LocalDateTime getCreatedOn() {
75
		return createdOn;
76
	}
77
	public void setCreatedOn(LocalDateTime createdOn) {
78
		this.createdOn = createdOn;
79
	}
80
	public LocalDateTime getExpiryTimestamp() {
81
		return expiryTimestamp;
82
	}
83
	public void setExpiryTimestamp(LocalDateTime expiryTimestamp) {
84
		this.expiryTimestamp = expiryTimestamp;
85
	}
86
	public boolean isExpired() {
87
		return expired;
88
	}
89
	public void setExpired(boolean expired) {
90
		this.expired = expired;
91
	}
92
	public String getEmail() {
93
		return email;
94
	}
95
	public void setEmail(String email) {
96
		this.email = email;
97
	}
98
	public String getMobile() {
99
		return mobile;
100
	}
101
	public void setMobile(String mobile) {
102
		this.mobile = mobile;
103
	}
104
 
105
	@Override
106
	public int hashCode() {
107
		final int prime = 31;
108
		int result = 1;
109
		result = prime * result + ((createdOn == null) ? 0 : createdOn.hashCode());
110
		result = prime * result + ((email == null) ? 0 : email.hashCode());
111
		result = prime * result + (expired ? 1231 : 1237);
112
		result = prime * result + ((expiryTimestamp == null) ? 0 : expiryTimestamp.hashCode());
113
		result = prime * result + (int) (id ^ (id >>> 32));
114
		result = prime * result + ((mobile == null) ? 0 : mobile.hashCode());
115
		result = prime * result + ((otp == null) ? 0 : otp.hashCode());
116
		result = prime * result + ((otpType == null) ? 0 : otpType.hashCode());
117
		return result;
118
	}
119
	@Override
120
	public boolean equals(Object obj) {
121
		if (this == obj)
122
			return true;
123
		if (obj == null)
124
			return false;
125
		if (getClass() != obj.getClass())
126
			return false;
127
		Otp other = (Otp) obj;
128
		if (createdOn == null) {
129
			if (other.createdOn != null)
130
				return false;
131
		} else if (!createdOn.equals(other.createdOn))
132
			return false;
133
		if (email == null) {
134
			if (other.email != null)
135
				return false;
136
		} else if (!email.equals(other.email))
137
			return false;
138
		if (expired != other.expired)
139
			return false;
140
		if (expiryTimestamp == null) {
141
			if (other.expiryTimestamp != null)
142
				return false;
143
		} else if (!expiryTimestamp.equals(other.expiryTimestamp))
144
			return false;
145
		if (id != other.id)
146
			return false;
147
		if (mobile == null) {
148
			if (other.mobile != null)
149
				return false;
150
		} else if (!mobile.equals(other.mobile))
151
			return false;
152
		if (otp == null) {
153
			if (other.otp != null)
154
				return false;
155
		} else if (!otp.equals(other.otp))
156
			return false;
157
		if (otpType != other.otpType)
158
			return false;
159
		return true;
160
	}
161
	@Override
162
	public String toString() {
163
		return "Otp [id=" + id + ", email=" + email + ", mobile=" + mobile + ", otp=" + otp + ", otpType=" + otpType
164
				+ ", createdOn=" + createdOn + ", expiryTimestamp=" + expiryTimestamp + ", expired=" + expired + "]";
165
	}
166
 
167
}