Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
35956 amit 1
package com.spice.profitmandi.dao.entity.mail;
2
 
3
import javax.persistence.*;
4
import java.time.LocalDateTime;
5
 
6
@Entity
7
@Table(name = "mail_outbox")
8
@NamedQueries({
9
        @NamedQuery(name = "MailOutbox.selectPending", query = "FROM MailOutbox WHERE status = 'PENDING' OR (status = 'FAILED' AND retryCount < 1) ORDER BY createdAt ASC"),
10
        @NamedQuery(name = "MailOutbox.selectOldSent", query = "FROM MailOutbox WHERE status = 'SENT' AND sentAt < :cutoff")
11
})
12
public class MailOutbox {
13
 
14
    @Id
15
    @GeneratedValue(strategy = GenerationType.IDENTITY)
16
    @Column(name = "id")
17
    private long id;
18
 
19
    @Column(name = "email_to", length = 2000, nullable = false)
20
    private String emailTo;
21
 
22
    @Column(name = "email_cc", length = 2000)
23
    private String emailCc;
24
 
25
    @Column(name = "email_bcc", length = 2000)
26
    private String emailBcc;
27
 
28
    @Column(name = "subject", length = 500, nullable = false)
29
    private String subject;
30
 
31
    @Lob
32
    @Column(name = "body", nullable = false)
33
    private String body;
34
 
35
    @Column(name = "is_html")
36
    private boolean html;
37
 
38
    @Column(name = "status", length = 20, nullable = false)
39
    private String status;
40
 
41
    @Column(name = "retry_count")
42
    private int retryCount;
43
 
44
    @Column(name = "error_message", length = 1000)
45
    private String errorMessage;
46
 
47
    @Column(name = "created_at", nullable = false)
48
    private LocalDateTime createdAt;
49
 
50
    @Column(name = "sent_at")
51
    private LocalDateTime sentAt;
52
 
53
    @Column(name = "source", length = 200)
54
    private String source;
55
 
56
    @Column(name = "sender_type", length = 20)
57
    private String senderType;
58
 
59
    public long getId() {
60
        return id;
61
    }
62
 
63
    public void setId(long id) {
64
        this.id = id;
65
    }
66
 
67
    public String getEmailTo() {
68
        return emailTo;
69
    }
70
 
71
    public void setEmailTo(String emailTo) {
72
        this.emailTo = emailTo;
73
    }
74
 
75
    public String getEmailCc() {
76
        return emailCc;
77
    }
78
 
79
    public void setEmailCc(String emailCc) {
80
        this.emailCc = emailCc;
81
    }
82
 
83
    public String getEmailBcc() {
84
        return emailBcc;
85
    }
86
 
87
    public void setEmailBcc(String emailBcc) {
88
        this.emailBcc = emailBcc;
89
    }
90
 
91
    public String getSubject() {
92
        return subject;
93
    }
94
 
95
    public void setSubject(String subject) {
96
        this.subject = subject;
97
    }
98
 
99
    public String getBody() {
100
        return body;
101
    }
102
 
103
    public void setBody(String body) {
104
        this.body = body;
105
    }
106
 
107
    public boolean isHtml() {
108
        return html;
109
    }
110
 
111
    public void setHtml(boolean html) {
112
        this.html = html;
113
    }
114
 
115
    public String getStatus() {
116
        return status;
117
    }
118
 
119
    public void setStatus(String status) {
120
        this.status = status;
121
    }
122
 
123
    public int getRetryCount() {
124
        return retryCount;
125
    }
126
 
127
    public void setRetryCount(int retryCount) {
128
        this.retryCount = retryCount;
129
    }
130
 
131
    public String getErrorMessage() {
132
        return errorMessage;
133
    }
134
 
135
    public void setErrorMessage(String errorMessage) {
136
        this.errorMessage = errorMessage;
137
    }
138
 
139
    public LocalDateTime getCreatedAt() {
140
        return createdAt;
141
    }
142
 
143
    public void setCreatedAt(LocalDateTime createdAt) {
144
        this.createdAt = createdAt;
145
    }
146
 
147
    public LocalDateTime getSentAt() {
148
        return sentAt;
149
    }
150
 
151
    public void setSentAt(LocalDateTime sentAt) {
152
        this.sentAt = sentAt;
153
    }
154
 
155
    public String getSource() {
156
        return source;
157
    }
158
 
159
    public void setSource(String source) {
160
        this.source = source;
161
    }
162
 
163
    public String getSenderType() {
164
        return senderType;
165
    }
166
 
167
    public void setSenderType(String senderType) {
168
        this.senderType = senderType;
169
    }
170
 
171
    @Override
172
    public String toString() {
173
        return "MailOutbox{id=" + id + ", emailTo='" + emailTo + "', subject='" + subject + "', status='" + status + "', retryCount=" + retryCount + "}";
174
    }
175
}