18 package org.turro.dossier.dossier;
20 import java.util.Date;
21 import java.util.TreeSet;
22 import java.util.stream.Stream;
23 import org.turro.attach.db.AttachPU;
24 import org.turro.dossier.db.DossierPU;
25 import org.turro.dossier.entity.Dossier;
26 import org.turro.dossier.entity.Issue;
27 import org.turro.dossier.issue.IssueDetailComparator;
28 import org.turro.elephant.db.WhereClause;
29 import org.turro.jpa.Dao;
43 addDetail(dossier, date);
46 private void addDetail(
Dossier dossier, Date date) {
50 wc.
addClause(
"select comment from IssueComment as comment");
51 wc.
addClause(
"where comment.issue.dossier = :dossier");
54 wc.
addClause(
"and comment.modification >= :date");
57 addAll(dao.getResultList(wc));
58 wc =
new WhereClause();
59 wc.
addClause(
"select issue from Issue as issue");
60 wc.
addClause(
"where issue.dossier = :dossier");
62 try(Stream<Issue> issues = dao.stream(Issue.class, wc)) {
63 issues.forEach((issue) -> {
64 WhereClause awc =
new WhereClause();
65 awc.addClause(
"select attachment from Attachment as attachment");
66 awc.addClause(
"where path like :path");
67 awc.addNamedValue(
"path", DossierPU.getObjectPath(issue) +
"/%");
69 awc.addClause(
"and attachment.modification >= :date");
70 awc.addNamedValue(
"date", date);
72 addAll(adao.getResultList(awc));
75 wc =
new WhereClause();
76 wc.
addClause(
"select attachment from Attachment as attachment");
78 wc.
addNamedValue(
"path", DossierPU.getObjectPath(dossier) +
"/%");
80 wc.
addClause(
"and attachment.modification >= :date");
83 addAll(adao.getResultList(wc));
DossierActivitySet(Dossier dossier, Date date)
DossierActivitySet(Dossier dossier)
void addClause(String clause)
void addNamedValue(String name, Object value)