19 package org.turro.alliance.db.entities;
21 import java.io.Serializable;
22 import java.time.Instant;
23 import java.util.Date;
25 import java.util.Objects;
26 import javax.json.JsonValue;
27 import javax.persistence.Column;
28 import javax.persistence.EmbeddedId;
29 import javax.persistence.Entity;
30 import javax.persistence.Lob;
31 import javax.persistence.Temporal;
32 import org.hibernate.annotations.Formula;
33 import org.turro.dossier.entity.ProjectGrant;
34 import org.turro.elephant.context.ElephantContext;
35 import org.turro.entities.Entities;
36 import org.turro.html.HtmlContent;
37 import org.turro.jpa.embeddables.Wiki;
38 import org.turro.jpa.entity.IDaoEntity;
39 import org.turro.json.IJSONizable;
40 import org.turro.string.Strings;
51 @Formula(
"concat(entityId,'##',memberId)")
56 @Temporal(value = javax.persistence.TemporalType.TIMESTAMP)
57 private java.util.Date endDate;
59 private boolean recurrent, endOfBudget;
61 private boolean micro, small, medium, big, otherOrgs;
63 private double budget;
65 private boolean subvention, loan, inKind;
66 private boolean collaboration;
68 private boolean minimis;
70 private String source;
72 private String convocation, basis;
74 private boolean hiring, idi, investment, startUp, formation;
82 private String deadline;
86 private String elegible;
90 private String beneficiaries;
94 private String features;
98 private String intensity;
100 private String sourceLink;
103 return projectGrantId;
107 this.projectGrantId = projectGrantId;
112 return id ==
null ? projectGrantId.stringify() : id;
128 this.endDate = endDate;
136 this.recurrent = recurrent;
144 this.endOfBudget = endOfBudget;
168 this.medium = medium;
184 this.otherOrgs = otherOrgs;
192 this.budget = budget;
200 this.subvention = subvention;
216 this.inKind = inKind;
220 return collaboration;
224 this.collaboration = collaboration;
232 this.minimis = minimis;
240 this.source = source;
248 this.convocation = convocation;
264 this.hiring = hiring;
280 this.investment = investment;
288 this.startUp = startUp;
296 this.formation = formation;
312 this.deadline = deadline;
320 this.elegible = elegible;
324 return beneficiaries;
328 this.beneficiaries = beneficiaries;
336 this.features = features;
344 this.intensity = intensity;
352 this.sourceLink = sourceLink;
360 id.setMemberId(memberId);
361 id.setEntityId(Long.toString(projectGrant.
getId()));
396 private static String getTextFromWiki(
Wiki wiki) {
397 return wiki ==
null ? null : wiki.
getText();
404 return projectGrantId;
409 return projectGrantId.isEmpty() ||
410 Strings.isBlank(title);
421 public String
toJson(Map<String, Object> properties) {
422 return toJson(
this, properties);
432 return title ==
null ?
"!***" : title;
436 return goal ==
null ?
"!***" : HtmlContent.plain(goal, 250);
440 return micro | small | medium | big;
444 return endDate ==
null || endDate.toInstant().isAfter(Instant.now());
452 hash = 79 * hash + Objects.hashCode(this.projectGrantId);
464 if (getClass() != obj.getClass()) {
468 return Objects.
equals(this.projectGrantId, other.projectGrantId);
void setSmall(boolean small)
void setBeneficiaries(String beneficiaries)
void setFeatures(String features)
boolean isCollaboration()
static AxProjectGrant fromJson(JsonValue value)
void setElegible(String elegible)
void setCollaboration(boolean collaboration)
void setProjectGrantId(ProcedenceId projectGrantId)
ProcedenceId getProjectGrantId()
void setIntensity(String intensity)
void setSubvention(boolean subvention)
String toJson(Map< String, Object > properties)
void setSourceLink(String sourceLink)
void setBudget(double budget)
void setInvestment(boolean investment)
void setDeadline(String deadline)
void setEndOfBudget(boolean endOfBudget)
void setOtherOrgs(boolean otherOrgs)
void setRecurrent(boolean recurrent)
void setInKind(boolean inKind)
void setFormation(boolean formation)
void setSource(String source)
void setHiring(boolean hiring)
String getBeneficiaries()
boolean equals(Object obj)
void setEndDate(Date endDate)
void setMinimis(boolean minimis)
void setStartUp(boolean startUp)
void setConvocation(String convocation)
void setGoal(String goal)
void setMedium(boolean medium)
void setTitle(String title)
void setMicro(boolean micro)
static AxProjectGrant from(long memberId, ProjectGrant projectGrant)
void setLoan(boolean loan)
void setBasis(String basis)
boolean isCollaboration()
GrantMatchCriteria getMatchCriteria()
static String getServerUrl(String scheme)
static IElephantEntity getController(String path)