18 package org.turro.dossier.entity;
20 import java.util.Date;
21 import java.util.HashSet;
22 import java.util.Objects;
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.GenerationType;
27 import javax.persistence.Id;
28 import javax.persistence.JoinColumn;
29 import javax.persistence.ManyToOne;
30 import org.turro.string.Strings;
31 import org.turro.action.Contacts;
32 import org.turro.jpa.entity.IDaoEntity;
33 import org.turro.plugin.contacts.IContact;
34 import org.turro.visual.RoleUtil;
44 @GeneratedValue(strategy=GenerationType.IDENTITY)
45 @Column(name=
"IDENTIFIER")
48 @Column(name=
"PARTICIPANT_NAME", nullable =
false)
51 private String idContact;
53 @Column(name=
"PARTICIPANT_ROLE")
57 @JoinColumn(name=
"CATEGORY_FK")
60 private String discriminator;
62 private boolean showAllAttachments, showParticipants, showAllIssues, receiveAllEmails, bindingVote,
63 driver, coordinator, beneficiary, offerer, research, funding, support, consortium, admin;
70 this.category = category;
87 this.idContact = idContact;
102 return receiveAllEmails;
106 this.receiveAllEmails = receiveAllEmails;
117 showAllAttachments =
true;
118 showAllIssues =
true;
119 showParticipants =
true;
125 return discriminator;
129 this.discriminator = discriminator;
134 return showAllAttachments;
138 this.showAllAttachments = showAllAttachments;
143 return showAllIssues;
147 this.showAllIssues = showAllIssues;
152 return showParticipants;
156 this.showParticipants = showParticipants;
165 this.bindingVote = bindingVote;
174 this.driver = driver;
183 this.coordinator = coordinator;
192 this.beneficiary = beneficiary;
201 this.offerer = offerer;
210 this.research = research;
219 this.funding = funding;
228 this.support = support;
237 this.consortium = consortium;
251 return driver || coordinator || beneficiary || offerer ||
252 research || funding || support || consortium || admin;
269 return Strings.isBlank(idContact) || role ==
null;
286 private transient IContact _contact, _company;
290 if(_contact ==
null) {
298 idContact = _contact !=
null ? _contact.
getId() :
null;
299 name = _contact !=
null ? _contact.
getName() :
null;
302 private void resetIContact() {
308 if(_company ==
null) {
319 hash = 53 * hash + Objects.hashCode(this.
id);
331 if (getClass() != obj.getClass()) {
335 return Objects.
equals(this.
id, other.id);
void setShowParticipants(boolean showParticipants)
void setName(String name)
void setCoordinator(boolean coordinator)
HashSet< String > getStringRoles()
void setFunding(boolean funding)
boolean isShowAllIssues()
void setShowAllIssues(boolean showAllIssues)
void setOfferer(boolean offerer)
void setResearch(boolean research)
void setDiscriminator(String discriminator)
void setIContact(IContact contact)
boolean equals(Object obj)
ParticipantRole getRole()
void setAdmin(boolean admin)
void setSupport(boolean support)
boolean isReceiveAllEmails()
void setBindingVote(boolean bindingVote)
void setDriver(boolean driver)
void setShowAllAttachments(boolean showAllAttachments)
void setConsortium(boolean consortium)
void setBeneficiary(boolean beneficiary)
void setRole(ParticipantRole role)
void setReceiveAllEmails(boolean receiveAllEmails)
void setCategory(Category category)
String getDiscriminator()
boolean isShowParticipants()
boolean isShowAllAttachments()
void setIdContact(String idContact)
static HashSet< String > getStringRoles(IDossierParticipant dp)