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.elephant.db.WhereClause;
26 import org.turro.jpa.Dao;
27 import org.turro.plugin.contacts.IContact;
28 import org.turro.students.db.StudentsPU;
29 import org.turro.students.entities.Response;
50 Set<Activity>
set =
new HashSet<>();
52 set.addAll(getResponses(contact, from, types));
57 private Set<Activity> getResponses(
IContact contact, Date from, Set<ActivityType> types) {
59 wc.
addClause(
"select distinct p from Response p");
71 Set<Activity>
set =
new HashSet<>();
72 for(Response p :
getDao().getResultList(Response.class, wc, 100)) {
73 Activity activity = convertToActivity(types, p, contact.
getId());
74 if(activity !=
null)
set.add(activity);
79 private Activity convertToActivity(Set<ActivityType> types, Response p, String idContact) {
80 return new Activity(p.getCreation(), ActivityType.ACTIVITY_CHANGE, idContact,
81 StudentsPU.getObjectPath(p.getChallenge()), p);
void addClause(String clause)
void addNamedValue(String name, Object value)
Set< ActivityType > getAllowed()
Set< Activity > getActivity(IContact contact, Date from, Set< ActivityType > types)