19 package org.turro.elephant.entities.db;
21 import java.util.Date;
22 import java.util.HashSet;
24 import javax.persistence.CascadeType;
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.FetchType;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.Lob;
32 import javax.persistence.OneToMany;
33 import javax.persistence.OrderBy;
34 import javax.persistence.Temporal;
35 import org.turro.action.Contacts;
36 import org.turro.elephant.security.IUser;
37 import org.turro.plugin.contacts.IContact;
44 public class MailItem implements java.io.Serializable {
47 @GeneratedValue(strategy=GenerationType.IDENTITY)
48 @Column(name=
"IDENTIFIER")
51 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
52 private java.util.Date itemDate;
54 private String idContact, contactEmail, contactName,
55 idCategory, category, description, subject, poolName,
59 @Column(length=2147483647)
60 private String message;
62 @OneToMany(mappedBy =
"mailItem", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval=
true)
63 @OrderBy(value=
"name")
64 private Set<MailAttachment> mailAttachments =
new HashSet<MailAttachment>();
79 this.itemDate = itemDate;
87 this.idContact = idContact;
96 this.contactEmail = contactEmail;
104 this.contactName = contactName;
112 this.idCategory = idCategory;
120 this.category = category;
128 this.description = description;
136 this.subject = subject;
144 this.message = message;
152 this.poolName = poolName;
160 this.reason = reason;
168 this.sender = sender;
172 return mailAttachments;
176 this.mailAttachments = mailAttachments;
181 private transient IContact _contact;
184 if(_contact ==
null) {
192 idContact = _contact !=
null ? _contact.
getId() :
null;
193 contactName = _contact !=
null ? _contact.
getName() :
null;
197 private void resetIContact() {
void setEntityPath(String entityPath)
void setMailItem(MailItem mailItem)
void setType(MailAttachmentType type)
void setDescription(String description)
void setName(String name)
void setSubject(String subject)
void setMessage(String message)
void setContactEmail(String contactEmail)
void setIContact(IContact contact)
void setMailAttachments(Set< MailAttachment > mailAttachments)
void setContactName(String contactName)
void setSender(String sender)
Set< MailAttachment > getMailAttachments()
void setCategory(String category)
void setDescription(String description)
MailAttachment addAttachment(String description, String name, String entityPath)
void setReason(String reason)
void setItemDate(Date itemDate)
void setIdContact(String idContact)
MailAttachment addImage(String description, String name, String imagePath)
MailAttachment addImageURL(String description, String name, String imageURL)
void setPoolName(String poolName)
void setIdCategory(String idCategory)
MailAttachment addFile(String description, String name, String filePath)
static final String CONNECTOR_EMAIL