19 package org.turro.alliance.db.entities;
21 import java.io.Serializable;
22 import java.util.Date;
24 import java.util.Objects;
26 import javax.json.JsonValue;
27 import javax.persistence.EmbeddedId;
28 import javax.persistence.Entity;
29 import javax.persistence.Temporal;
30 import org.turro.string.Strings;
31 import org.turro.alliance.contact.AllianceContact;
32 import org.turro.alliance.db.AlliancePU;
33 import org.turro.alliance.model.AxParticipationSet;
34 import org.turro.dossier.entity.Dossier;
35 import org.turro.elephant.context.ElephantContext;
36 import org.turro.importer.ImporterRegister;
37 import org.turro.jpa.entity.IDaoEntity;
38 import org.turro.json.IJSONizable;
39 import org.turro.plugin.contacts.IContact;
40 import org.turro.plugin.contacts.IContactRelation;
51 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
52 private java.util.Date creation;
54 private boolean driver, coordinator, beneficiary, offerer, research, funding, support, consortium, admin;
56 private String company, companyFace;
63 this.relation = relation;
71 this.creation = creation;
87 this.coordinator = coordinator;
95 this.beneficiary = beneficiary;
103 this.offerer = offerer;
111 this.research = research;
119 this.funding = funding;
127 this.support = support;
135 this.consortium = consortium;
151 this.company = company;
159 this.companyFace = companyFace;
180 public static Set<AxParticipation>
from(
long memberId,
Dossier dossier) {
190 participation.
setCreation(participant.getCreation());
191 participation.
setAdmin(participant.isAdmin());
195 participation.
setDriver(participant.isDriver());
196 participation.
setFunding(participant.isFunding());
197 participation.
setOfferer(participant.isOfferer());
198 participation.
setResearch(participant.isResearch());
199 participation.
setSupport(participant.isSupport());
201 .date(participant.getCreation()).getCompanyRelation();
205 if(!Strings.isBlank(business.
getFace())) {
210 participations.
add(participation);
212 return participations;
223 participation.
setCreation(
register.getDate(
"creation"));
224 participation.
setAdmin(
register.getBoolean(
"admin"));
226 participation.
setConsortium(
register.getBoolean(
"consortium"));
228 participation.
setDriver(
register.getBoolean(
"driver"));
229 participation.
setFunding(
register.getBoolean(
"funding"));
230 participation.
setOfferer(
register.getBoolean(
"offerer"));
231 participation.
setResearch(
register.getBoolean(
"research"));
232 participation.
setSupport(
register.getBoolean(
"support"));
233 participation.
setCompany(
register.getString(
"company"));
235 return participation;
247 return relation.isEmpty();
258 public String
toJson(Map<String, Object> properties) {
259 return toJson(
this, properties);
269 hash = 97 * hash + Objects.hashCode(this.relation);
281 if (getClass() != obj.getClass()) {
285 return Objects.
equals(this.relation, other.relation);
void setCreation(Date creation)
String toJson(Map< String, Object > properties)
static AxParticipation fromJson(JsonValue value)
void setBeneficiary(boolean beneficiary)
void setResearch(boolean research)
void setCompany(String company)
void setConsortium(boolean consortium)
void setAdmin(boolean admin)
void setFunding(boolean funding)
void setRelation(RelationId relation)
AllianceContact getIContact()
static Set< AxParticipation > from(long memberId, Dossier dossier)
static AxParticipation from(long memberId, ImporterRegister register)
void setCompanyFace(String companyFace)
void setDriver(boolean driver)
void setSupport(boolean support)
boolean equals(Object obj)
void setOfferer(boolean offerer)
void setCoordinator(boolean coordinator)
void setRelatedMemberId(Long relatedMemberId)
void setMainMemberId(Long mainMemberId)
void setRelatedEntityId(String relatedEntityId)
void setMainEntityId(String mainEntityId)
boolean add(AxParticipation e)
ParticipantSet< IDossierParticipant > getFullParticipants()
static String getServerUrl(String scheme)