19 package org.turro.user.activity;
21 import java.util.Date;
22 import java.util.EnumSet;
23 import java.util.HashSet;
25 import org.turro.contacts.JobBoard;
26 import org.turro.contacts.db.ContactsPU;
27 import org.turro.elephant.db.WhereClause;
28 import org.turro.jpa.Dao;
29 import org.turro.plugin.contacts.IContact;
50 Set<Activity>
set =
new HashSet<>();
52 set.addAll(getParticipations(contact, from, types));
57 private Set<Activity> getParticipations(
IContact contact, Date from, Set<ActivityType> types) {
62 wc.
addClause(
"and j.updateDate >= :date");
69 wc.
addClause(
"order by j.updateDate desc");
70 Set<Activity>
set =
new HashSet<>();
71 for(JobBoard j :
getDao().getResultList(JobBoard.class, wc, 100)) {
72 Activity activity = convertToActivity(types, j);
73 if(activity !=
null)
set.add(activity);
78 private Activity convertToActivity(Set<ActivityType> types, JobBoard j) {
79 return new Activity(j.getUpdateDate(), ActivityType.ACTIVITY_CHANGE, j.getContact().getId(),
80 ContactsPU.getObjectPath(j.getContact()), j);
void addClause(String clause)
void addNamedValue(String name, Object value)