Subversion Repositories SmartDukaan

Rev

Rev 22009 | Rev 26783 | 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;
23297 ashik.ali 27
 
21545 ashik.ali 28
	private String email;
23297 ashik.ali 29
 
21545 ashik.ali 30
	@Column(length = 10)
31
	private String mobile;
23297 ashik.ali 32
 
21545 ashik.ali 33
	@Column(length = 5)
34
	private String otp;
23297 ashik.ali 35
 
21545 ashik.ali 36
	@Enumerated(EnumType.STRING)
37
	private OtpType otpType;
23297 ashik.ali 38
 
21545 ashik.ali 39
	@Convert(converter = LocalDateTimeAttributeConverter.class)
40
	private LocalDateTime createdOn;
23297 ashik.ali 41
 
21545 ashik.ali 42
	@Convert(converter = LocalDateTimeAttributeConverter.class)
43
	private LocalDateTime expiryTimestamp;
23297 ashik.ali 44
 
21545 ashik.ali 45
	@Column(columnDefinition="tinyint(1) default 0")
46
	private boolean expired;
23297 ashik.ali 47
 
21545 ashik.ali 48
	@Column(columnDefinition="tinyint(1) default 0")
49
	private boolean verified;
23297 ashik.ali 50
 
21545 ashik.ali 51
	private int tryCount;
52
 
53
	public int getTryCount() {
54
		return tryCount;
55
	}
56
	public void setTryCount(int tryCount) {
57
		this.tryCount = tryCount;
58
	}
59
	public boolean isVerified() {
60
		return verified;
61
	}
62
	public void setVerified(boolean verified) {
63
		this.verified = verified;
64
	}
65
	public int getId() {
66
		return id;
67
	}
68
	public void setId(int id) {
69
		this.id = id;
70
	}
71
	public String getOtp() {
72
		return otp;
73
	}
74
	public void setOtp(String otp) {
75
		this.otp = otp;
76
	}
77
	public OtpType getOtpType() {
78
		return otpType;
79
	}
80
	public void setOtpType(OtpType otpType) {
81
		this.otpType = otpType;
82
	}
83
	public LocalDateTime getCreatedOn() {
84
		return createdOn;
85
	}
86
	public void setCreatedOn(LocalDateTime createdOn) {
87
		this.createdOn = createdOn;
88
	}
89
	public LocalDateTime getExpiryTimestamp() {
90
		return expiryTimestamp;
91
	}
92
	public void setExpiryTimestamp(LocalDateTime expiryTimestamp) {
93
		this.expiryTimestamp = expiryTimestamp;
94
	}
95
	public boolean isExpired() {
96
		return expired;
97
	}
98
	public void setExpired(boolean expired) {
99
		this.expired = expired;
100
	}
101
	public String getEmail() {
102
		return email;
103
	}
104
	public void setEmail(String email) {
105
		this.email = email;
106
	}
107
	public String getMobile() {
108
		return mobile;
109
	}
110
	public void setMobile(String mobile) {
111
		this.mobile = mobile;
112
	}
113
 
22009 ashik.ali 114
 
21545 ashik.ali 115
	@Override
116
	public int hashCode() {
117
		final int prime = 31;
118
		int result = 1;
22009 ashik.ali 119
		result = prime * result + id;
21545 ashik.ali 120
		return result;
121
	}
122
	@Override
123
	public boolean equals(Object obj) {
124
		if (this == obj)
125
			return true;
126
		if (obj == null)
127
			return false;
128
		if (getClass() != obj.getClass())
129
			return false;
130
		Otp other = (Otp) obj;
131
		if (id != other.id)
132
			return false;
133
		return true;
134
	}
135
	@Override
136
	public String toString() {
137
		return "Otp [id=" + id + ", email=" + email + ", mobile=" + mobile + ", otp=" + otp + ", otpType=" + otpType
138
				+ ", createdOn=" + createdOn + ", expiryTimestamp=" + expiryTimestamp + ", expired=" + expired + "]";
139
	}
140
 
141
}