Subversion Repositories SmartDukaan

Rev

Rev 21720 | Rev 23297 | 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
 
22009 ashik.ali 105
 
21545 ashik.ali 106
	@Override
107
	public int hashCode() {
108
		final int prime = 31;
109
		int result = 1;
22009 ashik.ali 110
		result = prime * result + id;
21545 ashik.ali 111
		return result;
112
	}
113
	@Override
114
	public boolean equals(Object obj) {
115
		if (this == obj)
116
			return true;
117
		if (obj == null)
118
			return false;
119
		if (getClass() != obj.getClass())
120
			return false;
121
		Otp other = (Otp) obj;
122
		if (id != other.id)
123
			return false;
124
		return true;
125
	}
126
	@Override
127
	public String toString() {
128
		return "Otp [id=" + id + ", email=" + email + ", mobile=" + mobile + ", otp=" + otp + ", otpType=" + otpType
129
				+ ", createdOn=" + createdOn + ", expiryTimestamp=" + expiryTimestamp + ", expired=" + expired + "]";
130
	}
131
 
132
}