• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

openmrs / openmrs-core / 14752386992

30 Apr 2025 10:25AM UTC coverage: 64.96% (-0.1%) from 65.095%
14752386992

push

github

web-flow
TRUNK-6316 Upgrade Hibernate Search to 6.2.4 (#5005)

501 of 591 new or added lines in 24 files covered. (84.77%)

21 existing lines in 6 files now uncovered.

23344 of 35936 relevant lines covered (64.96%)

0.65 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

42.11
/api/src/main/java/org/openmrs/api/db/hibernate/search/session/SearchQueryWhereDelegate.java
1
/**
2
 * This Source Code Form is subject to the terms of the Mozilla Public License,
3
 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
4
 * obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5
 * the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6
 *
7
 * Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8
 * graphic logo is a trademark of OpenMRS Inc.
9
 */
10
package org.openmrs.api.db.hibernate.search.session;
11

12
import java.util.function.BiConsumer;
13
import java.util.function.Function;
14

15
import org.hibernate.search.engine.search.predicate.SearchPredicate;
16
import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep;
17
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
18
import org.hibernate.search.engine.search.predicate.dsl.SimpleBooleanPredicateClausesCollector;
19
import org.hibernate.search.engine.search.query.dsl.SearchQueryOptionsStep;
20
import org.hibernate.search.engine.search.query.dsl.SearchQueryWhereStep;
21

22
/**
23
 * Used by {@link SearchQuerySelectDelegate}.
24
 * For internal use only.
25
 * 
26
 * @since 2.8.0
27
 */
28
class SearchQueryWhereDelegate<
29
        N extends SearchQueryOptionsStep<?, H, LOS, ?, ?>,
30
        H,
31
        LOS,
32
        PDF extends SearchPredicateFactory> implements SearchQueryWhereStep<N, H, LOS, PDF> {
33

34
        private final SearchQueryWhereStep<N, H, LOS, PDF> delegate;
35

36
        private final Function<SearchPredicateFactory, SearchPredicate> finalPredicate;
37
        
38
        public SearchQueryWhereDelegate(SearchQueryWhereStep<N, H, LOS, PDF> delegate, 
39
                                                                        Function<SearchPredicateFactory, SearchPredicate> finalPredicate) {
1✔
40
                this.delegate = delegate;
1✔
41
                this.finalPredicate = finalPredicate;
1✔
42
        }
1✔
43

44
        @Override
45
        public N where(SearchPredicate predicate) {
46
                return delegate.where((f, root) -> {
1✔
47
                        root.add(predicate);
1✔
48
                        if (finalPredicate != null) {
1✔
NEW
49
                                root.add(finalPredicate.apply(f));
×
50
                        }
51
                });
1✔
52
        }
53

54
        @Override
55
        public N where(Function<? super PDF, ? extends PredicateFinalStep> predicateContributor) {
NEW
56
                return  delegate.where((f, root) -> {
×
NEW
57
                        root.add(predicateContributor.apply(f));
×
NEW
58
                        if (finalPredicate != null) {
×
NEW
59
                                root.add(finalPredicate.apply(f));
×
60
                        }
NEW
61
                });
×
62
        }
63

64
        @Override
65
        public N where(BiConsumer<? super PDF, ? super SimpleBooleanPredicateClausesCollector<?>> predicateContributor) {
NEW
66
                return delegate.where((f, root) -> {
×
NEW
67
                        predicateContributor.accept(f, root);
×
NEW
68
                        if (finalPredicate != null) {
×
NEW
69
                                root.add(finalPredicate.apply(f));
×
70
                        }
NEW
71
                });
×
72
        }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc