19 package org.turro.interest;
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.Collections;
24 import java.util.List;
25 import org.turro.dossier.db.DossierPU;
26 import org.turro.dossier.entity.CategoryParticipant;
27 import org.turro.dossier.entity.Participant;
28 import org.turro.dossier.entity.ParticipantRole;
29 import org.turro.entities.Entities;
30 import org.turro.jpa.Dao;
31 import org.turro.participation.ParticipationReason;
32 import org.turro.plugin.contacts.IContact;
33 import org.turro.sql.SqlClause;
34 import org.turro.util.Cached;
44 ArrayList<Interest> list =
new ArrayList<>();
46 SqlClause.select(
"ep").from(
"Participant ep")
47 .where().equal(
"idContact", contact.
getId())
52 if(ep.getDossier() !=
null) {
53 list.add(new Interest(ParticipationReason.REASON_PARTICIPATE,
54 Entities.getController(ep.getDossier()), false));
57 SqlClause.select(
"ep").from(
"CategoryParticipant ep")
58 .where().equal(
"idContact", contact.
getId())
63 if(ep.getCategory() !=
null) {
64 list.add(new Interest(ParticipationReason.REASON_PARTICIPATE,
65 Entities.getController(ep.getCategory()), false));
74 return Collections.EMPTY_LIST;
79 private final Cached<Dao> dao = Cached.instance(() ->
new DossierPU());
List< Interest > collect(IContact contact, ParticipationReason... reasons)
List< Interest > reversed(IContact contact, ParticipationReason... reasons)