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 =
true;
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 =
true;
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 setCreation(Date creation)
void setCompany(String company)
void setCompanyFace(String companyFace)
static AxAllianceParticipation fromJson(JsonValue value)
boolean equals(Object obj)
AllianceContact getIContact()
void setRelation(RelationId relation)
void setName(String name)
void setAdmin(boolean admin)
void setFace(String face)
void setDriver(boolean driver)
void setCoordinator(boolean coordinator)
void setConsortium(boolean consortium)
void setOfferer(boolean offerer)
void setMemberName(String memberName)
void setBeneficiary(boolean beneficiary)
String toJson(Map< String, Object > properties)
void setResearch(boolean research)
void setValidated(boolean validated)
void setFunding(boolean funding)
void setSupport(boolean support)