19 package org.turro.crm.entity;
21 import java.util.Collection;
22 import java.util.Date;
23 import java.util.HashSet;
24 import java.util.List;
26 import javax.persistence.CascadeType;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.FetchType;
30 import javax.persistence.GeneratedValue;
31 import javax.persistence.GenerationType;
32 import javax.persistence.Id;
33 import javax.persistence.Lob;
34 import javax.persistence.OneToMany;
35 import javax.persistence.Temporal;
36 import javax.persistence.TemporalType;
37 import org.turro.string.Strings;
38 import org.turro.contacts.organigram.TargetArray;
39 import org.turro.jpa.entity.IDaoEntity;
40 import org.turro.plugin.GenericObject;
50 @GeneratedValue(strategy=GenerationType.IDENTITY)
51 @Column(name=
"IDENTIFIER")
56 private String description;
59 @Column(name=
"targets")
60 private byte[] targets;
62 @Temporal(TemporalType.TIMESTAMP)
63 private java.util.Date campaignDate;
65 @Temporal(TemporalType.TIMESTAMP)
66 private java.util.Date closingDate;
68 @OneToMany(mappedBy=
"campaign", fetch = FetchType.EAGER, cascade=CascadeType.ALL, orphanRemoval=
true)
69 private Set<CampaignVendor> campaignVendors =
new HashSet<CampaignVendor>();
71 @OneToMany(mappedBy=
"campaign", fetch = FetchType.EAGER, cascade=CascadeType.ALL, orphanRemoval=
true)
72 private Set<SaleProspect> saleProspects =
new HashSet<SaleProspect>();
87 this.description = description;
95 this.campaignDate = campaignDate;
103 this.closingDate = closingDate;
107 return campaignVendors;
111 this.campaignVendors = campaignVendors;
115 return saleProspects;
119 this.saleProspects = saleProspects;
127 this.targets = targets;
139 return Strings.isBlank(description);
144 return List.of(campaignVendors);
151 if(sp.getCustomer().getId() == customer.
getId()) {
161 if(targets ==
null) {
170 if(targetArray ==
null) {
void setCampaignDate(Date campaignDate)
void setCampaignVendors(Set< CampaignVendor > campaignVendors)
void setTargetArray(TargetArray targetArray)
void setTargets(byte[] targets)
SaleProspect customerExists(Customer customer)
Collection< Collection > collections()
void setClosingDate(Date closingDate)
TargetArray getTargetArray()
Set< CampaignVendor > getCampaignVendors()
Set< SaleProspect > getSaleProspects()
void setSaleProspects(Set< SaleProspect > saleProspects)
void setDescription(String description)
void setObject(Serializable object)
void bytesToObject(byte[] buf)