1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.codelibs.fess.es.log.cbean.cq.bs;
17
18 import java.time.LocalDateTime;
19 import java.util.ArrayList;
20 import java.util.Collection;
21
22 import org.codelibs.fess.es.log.allcommon.EsAbstractConditionQuery;
23 import org.codelibs.fess.es.log.cbean.cq.UserInfoCQ;
24 import org.dbflute.cbean.ckey.ConditionKey;
25 import org.elasticsearch.index.query.BoolQueryBuilder;
26 import org.elasticsearch.index.query.CommonTermsQueryBuilder;
27 import org.elasticsearch.index.query.ExistsQueryBuilder;
28 import org.elasticsearch.index.query.IdsQueryBuilder;
29 import org.elasticsearch.index.query.MatchPhrasePrefixQueryBuilder;
30 import org.elasticsearch.index.query.MatchPhraseQueryBuilder;
31 import org.elasticsearch.index.query.MatchQueryBuilder;
32 import org.elasticsearch.index.query.RangeQueryBuilder;
33 import org.elasticsearch.index.query.TermQueryBuilder;
34 import org.elasticsearch.index.query.TermsQueryBuilder;
35 import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
36 import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder.FilterFunctionBuilder;
37
38
39
40
41 public abstract class BsUserInfoCQ extends EsAbstractConditionQuery {
42
43 protected static final Class<?> suppressUnusedImportLocalDateTime = LocalDateTime.class;
44
45
46
47
48 @Override
49 public String asTableDbName() {
50 return "user_info";
51 }
52
53 @Override
54 public String xgetAliasName() {
55 return "user_info";
56 }
57
58
59
60
61 public void functionScore(OperatorCall<UserInfoCQ> queryLambda, ScoreFunctionCall<ScoreFunctionCreator<UserInfoCQ>> functionsLambda,
62 final ConditionOptionCall<FunctionScoreQueryBuilder> opLambda) {
63 UserInfoCQ cq = new UserInfoCQ();
64 queryLambda.callback(cq);
65 final Collection<FilterFunctionBuilder> list = new ArrayList<>();
66 if (functionsLambda != null) {
67 functionsLambda.callback((cqLambda, scoreFunctionBuilder) -> {
68 UserInfoCQ cf = new UserInfoCQ();
69 cqLambda.callback(cf);
70 list.add(new FilterFunctionBuilder(cf.getQuery(), scoreFunctionBuilder));
71 });
72 }
73 final FunctionScoreQueryBuilder builder = regFunctionScoreQ(cq.getQuery(), list);
74 if (opLambda != null) {
75 opLambda.callback(builder);
76 }
77 }
78
79 public void filtered(FilteredCall<UserInfoCQ, UserInfoCQ> filteredLambda) {
80 filtered(filteredLambda, null);
81 }
82
83 public void filtered(FilteredCall<UserInfoCQ, UserInfoCQ> filteredLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
84 bool((must, should, mustNot, filter) -> {
85 filteredLambda.callback(must, filter);
86 }, opLambda);
87 }
88
89 public void not(OperatorCall<UserInfoCQ> notLambda) {
90 not(notLambda, null);
91 }
92
93 public void not(final OperatorCall<UserInfoCQ> notLambda, final ConditionOptionCall<BoolQueryBuilder> opLambda) {
94 bool((must, should, mustNot, filter) -> notLambda.callback(mustNot), opLambda);
95 }
96
97 public void bool(BoolCall<UserInfoCQ> boolLambda) {
98 bool(boolLambda, null);
99 }
100
101 public void bool(BoolCall<UserInfoCQ> boolLambda, ConditionOptionCall<BoolQueryBuilder> opLambda) {
102 UserInfoCQ mustQuery = new UserInfoCQ();
103 UserInfoCQ shouldQuery = new UserInfoCQ();
104 UserInfoCQ mustNotQuery = new UserInfoCQ();
105 UserInfoCQ filterQuery = new UserInfoCQ();
106 boolLambda.callback(mustQuery, shouldQuery, mustNotQuery, filterQuery);
107 if (mustQuery.hasQueries() || shouldQuery.hasQueries() || mustNotQuery.hasQueries() || filterQuery.hasQueries()) {
108 BoolQueryBuilder builder =
109 regBoolCQ(mustQuery.getQueryBuilderList(), shouldQuery.getQueryBuilderList(), mustNotQuery.getQueryBuilderList(),
110 filterQuery.getQueryBuilderList());
111 if (opLambda != null) {
112 opLambda.callback(builder);
113 }
114 }
115 }
116
117
118
119
120 public void setId_Equal(String id) {
121 setId_Term(id, null);
122 }
123
124 public void setId_Equal(String id, ConditionOptionCall<TermQueryBuilder> opLambda) {
125 setId_Term(id, opLambda);
126 }
127
128 public void setId_Term(String id) {
129 setId_Term(id, null);
130 }
131
132 public void setId_Term(String id, ConditionOptionCall<TermQueryBuilder> opLambda) {
133 TermQueryBuilder builder = regTermQ("_id", id);
134 if (opLambda != null) {
135 opLambda.callback(builder);
136 }
137 }
138
139 public void setId_NotEqual(String id) {
140 setId_NotTerm(id, null);
141 }
142
143 public void setId_NotTerm(String id) {
144 setId_NotTerm(id, null);
145 }
146
147 public void setId_NotEqual(String id, ConditionOptionCall<BoolQueryBuilder> opLambda) {
148 setId_NotTerm(id, opLambda);
149 }
150
151 public void setId_NotTerm(String id, ConditionOptionCall<BoolQueryBuilder> opLambda) {
152 not(not -> not.setId_Term(id), opLambda);
153 }
154
155 public void setId_Terms(Collection<String> idList) {
156 setId_Terms(idList, null);
157 }
158
159 public void setId_Terms(Collection<String> idList, ConditionOptionCall<IdsQueryBuilder> opLambda) {
160 IdsQueryBuilder builder = regIdsQ(idList);
161 if (opLambda != null) {
162 opLambda.callback(builder);
163 }
164 }
165
166 public void setId_InScope(Collection<String> idList) {
167 setId_Terms(idList, null);
168 }
169
170 public void setId_InScope(Collection<String> idList, ConditionOptionCall<IdsQueryBuilder> opLambda) {
171 setId_Terms(idList, opLambda);
172 }
173
174 public BsUserInfoCQ addOrderBy_Id_Asc() {
175 regOBA("_uid");
176 return this;
177 }
178
179 public BsUserInfoCQ addOrderBy_Id_Desc() {
180 regOBD("_uid");
181 return this;
182 }
183
184 public void setCreatedAt_Equal(LocalDateTime createdAt) {
185 setCreatedAt_Term(createdAt, null);
186 }
187
188 public void setCreatedAt_Equal(LocalDateTime createdAt, ConditionOptionCall<TermQueryBuilder> opLambda) {
189 setCreatedAt_Term(createdAt, opLambda);
190 }
191
192 public void setCreatedAt_Term(LocalDateTime createdAt) {
193 setCreatedAt_Term(createdAt, null);
194 }
195
196 public void setCreatedAt_Term(LocalDateTime createdAt, ConditionOptionCall<TermQueryBuilder> opLambda) {
197 TermQueryBuilder builder = regTermQ("createdAt", createdAt);
198 if (opLambda != null) {
199 opLambda.callback(builder);
200 }
201 }
202
203 public void setCreatedAt_NotEqual(LocalDateTime createdAt) {
204 setCreatedAt_NotTerm(createdAt, null);
205 }
206
207 public void setCreatedAt_NotTerm(LocalDateTime createdAt) {
208 setCreatedAt_NotTerm(createdAt, null);
209 }
210
211 public void setCreatedAt_NotEqual(LocalDateTime createdAt, ConditionOptionCall<BoolQueryBuilder> opLambda) {
212 setCreatedAt_NotTerm(createdAt, opLambda);
213 }
214
215 public void setCreatedAt_NotTerm(LocalDateTime createdAt, ConditionOptionCall<BoolQueryBuilder> opLambda) {
216 not(not -> not.setCreatedAt_Term(createdAt), opLambda);
217 }
218
219 public void setCreatedAt_Terms(Collection<LocalDateTime> createdAtList) {
220 setCreatedAt_Terms(createdAtList, null);
221 }
222
223 public void setCreatedAt_Terms(Collection<LocalDateTime> createdAtList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
224 TermsQueryBuilder builder = regTermsQ("createdAt", createdAtList);
225 if (opLambda != null) {
226 opLambda.callback(builder);
227 }
228 }
229
230 public void setCreatedAt_InScope(Collection<LocalDateTime> createdAtList) {
231 setCreatedAt_Terms(createdAtList, null);
232 }
233
234 public void setCreatedAt_InScope(Collection<LocalDateTime> createdAtList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
235 setCreatedAt_Terms(createdAtList, opLambda);
236 }
237
238 public void setCreatedAt_Match(LocalDateTime createdAt) {
239 setCreatedAt_Match(createdAt, null);
240 }
241
242 public void setCreatedAt_Match(LocalDateTime createdAt, ConditionOptionCall<MatchQueryBuilder> opLambda) {
243 MatchQueryBuilder builder = regMatchQ("createdAt", createdAt);
244 if (opLambda != null) {
245 opLambda.callback(builder);
246 }
247 }
248
249 public void setCreatedAt_MatchPhrase(LocalDateTime createdAt) {
250 setCreatedAt_MatchPhrase(createdAt, null);
251 }
252
253 public void setCreatedAt_MatchPhrase(LocalDateTime createdAt, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
254 MatchPhraseQueryBuilder builder = regMatchPhraseQ("createdAt", createdAt);
255 if (opLambda != null) {
256 opLambda.callback(builder);
257 }
258 }
259
260 public void setCreatedAt_MatchPhrasePrefix(LocalDateTime createdAt) {
261 setCreatedAt_MatchPhrasePrefix(createdAt, null);
262 }
263
264 public void setCreatedAt_MatchPhrasePrefix(LocalDateTime createdAt, ConditionOptionCall<MatchPhrasePrefixQueryBuilder> opLambda) {
265 MatchPhrasePrefixQueryBuilder builder = regMatchPhrasePrefixQ("createdAt", createdAt);
266 if (opLambda != null) {
267 opLambda.callback(builder);
268 }
269 }
270
271 public void setCreatedAt_Fuzzy(LocalDateTime createdAt) {
272 setCreatedAt_Fuzzy(createdAt, null);
273 }
274
275 public void setCreatedAt_Fuzzy(LocalDateTime createdAt, ConditionOptionCall<MatchQueryBuilder> opLambda) {
276 MatchQueryBuilder builder = regFuzzyQ("createdAt", createdAt);
277 if (opLambda != null) {
278 opLambda.callback(builder);
279 }
280 }
281
282 public void setCreatedAt_GreaterThan(LocalDateTime createdAt) {
283 setCreatedAt_GreaterThan(createdAt, null);
284 }
285
286 public void setCreatedAt_GreaterThan(LocalDateTime createdAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
287 final Object _value = toRangeLocalDateTimeString(createdAt, "date_optional_time");
288 RangeQueryBuilder builder = regRangeQ("createdAt", ConditionKey.CK_GREATER_THAN, _value);
289 if (opLambda != null) {
290 opLambda.callback(builder);
291 }
292 }
293
294 public void setCreatedAt_LessThan(LocalDateTime createdAt) {
295 setCreatedAt_LessThan(createdAt, null);
296 }
297
298 public void setCreatedAt_LessThan(LocalDateTime createdAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
299 final Object _value = toRangeLocalDateTimeString(createdAt, "date_optional_time");
300 RangeQueryBuilder builder = regRangeQ("createdAt", ConditionKey.CK_LESS_THAN, _value);
301 if (opLambda != null) {
302 opLambda.callback(builder);
303 }
304 }
305
306 public void setCreatedAt_GreaterEqual(LocalDateTime createdAt) {
307 setCreatedAt_GreaterEqual(createdAt, null);
308 }
309
310 public void setCreatedAt_GreaterEqual(LocalDateTime createdAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
311 final Object _value = toRangeLocalDateTimeString(createdAt, "date_optional_time");
312 RangeQueryBuilder builder = regRangeQ("createdAt", ConditionKey.CK_GREATER_EQUAL, _value);
313 if (opLambda != null) {
314 opLambda.callback(builder);
315 }
316 }
317
318 public void setCreatedAt_LessEqual(LocalDateTime createdAt) {
319 setCreatedAt_LessEqual(createdAt, null);
320 }
321
322 public void setCreatedAt_LessEqual(LocalDateTime createdAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
323 final Object _value = toRangeLocalDateTimeString(createdAt, "date_optional_time");
324 RangeQueryBuilder builder = regRangeQ("createdAt", ConditionKey.CK_LESS_EQUAL, _value);
325 if (opLambda != null) {
326 opLambda.callback(builder);
327 }
328 }
329
330 public void setCreatedAt_Exists() {
331 setCreatedAt_Exists(null);
332 }
333
334 public void setCreatedAt_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
335 ExistsQueryBuilder builder = regExistsQ("createdAt");
336 if (opLambda != null) {
337 opLambda.callback(builder);
338 }
339 }
340
341 public void setCreatedAt_CommonTerms(LocalDateTime createdAt) {
342 setCreatedAt_CommonTerms(createdAt, null);
343 }
344
345 public void setCreatedAt_CommonTerms(LocalDateTime createdAt, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
346 CommonTermsQueryBuilder builder = regCommonTermsQ("createdAt", createdAt);
347 if (opLambda != null) {
348 opLambda.callback(builder);
349 }
350 }
351
352 public BsUserInfoCQ addOrderBy_CreatedAt_Asc() {
353 regOBA("createdAt");
354 return this;
355 }
356
357 public BsUserInfoCQ addOrderBy_CreatedAt_Desc() {
358 regOBD("createdAt");
359 return this;
360 }
361
362 public void setUpdatedAt_Equal(LocalDateTime updatedAt) {
363 setUpdatedAt_Term(updatedAt, null);
364 }
365
366 public void setUpdatedAt_Equal(LocalDateTime updatedAt, ConditionOptionCall<TermQueryBuilder> opLambda) {
367 setUpdatedAt_Term(updatedAt, opLambda);
368 }
369
370 public void setUpdatedAt_Term(LocalDateTime updatedAt) {
371 setUpdatedAt_Term(updatedAt, null);
372 }
373
374 public void setUpdatedAt_Term(LocalDateTime updatedAt, ConditionOptionCall<TermQueryBuilder> opLambda) {
375 TermQueryBuilder builder = regTermQ("updatedAt", updatedAt);
376 if (opLambda != null) {
377 opLambda.callback(builder);
378 }
379 }
380
381 public void setUpdatedAt_NotEqual(LocalDateTime updatedAt) {
382 setUpdatedAt_NotTerm(updatedAt, null);
383 }
384
385 public void setUpdatedAt_NotTerm(LocalDateTime updatedAt) {
386 setUpdatedAt_NotTerm(updatedAt, null);
387 }
388
389 public void setUpdatedAt_NotEqual(LocalDateTime updatedAt, ConditionOptionCall<BoolQueryBuilder> opLambda) {
390 setUpdatedAt_NotTerm(updatedAt, opLambda);
391 }
392
393 public void setUpdatedAt_NotTerm(LocalDateTime updatedAt, ConditionOptionCall<BoolQueryBuilder> opLambda) {
394 not(not -> not.setUpdatedAt_Term(updatedAt), opLambda);
395 }
396
397 public void setUpdatedAt_Terms(Collection<LocalDateTime> updatedAtList) {
398 setUpdatedAt_Terms(updatedAtList, null);
399 }
400
401 public void setUpdatedAt_Terms(Collection<LocalDateTime> updatedAtList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
402 TermsQueryBuilder builder = regTermsQ("updatedAt", updatedAtList);
403 if (opLambda != null) {
404 opLambda.callback(builder);
405 }
406 }
407
408 public void setUpdatedAt_InScope(Collection<LocalDateTime> updatedAtList) {
409 setUpdatedAt_Terms(updatedAtList, null);
410 }
411
412 public void setUpdatedAt_InScope(Collection<LocalDateTime> updatedAtList, ConditionOptionCall<TermsQueryBuilder> opLambda) {
413 setUpdatedAt_Terms(updatedAtList, opLambda);
414 }
415
416 public void setUpdatedAt_Match(LocalDateTime updatedAt) {
417 setUpdatedAt_Match(updatedAt, null);
418 }
419
420 public void setUpdatedAt_Match(LocalDateTime updatedAt, ConditionOptionCall<MatchQueryBuilder> opLambda) {
421 MatchQueryBuilder builder = regMatchQ("updatedAt", updatedAt);
422 if (opLambda != null) {
423 opLambda.callback(builder);
424 }
425 }
426
427 public void setUpdatedAt_MatchPhrase(LocalDateTime updatedAt) {
428 setUpdatedAt_MatchPhrase(updatedAt, null);
429 }
430
431 public void setUpdatedAt_MatchPhrase(LocalDateTime updatedAt, ConditionOptionCall<MatchPhraseQueryBuilder> opLambda) {
432 MatchPhraseQueryBuilder builder = regMatchPhraseQ("updatedAt", updatedAt);
433 if (opLambda != null) {
434 opLambda.callback(builder);
435 }
436 }
437
438 public void setUpdatedAt_MatchPhrasePrefix(LocalDateTime updatedAt) {
439 setUpdatedAt_MatchPhrasePrefix(updatedAt, null);
440 }
441
442 public void setUpdatedAt_MatchPhrasePrefix(LocalDateTime updatedAt, ConditionOptionCall<MatchPhrasePrefixQueryBuilder> opLambda) {
443 MatchPhrasePrefixQueryBuilder builder = regMatchPhrasePrefixQ("updatedAt", updatedAt);
444 if (opLambda != null) {
445 opLambda.callback(builder);
446 }
447 }
448
449 public void setUpdatedAt_Fuzzy(LocalDateTime updatedAt) {
450 setUpdatedAt_Fuzzy(updatedAt, null);
451 }
452
453 public void setUpdatedAt_Fuzzy(LocalDateTime updatedAt, ConditionOptionCall<MatchQueryBuilder> opLambda) {
454 MatchQueryBuilder builder = regFuzzyQ("updatedAt", updatedAt);
455 if (opLambda != null) {
456 opLambda.callback(builder);
457 }
458 }
459
460 public void setUpdatedAt_GreaterThan(LocalDateTime updatedAt) {
461 setUpdatedAt_GreaterThan(updatedAt, null);
462 }
463
464 public void setUpdatedAt_GreaterThan(LocalDateTime updatedAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
465 final Object _value = toRangeLocalDateTimeString(updatedAt, "date_optional_time");
466 RangeQueryBuilder builder = regRangeQ("updatedAt", ConditionKey.CK_GREATER_THAN, _value);
467 if (opLambda != null) {
468 opLambda.callback(builder);
469 }
470 }
471
472 public void setUpdatedAt_LessThan(LocalDateTime updatedAt) {
473 setUpdatedAt_LessThan(updatedAt, null);
474 }
475
476 public void setUpdatedAt_LessThan(LocalDateTime updatedAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
477 final Object _value = toRangeLocalDateTimeString(updatedAt, "date_optional_time");
478 RangeQueryBuilder builder = regRangeQ("updatedAt", ConditionKey.CK_LESS_THAN, _value);
479 if (opLambda != null) {
480 opLambda.callback(builder);
481 }
482 }
483
484 public void setUpdatedAt_GreaterEqual(LocalDateTime updatedAt) {
485 setUpdatedAt_GreaterEqual(updatedAt, null);
486 }
487
488 public void setUpdatedAt_GreaterEqual(LocalDateTime updatedAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
489 final Object _value = toRangeLocalDateTimeString(updatedAt, "date_optional_time");
490 RangeQueryBuilder builder = regRangeQ("updatedAt", ConditionKey.CK_GREATER_EQUAL, _value);
491 if (opLambda != null) {
492 opLambda.callback(builder);
493 }
494 }
495
496 public void setUpdatedAt_LessEqual(LocalDateTime updatedAt) {
497 setUpdatedAt_LessEqual(updatedAt, null);
498 }
499
500 public void setUpdatedAt_LessEqual(LocalDateTime updatedAt, ConditionOptionCall<RangeQueryBuilder> opLambda) {
501 final Object _value = toRangeLocalDateTimeString(updatedAt, "date_optional_time");
502 RangeQueryBuilder builder = regRangeQ("updatedAt", ConditionKey.CK_LESS_EQUAL, _value);
503 if (opLambda != null) {
504 opLambda.callback(builder);
505 }
506 }
507
508 public void setUpdatedAt_Exists() {
509 setUpdatedAt_Exists(null);
510 }
511
512 public void setUpdatedAt_Exists(ConditionOptionCall<ExistsQueryBuilder> opLambda) {
513 ExistsQueryBuilder builder = regExistsQ("updatedAt");
514 if (opLambda != null) {
515 opLambda.callback(builder);
516 }
517 }
518
519 public void setUpdatedAt_CommonTerms(LocalDateTime updatedAt) {
520 setUpdatedAt_CommonTerms(updatedAt, null);
521 }
522
523 public void setUpdatedAt_CommonTerms(LocalDateTime updatedAt, ConditionOptionCall<CommonTermsQueryBuilder> opLambda) {
524 CommonTermsQueryBuilder builder = regCommonTermsQ("updatedAt", updatedAt);
525 if (opLambda != null) {
526 opLambda.callback(builder);
527 }
528 }
529
530 public BsUserInfoCQ addOrderBy_UpdatedAt_Asc() {
531 regOBA("updatedAt");
532 return this;
533 }
534
535 public BsUserInfoCQ addOrderBy_UpdatedAt_Desc() {
536 regOBD("updatedAt");
537 return this;
538 }
539
540 }