Package ca.uhn.fhir.jpa.search.builder
Class SearchBuilder
java.lang.Object
ca.uhn.fhir.jpa.search.builder.SearchBuilder
- All Implemented Interfaces:
ISearchBuilder
The SearchBuilder is responsible for actually forming the SQL query that handles
searches for resources
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Deprecated.static final int
protected javax.persistence.EntityManager
protected ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster
protected IResourceTagDao
static boolean
-
Constructor Summary
ConstructorsConstructorDescriptionSearchBuilder
(ca.uhn.fhir.jpa.api.dao.IDao theDao, String theResourceName, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theResourceType) Constructor -
Method Summary
Modifier and TypeMethodDescriptioncreateCountQuery
(SearchParameterMap theParams, String theSearchUuid, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) createQuery
(SearchParameterMap theParams, SearchRuntimeDetails theSearchRuntimeDetails, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) javax.persistence.criteria.CriteriaBuilder
static int
Class<? extends org.hl7.fhir.instance.model.api.IBaseResource>
Set<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId>
loadIncludes
(ca.uhn.fhir.context.FhirContext theContext, javax.persistence.EntityManager theEntityManager, Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> theMatches, Set<ca.uhn.fhir.model.api.Include> theIncludes, boolean theReverseMode, ca.uhn.fhir.rest.param.DateRangeParam theLastUpdated, String theSearchIdOrDescription, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, Integer theMaxCount) THIS SHOULD RETURN HASHSET and not just Set because we add to it later so it can't be Collections.emptySet() or some such thingvoid
loadResourcesByPid
(Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> thePids, Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> theIncludedPids, List<org.hl7.fhir.instance.model.api.IBaseResource> theResourceListToPopulate, boolean theForHistoryOperation, ca.uhn.fhir.rest.api.server.RequestDetails theDetails) void
setDaoConfigForUnitTest
(ca.uhn.fhir.jpa.api.config.DaoConfig theDaoConfig) void
setFetchSize
(int theFetchSize) How many results may be fetched at oncestatic void
setMaxPageSize50ForTest
(boolean theIsTest) void
setMaxResultsToFetch
(Integer theMaxResultsToFetch) void
setPreviouslyAddedResourcePids
(List<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> thePidSet) static javax.persistence.criteria.Predicate[]
toPredicateArray
(List<javax.persistence.criteria.Predicate> thePredicates)
-
Field Details
-
MAXIMUM_PAGE_SIZE
Deprecated.See loadResourcesByPid for an explanation of why we use the constant 800- See Also:
-
MAXIMUM_PAGE_SIZE_FOR_TESTING
- See Also:
-
myUseMaxPageSize50ForTest
-
myInterceptorBroadcaster
-
myResourceTagDao
-
myEntityManager
-
-
Constructor Details
-
SearchBuilder
public SearchBuilder(ca.uhn.fhir.jpa.api.dao.IDao theDao, String theResourceName, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theResourceType) Constructor
-
-
Method Details
-
setMaxResultsToFetch
- Specified by:
setMaxResultsToFetch
in interfaceISearchBuilder
-
createCountQuery
public Iterator<Long> createCountQuery(SearchParameterMap theParams, String theSearchUuid, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) - Specified by:
createCountQuery
in interfaceISearchBuilder
-
setPreviouslyAddedResourcePids
public void setPreviouslyAddedResourcePids(@Nonnull List<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> thePidSet) - Specified by:
setPreviouslyAddedResourcePids
in interfaceISearchBuilder
- Parameters:
thePidSet
- May be null
-
createQuery
public IResultIterator createQuery(SearchParameterMap theParams, SearchRuntimeDetails theSearchRuntimeDetails, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) - Specified by:
createQuery
in interfaceISearchBuilder
-
loadResourcesByPid
public void loadResourcesByPid(Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> thePids, Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> theIncludedPids, List<org.hl7.fhir.instance.model.api.IBaseResource> theResourceListToPopulate, boolean theForHistoryOperation, ca.uhn.fhir.rest.api.server.RequestDetails theDetails) - Specified by:
loadResourcesByPid
in interfaceISearchBuilder
-
loadIncludes
public Set<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> loadIncludes(ca.uhn.fhir.context.FhirContext theContext, javax.persistence.EntityManager theEntityManager, Collection<ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId> theMatches, Set<ca.uhn.fhir.model.api.Include> theIncludes, boolean theReverseMode, ca.uhn.fhir.rest.param.DateRangeParam theLastUpdated, String theSearchIdOrDescription, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, Integer theMaxCount) THIS SHOULD RETURN HASHSET and not just Set because we add to it later so it can't be Collections.emptySet() or some such thing- Specified by:
loadIncludes
in interfaceISearchBuilder
-
setFetchSize
Description copied from interface:ISearchBuilder
How many results may be fetched at once- Specified by:
setFetchSize
in interfaceISearchBuilder
-
getParams
-
getBuilder
-
getResourceType
-
getResourceName
-
setDaoConfigForUnitTest
-
getMaximumPageSize
-
setMaxPageSize50ForTest
-
toPredicateArray
public static javax.persistence.criteria.Predicate[] toPredicateArray(List<javax.persistence.criteria.Predicate> thePredicates)
-