63 WhereClause wc =
null;
64 if(
"contact".equals(entityRoot)) {
65 switch(variable.getName()) {
67 wc = PreprocessClause.load(
"EntityParticipation")
68 .addCondition(
"and reason = :reason")
69 .addNamedValue(
"reason", ParticipationReason.REASON_FOLLOW)
70 .setRankingRoot(entityRoot)
71 .setRankingField(
"participatorPath")
72 .setVariable(variable)
73 .setAggregate(
"count(entityPath)")
77 wc = PreprocessClause.load(
"EntityParticipation")
78 .addCondition(
"and reason = :reason")
79 .addNamedValue(
"reason", ParticipationReason.REASON_FOLLOW)
80 .setRankingRoot(entityRoot)
81 .setRankingField(
"entityPath")
82 .setVariable(variable)
83 .setAggregate(
"count(participatorPath)")
87 wc = PreprocessClause.load(
"EntityParticipation")
88 .addCondition(
"and reason = :reason")
89 .addNamedValue(
"reason", ParticipationReason.REASON_SEEN)
90 .setRankingRoot(entityRoot)
91 .setRankingField(
"participatorPath")
92 .setVariable(variable)
93 .setAggregate(
"count(entityPath)")
97 wc = PreprocessClause.load(
"EntityParticipation")
98 .addCondition(
"and reason = :reason")
99 .addNamedValue(
"reason", ParticipationReason.REASON_LIKE)
100 .setRankingRoot(entityRoot)
101 .setRankingField(
"participatorPath")
102 .setVariable(variable)
103 .setAggregate(
"count(entityPath)")
107 wc = PreprocessClause.load(
"EntityParticipation")
108 .addCondition(
"and reason = :reason")
109 .addNamedValue(
"reason", ParticipationReason.REASON_APPLY)
110 .setRankingRoot(entityRoot)
111 .setRankingField(
"participatorPath")
112 .setVariable(variable)
113 .setAggregate(
"count(entityPath)")
118 switch(variable.getName()) {
120 wc = PreprocessClause.load(
"EntityParticipation")
121 .addCondition(
"and reason = :reason")
122 .addNamedValue(
"reason", ParticipationReason.REASON_FOLLOW)
123 .setRankingRoot(entityRoot)
124 .setRankingField(
"entityPath")
125 .setVariable(variable)
126 .setAggregate(
"count(entityPath)")
130 wc = PreprocessClause.load(
"EntityParticipation")
131 .addCondition(
"and reason = :reason")
132 .addNamedValue(
"reason", ParticipationReason.REASON_SEEN)
133 .setRankingRoot(entityRoot)
134 .setRankingField(
"entityPath")
135 .setVariable(variable)
136 .setAggregate(
"count(entityPath)")
140 wc = PreprocessClause.load(
"EntityParticipation")
141 .addCondition(
"and reason = :reason")
142 .addNamedValue(
"reason", ParticipationReason.REASON_LIKE)
143 .setRankingRoot(entityRoot)
144 .setRankingField(
"entityPath")
145 .setVariable(variable)
146 .setAggregate(
"count(entityPath)")
150 wc = PreprocessClause.load(
"EntityParticipation")
151 .addCondition(
"and reason = :reason")
152 .addNamedValue(
"reason", ParticipationReason.REASON_APPLY)
153 .setRankingRoot(entityRoot)
154 .setRankingField(
"entityPath")
155 .setVariable(variable)
156 .setAggregate(
"count(entityPath)")
162 try(Stream<GenericRanking> stream = dao.stream(GenericRanking.class, wc, 1000)) {
163 stream.forEach(r -> {
164 preprocessor.poolInstance(r.copyTo((IRanking) preprocessor.createInstance()));
166 preprocessor.finishPreprocessor();