◆ ParticipationInfo() [1/4]
org.turro.assistant.ParticipationInfo.ParticipationInfo |
( |
Object |
entity, |
|
|
ParticipationReason |
reason |
|
) |
| |
◆ ParticipationInfo() [2/4]
Definition at line 58 of file ParticipationInfo.java.
59 entityPath = Entities.getController(entity).getPath();
60 if(!Strings.isBlank(entityPath)) {
61 if(contact !=
null && contact.isValid()) {
62 participatorPath =
"/contact/" + contact.getId();
◆ ParticipationInfo() [3/4]
org.turro.assistant.ParticipationInfo.ParticipationInfo |
( |
String |
entityPath, |
|
|
ParticipationReason |
reason |
|
) |
| |
◆ ParticipationInfo() [4/4]
org.turro.assistant.ParticipationInfo.ParticipationInfo |
( |
String |
entityPath, |
|
|
String |
participatorPath, |
|
|
ParticipationReason |
reason |
|
) |
| |
Definition at line 72 of file ParticipationInfo.java.
73 this.entityPath = entityPath;
74 this.participatorPath = participatorPath;
◆ check()
void org.turro.assistant.ParticipationInfo.check |
( |
| ) |
|
Definition at line 211 of file ParticipationInfo.java.
213 EntityParticipationPK key =
new EntityParticipationPK();
214 key.setEntityPath(entityPath);
215 key.setParticipatorPath(participatorPath);
216 key.setReason(reason);
217 EntityParticipation ep = getDao().find(EntityParticipation.class, key);
219 ep =
new EntityParticipation();
220 ep.setEntityPath(entityPath);
221 ep.setParticipatorPath(participatorPath);
222 ep.setReason(reason);
223 ep.setParticipationDate(
new Date());
224 getDao().saveObject(ep);
◆ cleanup()
static void org.turro.assistant.ParticipationInfo.cleanup |
( |
String |
entityPath | ) |
|
|
static |
Definition at line 285 of file ParticipationInfo.java.
286 SqlClause.delete(
"EntityParticipation")
287 .where().equal(
"entityPath", entityPath)
288 .or().equal(
"participatorPath", entityPath)
289 .dao(
new ElephantPU())
◆ getAllPaths()
static Set<String> org.turro.assistant.ParticipationInfo.getAllPaths |
( |
String |
root | ) |
|
|
static |
Definition at line 295 of file ParticipationInfo.java.
296 return new HashSet<>(SqlClause.select(
"distinct ep.entityPath").from(
"EntityParticipation ep")
297 .where().startsWith(
"ep.entityPath",
"/" + root +
"/")
298 .dao(
new ElephantPU())
299 .resultList(String.class));
◆ getAnyParticipations() [1/2]
Definition at line 133 of file ParticipationInfo.java.
134 WhereClause wc =
new WhereClause();
135 wc.addClause(
"select ep from EntityParticipation ep");
136 wc.addClause(
"where 1=1");
138 wc.addClause(
"and ep.reason = :reason");
139 wc.addNamedValue(
"reason", reason);
142 wc.addClause(
"and ep.participationDate >= :from");
143 wc.addNamedValue(
"from", from);
145 return getDao().getResultList(wc);
◆ getAnyParticipations() [2/2]
void org.turro.assistant.ParticipationInfo.getAnyParticipations |
( |
Date |
from, |
|
|
Consumer< IEntityParticipation > |
action |
|
) |
| |
Definition at line 148 of file ParticipationInfo.java.
149 WhereClause wc =
new WhereClause();
150 wc.addClause(
"select ep from EntityParticipation ep");
151 wc.addClause(
"where 1=1");
153 wc.addClause(
"and ep.reason = :reason");
154 wc.addNamedValue(
"reason", reason);
157 wc.addClause(
"and ep.participationDate >= :from");
158 wc.addNamedValue(
"from", from);
160 getDao().forEach(IEntityParticipation.class, wc, action);
◆ getCount()
long org.turro.assistant.ParticipationInfo.getCount |
( |
| ) |
|
Definition at line 78 of file ParticipationInfo.java.
80 WhereClause wc =
new WhereClause();
81 wc.addClause(
"select count(ep) from EntityParticipation ep");
82 wc.addClause(
"where ep.entityPath = :entityPath");
83 wc.addNamedValue(
"entityPath", entityPath);
85 wc.addClause(
"and ep.reason = :reason");
86 wc.addNamedValue(
"reason", reason);
Object getSingleResult(WhereClause wc)
◆ getCrossParticipations() [1/2]
◆ getCrossParticipations() [2/2]
List<IEntityParticipation> org.turro.assistant.ParticipationInfo.getCrossParticipations |
( |
Date |
from | ) |
|
Definition at line 117 of file ParticipationInfo.java.
118 WhereClause wc =
new WhereClause();
119 wc.addClause(
"select ep from EntityParticipation ep");
120 wc.addClause(
"where ep.participatorPath = :entityPath");
121 wc.addNamedValue(
"entityPath", entityPath);
123 wc.addClause(
"and ep.reason = :reason");
124 wc.addNamedValue(
"reason", reason);
127 wc.addClause(
"and ep.participationDate >= :from");
128 wc.addNamedValue(
"from", from);
130 return getDao().getResultList(wc);
◆ getEntity()
◆ getParticipants()
ContactList org.turro.assistant.ParticipationInfo.getParticipants |
( |
| ) |
|
Definition at line 258 of file ParticipationInfo.java.
259 ContactList list =
new ContactList();
261 list.add(ep.getContact());
List< IEntityParticipation > getParticipations()
◆ getParticipationCount()
Definition at line 273 of file ParticipationInfo.java.
274 WhereClause wc =
new WhereClause();
275 wc.addClause(
"select count(ep) from EntityParticipation ep");
276 wc.addClause(
"where ep.entityPath like concat('/', :rootPath, '/%')");
277 wc.addNamedValue(
"rootPath", root);
278 wc.addClause(
"and ep.participatorPath = concat('/contact/', :participator)");
279 wc.addNamedValue(
"participator", contact.getId());
280 wc.addClause(
"and ep.reason = :reason");
281 wc.addNamedValue(
"reason", reason);
282 return (
long)
new ElephantPU().getSingleResult(wc);
◆ getParticipations() [1/2]
◆ getParticipations() [2/2]
Definition at line 97 of file ParticipationInfo.java.
98 WhereClause wc =
new WhereClause();
99 wc.addClause(
"select ep from EntityParticipation ep");
100 wc.addClause(
"where ep.entityPath = :entityPath");
101 wc.addNamedValue(
"entityPath", entityPath);
103 wc.addClause(
"and ep.reason = :reason");
104 wc.addNamedValue(
"reason", reason);
107 wc.addClause(
"and ep.participationDate >= :from");
108 wc.addNamedValue(
"from", from);
110 return getDao().getResultList(wc);
◆ getParticipator()
◆ getReasonStr()
String org.turro.assistant.ParticipationInfo.getReasonStr |
( |
| ) |
|
◆ isChecked()
boolean org.turro.assistant.ParticipationInfo.isChecked |
( |
| ) |
|
Definition at line 163 of file ParticipationInfo.java.
164 if(checked ==
null) {
167 EntityParticipationPK key =
new EntityParticipationPK();
168 key.setEntityPath(entityPath);
169 key.setParticipatorPath(participatorPath);
170 key.setReason(reason);
171 EntityParticipation ep = getDao().find(EntityParticipation.class, key);
172 checked = ep !=
null;
◆ isEmpty()
boolean org.turro.assistant.ParticipationInfo.isEmpty |
( |
| ) |
|
Definition at line 182 of file ParticipationInfo.java.
183 return Strings.isBlank(entityPath) || Strings.isBlank(participatorPath) || reason ==
null;
◆ isUser()
boolean org.turro.assistant.ParticipationInfo.isUser |
( |
| ) |
|
◆ toggle()
boolean org.turro.assistant.ParticipationInfo.toggle |
( |
| ) |
|
Definition at line 186 of file ParticipationInfo.java.
187 boolean result =
false;
189 EntityParticipationPK key =
new EntityParticipationPK();
190 key.setEntityPath(entityPath);
191 key.setParticipatorPath(participatorPath);
192 key.setReason(reason);
193 EntityParticipation ep = getDao().find(EntityParticipation.class, key);
198 ep =
new EntityParticipation();
199 ep.setEntityPath(entityPath);
200 ep.setParticipatorPath(participatorPath);
201 ep.setReason(reason);
202 ep.setParticipationDate(
new Date());
203 getDao().saveObject(ep);
void deleteObject(Object obj)
◆ uncheck()
void org.turro.assistant.ParticipationInfo.uncheck |
( |
| ) |
|
Definition at line 229 of file ParticipationInfo.java.
231 EntityParticipationPK key =
new EntityParticipationPK();
232 key.setEntityPath(entityPath);
233 key.setParticipatorPath(participatorPath);
234 key.setReason(reason);
235 EntityParticipation ep = getDao().find(EntityParticipation.class, key);
The documentation for this class was generated from the following file: