
Package ca.uhn.fhir.jpa.search.builder
Class SearchBuilder
java.lang.Object
ca.uhn.fhir.jpa.search.builder.SearchBuilder
- All Implemented Interfaces:
ISearchBuilder<JpaPid>
The SearchBuilder is responsible for actually forming the SQL query that handles
searches for resources
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JpaPid[]static final intDeprecated.protected jakarta.persistence.EntityManagerprotected final ca.uhn.fhir.interceptor.api.IInterceptorBroadcasterstatic Integerprotected final IResourceTagDaostatic final Stringstatic final Stringstatic final StringFields inherited from interface ca.uhn.fhir.jpa.dao.ISearchBuilder
SEARCH_BUILDER_BEAN_NAME -
Constructor Summary
ConstructorsConstructorDescriptionSearchBuilder(String theResourceName, JpaStorageSettings theStorageSettings, ca.uhn.fhir.jpa.config.HapiFhirLocalContainerEntityManagerFactoryBean theEntityManagerFactory, SqlObjectFactory theSqlBuilderFactory, HibernatePropertiesProvider theDialectProvider, ca.uhn.fhir.rest.server.util.ISearchParamRegistry theSearchParamRegistry, PartitionSettings thePartitionSettings, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster, IResourceTagDao theResourceTagDao, DaoRegistry theDaoRegistry, ca.uhn.fhir.context.FhirContext theContext, IIdHelperService theIdHelperService, IResourceHistoryTableDao theResourceHistoryTagDao, IJpaStorageResourceParser theIJpaStorageResourceParser, 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, RequestPartitionId theRequestPartitionId) createQuery(SearchParameterMap theParams, SearchRuntimeDetails theSearchRuntimeDetails, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, RequestPartitionId theRequestPartitionId) static Optional<ResourceHistoryTable> findLatestVersion(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, JpaPid nextWantedPid, IResourceHistoryTableDao resourceHistoryTableDao, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster interceptorBroadcaster1) jakarta.persistence.criteria.CriteriaBuilderstatic intClass<? extends org.hl7.fhir.instance.model.api.IBaseResource> loadIncludes(ca.uhn.fhir.context.FhirContext theContext, jakarta.persistence.EntityManager theEntityManager, Collection<JpaPid> theMatches, Collection<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.loadIncludes(SearchBuilderLoadIncludesParameters<JpaPid> theParameters) voidloadResourcesByPid(Collection<JpaPid> thePids, Collection<JpaPid> theIncludedPids, List<org.hl7.fhir.instance.model.api.IBaseResource> theResourceListToPopulate, boolean theForHistoryOperation, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) booleanvoidsetDeduplicateInDatabase(boolean theShouldDeduplicateInDB) voidsetFetchSize(int theFetchSize) voidsetFullTextSearch(IFulltextSearchSvc theFulltextSearchSvc) static voidsetMaxPageSizeForTest(Integer theTestSize) voidsetMaxResultsToFetch(Integer theMaxResultsToFetch) voidsetPreviouslyAddedResourcePids(List<JpaPid> thePidSet) voidsetRequireTotal(boolean theRequireTotal) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ca.uhn.fhir.jpa.dao.ISearchBuilder
createQueryStream, loadResourcesByPid
-
Field Details
-
MAXIMUM_PAGE_SIZE
Deprecated.See loadResourcesByPid for an explanation of why we use the constant 800- See Also:
-
RESOURCE_ID_ALIAS
- See Also:
-
PARTITION_ID_ALIAS
- See Also:
-
RESOURCE_VERSION_ALIAS
- See Also:
-
EMPTY_JPA_PID_ARRAY
-
myMaxPageSizeForTests
-
myInterceptorBroadcaster
-
myResourceTagDao
-
myEntityManager
-
-
Constructor Details
-
SearchBuilder
public SearchBuilder(String theResourceName, JpaStorageSettings theStorageSettings, ca.uhn.fhir.jpa.config.HapiFhirLocalContainerEntityManagerFactoryBean theEntityManagerFactory, SqlObjectFactory theSqlBuilderFactory, HibernatePropertiesProvider theDialectProvider, ca.uhn.fhir.rest.server.util.ISearchParamRegistry theSearchParamRegistry, PartitionSettings thePartitionSettings, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster theInterceptorBroadcaster, IResourceTagDao theResourceTagDao, DaoRegistry theDaoRegistry, ca.uhn.fhir.context.FhirContext theContext, IIdHelperService theIdHelperService, IResourceHistoryTableDao theResourceHistoryTagDao, IJpaStorageResourceParser theIJpaStorageResourceParser, Class<? extends org.hl7.fhir.instance.model.api.IBaseResource> theResourceType) Constructor
-
-
Method Details
-
setFullTextSearch
-
setMaxResultsToFetch
- Specified by:
setMaxResultsToFetchin interfaceISearchBuilder<JpaPid>
-
setDeduplicateInDatabase
- Specified by:
setDeduplicateInDatabasein interfaceISearchBuilder<JpaPid>
-
setRequireTotal
- Specified by:
setRequireTotalin interfaceISearchBuilder<JpaPid>
-
requiresTotal
- Specified by:
requiresTotalin interfaceISearchBuilder<JpaPid>
-
createCountQuery
public Long createCountQuery(SearchParameterMap theParams, String theSearchUuid, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull RequestPartitionId theRequestPartitionId) - Specified by:
createCountQueryin interfaceISearchBuilder<JpaPid>
-
setPreviouslyAddedResourcePids
- Specified by:
setPreviouslyAddedResourcePidsin interfaceISearchBuilder<JpaPid>- Parameters:
thePidSet- May be null
-
createQuery
public IResultIterator<JpaPid> createQuery(SearchParameterMap theParams, SearchRuntimeDetails theSearchRuntimeDetails, ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull RequestPartitionId theRequestPartitionId) - Specified by:
createQueryin interfaceISearchBuilder<JpaPid>
-
findLatestVersion
@Nonnull public static Optional<ResourceHistoryTable> findLatestVersion(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, JpaPid nextWantedPid, IResourceHistoryTableDao resourceHistoryTableDao, ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster interceptorBroadcaster1) -
loadResourcesByPid
public void loadResourcesByPid(Collection<JpaPid> thePids, Collection<JpaPid> theIncludedPids, List<org.hl7.fhir.instance.model.api.IBaseResource> theResourceListToPopulate, boolean theForHistoryOperation, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
loadResourcesByPidin interfaceISearchBuilder<JpaPid>
-
loadIncludes
public Set<JpaPid> loadIncludes(ca.uhn.fhir.context.FhirContext theContext, jakarta.persistence.EntityManager theEntityManager, Collection<JpaPid> theMatches, Collection<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. The JpaPid returned will have resource type populated.- Specified by:
loadIncludesin interfaceISearchBuilder<JpaPid>
-
loadIncludes
- Specified by:
loadIncludesin interfaceISearchBuilder<JpaPid>
-
setFetchSize
- Specified by:
setFetchSizein interfaceISearchBuilder<JpaPid>
-
getParams
-
getBuilder
-
getResourceType
-
getResourceName
-
getMaximumPageSize
-
setMaxPageSizeForTest
-