• 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

50.0
/api/src/main/java/org/openmrs/api/db/hibernate/search/SearchAndEntityCollection.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;
11

12

13
import java.util.Collection;
14
import java.util.function.Function;
15

16
import org.hibernate.search.engine.search.predicate.SearchPredicate;
17
import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory;
18

19
/**
20
 * Wrapper class around a {@link SearchQueryContributor} object and the Type of the entities to be searched
21
 * by the query. An instance of this class is set as the source of a
22
 * {@link SearchCreatedEvent} object.
23
 * 
24
 * @since 2.8.0
25
 */
26
public class SearchAndEntityCollection<T> implements SearchQueryContributor {
27
        
28
        private final SearchQueryContributor queryContributor;
29
        
30
        private final Collection<? extends Class<? extends T>> entityCollection;
31
        
32
        public SearchAndEntityCollection(SearchQueryContributor query, 
33
                                                                         Collection<? extends Class<? extends T>> entityCollection) {
1✔
34
                this.queryContributor = query;
1✔
35
                this.entityCollection = entityCollection;
1✔
36
        }
1✔
37
        
38
        @Override
39
        public void setFinalPredicate(Function<SearchPredicateFactory, SearchPredicate> finalPredicate) {
NEW
40
                queryContributor.setFinalPredicate(finalPredicate);
×
NEW
41
        }
×
42

43
        @Override
44
        public Function<SearchPredicateFactory, SearchPredicate> getFinalPredicate() {
NEW
45
                return queryContributor.getFinalPredicate();
×
46
        }
47

48
        /**
49
         * Gets the entityCollection
50
         *
51
         * @return the entityCollection
52
         */
53
        public Collection<? extends Class<? extends T>> getEntityCollection() {
NEW
54
                return entityCollection;
×
55
        }
56
        
57
}
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