Package ca.uhn.fhir.jpa.dao
Class BaseHapiFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,MT>
java.lang.Object
ca.uhn.fhir.jpa.dao.BaseStorageDao
ca.uhn.fhir.jpa.dao.BaseHapiFhirSystemDao<T,MT>
- All Implemented Interfaces:
IDao
,IFhirSystemDao<T,
MT>
- Direct Known Subclasses:
FhirSystemDaoDstu2
,FhirSystemDaoDstu3
,FhirSystemDaoR4
,FhirSystemDaoR4B
,FhirSystemDaoR5
public abstract class BaseHapiFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,MT>
extends BaseStorageDao
implements IFhirSystemDao<T,MT>
-
Field Summary
Modifier and TypeFieldDescriptionprotected jakarta.persistence.EntityManager
Fields inherited from class ca.uhn.fhir.jpa.dao.BaseStorageDao
MESSAGE_KEY_DELETE_RESOURCE_ALREADY_DELETED, MESSAGE_KEY_DELETE_RESOURCE_NOT_EXISTING, myDaoRegistry, myFhirContext, myMetaTagSorter, myResourceVersionSvc, mySearchParamRegistry, myStorageSettings, OO_ISSUE_CODE_INFORMATIONAL, OO_SEVERITY_ERROR, OO_SEVERITY_INFO, OO_SEVERITY_WARN
Fields inherited from interface ca.uhn.fhir.jpa.api.dao.IDao
CURRENTLY_REINDEXING, RESOURCE_PID, RESOURCE_PID_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexpunge
(ExpungeOptions theExpungeOptions, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) ca.uhn.fhir.context.FhirContext
protected ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster
protected String
protected JpaStorageSettings
ca.uhn.fhir.rest.api.server.IBundleProvider
history
(Date theSince, Date theUntil, Integer theOffset, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) <P extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId>
voidpreFetchResources
(List<P> theResolvedIds, boolean thePreFetchIndexes) Prefetch entities into the Hibernate session.void
setStorageSettingsForUnitTest
(JpaStorageSettings theStorageSettings) void
setTransactionProcessorForUnitTest
(TransactionProcessor theTransactionProcessor) transaction
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, T theRequest) transactionNested
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, T theRequest) Methods inherited from class ca.uhn.fhir.jpa.dao.BaseStorageDao
addIssueToOperationOutcomeForAutoCreatedPlaceholder, clearRequestAsProcessingSubRequest, createErrorOperationOutcome, createInfoOperationOutcome, createInfoOperationOutcome, createMethodOutcomeForResourceId, createOperationOutcome, createResourceGoneException, doCallHooks, extractReferencesToAutoVersion, extractReferencesToAvoidReplacement, markRequestAsProcessingSubRequest, populateOperationOutcomeForUpdate, preProcessResourceForStorage, preProcessResourceForStorage, setMyMetaTagSorter, setSearchParamRegistry, toMethodOutcome, toMethodOutcomeLazy, translateRawParameters
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ca.uhn.fhir.jpa.api.dao.IFhirSystemDao
metaGetOperation, processMessage
-
Field Details
-
myResourceCountsCache
-
myEntityManager
-
-
Constructor Details
-
BaseHapiFhirSystemDao
public BaseHapiFhirSystemDao()
-
-
Method Details
-
setTransactionProcessorForUnitTest
-
expunge
@Transactional(propagation=NEVER) public ExpungeOutcome expunge(ExpungeOptions theExpungeOptions, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
expunge
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT>
-
getResourceCounts
- Specified by:
getResourceCounts
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT>
-
getResourceCountsFromCache
- Specified by:
getResourceCountsFromCache
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT>
-
history
public ca.uhn.fhir.rest.api.server.IBundleProvider history(Date theSince, Date theUntil, Integer theOffset, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) - Specified by:
history
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT>
-
transaction
- Specified by:
transaction
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT>
-
transactionNested
public T transactionNested(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, T theRequest) - Specified by:
transactionNested
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT>
-
preFetchResources
public <P extends ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId> void preFetchResources(List<P> theResolvedIds, boolean thePreFetchIndexes) Prefetch entities into the Hibernate session. When processing several resources (e.g. transaction bundle, $reindex chunk, etc.) it would be slow to fetch each piece of a resource (e.g. all token index rows) one resource at a time. Instead, we fetch all the linked resources for the entire batch and populate the Hibernate Session.- Specified by:
preFetchResources
in interfaceIFhirSystemDao<T extends org.hl7.fhir.instance.model.api.IBaseBundle,
MT> - Parameters:
theResolvedIds
- the pidsthePreFetchIndexes
- Should resource indexes be loaded
-
getResourceName
- Specified by:
getResourceName
in classBaseStorageDao
-
getInterceptorBroadcaster
- Specified by:
getInterceptorBroadcaster
in classBaseStorageDao
-
getStorageSettings
- Specified by:
getStorageSettings
in classBaseStorageDao
-
getContext
- Specified by:
getContext
in interfaceIDao
- Specified by:
getContext
in classBaseStorageDao
-
setStorageSettingsForUnitTest
-