Package ca.uhn.fhir.jpa.dao
Class LegacySearchBuilder
java.lang.Object
ca.uhn.fhir.jpa.dao.LegacySearchBuilder
- 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 TypeFieldDescriptionprotected javax.persistence.EntityManager
protected ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster
protected IResourceTagDao
-
Constructor Summary
ConstructorsConstructorDescriptionLegacySearchBuilder
(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
Class<? extends org.hl7.fhir.instance.model.api.IBaseResource>
HashSet<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> theRevIncludes, 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 oncevoid
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
-
myInterceptorBroadcaster
-
myResourceTagDao
-
myEntityManager
-
-
Constructor Details
-
LegacySearchBuilder
public LegacySearchBuilder(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 HashSet<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> theRevIncludes, 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
-
getQueryStack
-
getResourceType
-
getResourceName
-
setDaoConfigForUnitTest
-
toPredicateArray
public static javax.persistence.criteria.Predicate[] toPredicateArray(List<javax.persistence.criteria.Predicate> thePredicates)
-