19 package org.turro.server.db.entities;
21 import java.io.Serializable;
22 import java.util.Date;
24 import java.util.Objects;
25 import javax.json.JsonValue;
26 import javax.persistence.EmbeddedId;
27 import javax.persistence.Entity;
28 import javax.persistence.Temporal;
29 import org.hibernate.annotations.Formula;
30 import org.turro.alliance.contact.AllianceContact;
31 import org.turro.alliance.db.AlliancePU;
32 import org.turro.alliance.db.entities.AxContact;
33 import org.turro.alliance.db.entities.AxProject;
34 import org.turro.alliance.db.entities.RelationId;
35 import org.turro.jpa.entity.IDaoEntity;
36 import org.turro.json.IJSONizable;
37 import org.turro.string.Strings;
38 import org.turro.util.Converter;
49 @Formula(
"concat(mainEntityId,'##',mainMemberId)")
52 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
53 private java.util.Date creation;
55 private boolean driver, coordinator, beneficiary, offerer, research, funding, support, consortium, admin;
57 private String name, face, company, companyFace, memberName;
59 private boolean validated =
false;
66 this.relation = relation;
75 if(!Strings.isBlank(
id) &&
id.contains(
"##")) {
76 String v[] =
id.split(
"##");
77 relation.setMainEntityId(v[0]);
78 relation.setMainMemberId(Converter.STANDARD.convert(v[1], Long.class));
87 this.creation = creation;
103 this.coordinator = coordinator;
111 this.beneficiary = beneficiary;
119 this.offerer = offerer;
127 this.research = research;
135 this.funding = funding;
143 this.support = support;
151 this.consortium = consortium;
183 this.company = company;
191 this.companyFace = companyFace;
199 this.memberName = memberName;
207 this.validated =
false;
235 return relation.isEmpty();
246 public String
toJson(Map<String, Object> properties) {
247 return toJson(
this, properties);
259 hash = 97 * hash + Objects.hashCode(this.relation);
271 if (getClass() != obj.getClass()) {
275 return Objects.
equals(this.relation, other.relation);
void setBeneficiary(boolean beneficiary)
void setMemberName(String memberName)
void setResearch(boolean research)
String toJson(Map< String, Object > properties)
void setDriver(boolean driver)
void setAdmin(boolean admin)
static AxParticipationRequest fromJson(JsonValue value)
void setOfferer(boolean offerer)
void setConsortium(boolean consortium)
AllianceContact getIContact()
void setFace(String face)
void setCreation(Date creation)
void setRelation(RelationId relation)
void setFunding(boolean funding)
boolean equals(Object obj)
void setCompanyFace(String companyFace)
void setName(String name)
void setCompany(String company)
void setCoordinator(boolean coordinator)
void setSupport(boolean support)
void setValidated(boolean validated)