Subversion Repositories SmartDukaan

Rev

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