19 package org.turro.activity;
21 import java.util.Date;
22 import java.util.List;
23 import org.turro.string.Strings;
24 import org.turro.contacts.CommentIt;
25 import org.turro.contacts.Convocation;
26 import org.turro.contacts.StarIt;
27 import org.turro.contacts.VoteIt;
28 import org.turro.contacts.db.ContactsPU;
29 import org.turro.elephant.db.WhereClause;
30 import org.turro.entities.IElephantEntity;
31 import org.turro.jpa.Dao;
43 for(Object obj :
getComments(entityPath, from,
null)) {
51 for(Object obj :
getStars(entityPath, from,
null)) {
59 for(Object obj :
getVotes(entityPath, from,
null)) {
81 public List
getComments(String path, Date from, String select) {
83 wc.
addClause(
"select comment" + check(select) +
" from CommentIt as comment");
84 wc.
addClause(
"where comment.dateCreation >= :date");
86 if(!Strings.isBlank(path)) {
90 return getDao().getResultList(wc);
93 public List
getStars(String path, Date from, String select) {
95 wc.
addClause(
"select star" + check(select) +
" from StarIt as star");
96 wc.
addClause(
"where star.dateCreation >= :date");
98 if(!Strings.isBlank(path)) {
102 return getDao().getResultList(wc);
105 public List
getVotes(String path, Date from, String select) {
107 wc.
addClause(
"select vote" + check(select) +
" from VoteIt as vote");
108 wc.
addClause(
"where vote.dateCreation >= :date");
110 if(!Strings.isBlank(path)) {
114 return getDao().getResultList(wc);
119 wc.
addClause(
"select convocation" + check(select) +
" from Convocation as convocation");
120 wc.
addClause(
"where convocation.callDate >= :date");
122 if(!Strings.isBlank(path)) {
123 wc.
addClause(
"and entityPath like :path");
126 return getDao().getResultList(wc);
129 private String check(String select) {
130 return Strings.isBlank(select) ?
"" : select;
137 private Dao getDao() {
139 _dao =
new ContactsPU();
void setSortPath(String sortPath)
void addClause(String clause)
void addNamedValue(String name, Object value)
String getHierarchicalPath()