Package ca.uhn.fhir.jpa.dao
Class BaseStorageDao
java.lang.Object
ca.uhn.fhir.jpa.dao.BaseStorageDao
- Direct Known Subclasses:
BaseStorageResourceDao
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
protected DaoRegistry
protected ca.uhn.fhir.context.FhirContext
protected IMetaTagSorter
protected IResourceVersionSvc
protected ca.uhn.fhir.rest.server.util.ISearchParamRegistry
protected JpaStorageSettings
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
clearRequestAsProcessingSubRequest
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) org.hl7.fhir.instance.model.api.IBaseOperationOutcome
createErrorOperationOutcome
(String theMessage, String theCode) org.hl7.fhir.instance.model.api.IBaseOperationOutcome
createInfoOperationOutcome
(String theMessage) org.hl7.fhir.instance.model.api.IBaseOperationOutcome
createInfoOperationOutcome
(String theMessage, ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) protected DaoMethodOutcome
createMethodOutcomeForResourceId
(String theResourceId, String theMessageKey, ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) Creates a base method outcome for a delete request for the provided ID.protected org.hl7.fhir.instance.model.api.IBaseOperationOutcome
createOperationOutcome
(String theSeverity, String theMessage, String theCode, ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) protected ca.uhn.fhir.rest.server.exceptions.ResourceGoneException
createResourceGoneException
(IBasePersistedResource theResourceEntity) protected void
doCallHooks
(ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.interceptor.api.Pointcut thePointcut, ca.uhn.fhir.interceptor.api.HookParams theParams) static Set
<org.hl7.fhir.instance.model.api.IBaseReference> extractReferencesToAutoVersion
(ca.uhn.fhir.context.FhirContext theFhirContext, StorageSettings theStorageSettings, org.hl7.fhir.instance.model.api.IBaseResource theResource) Extracts a list of references that should be auto-versioned.protected abstract ca.uhn.fhir.context.FhirContext
Provides the FHIR contextprotected abstract ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster
protected abstract String
Returns the resource type for this DAO, or null if this is a system-level DAOprotected abstract JpaStorageSettings
Provide the JpaStorageSettingsstatic void
markRequestAsProcessingSubRequest
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) protected void
populateOperationOutcomeForUpdate
(ca.uhn.fhir.util.StopWatch theItemStopwatch, DaoMethodOutcome theMethodOutcome, String theMatchUrl, ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType) protected void
preProcessResourceForStorage
(org.hl7.fhir.instance.model.api.IBaseResource theResource) Deprecated.protected void
preProcessResourceForStorage
(org.hl7.fhir.instance.model.api.IBaseResource theResource, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, boolean thePerformIndexing) May be overridden by subclasses to validate resources prior to storagevoid
setMyMetaTagSorter
(IMetaTagSorter theMetaTagSorter) void
setSearchParamRegistry
(ca.uhn.fhir.rest.server.util.ISearchParamRegistry theSearchParamRegistry) protected DaoMethodOutcome
toMethodOutcome
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, IBasePersistedResource theEntity, org.hl7.fhir.instance.model.api.IBaseResource theResource, String theMatchUrl, ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType) protected DaoMethodOutcome
toMethodOutcomeLazy
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId theResourcePersistentId, Supplier<LazyDaoMethodOutcome.EntityAndResource> theEntity, Supplier<org.hl7.fhir.instance.model.api.IIdType> theIdSupplier) void
translateRawParameters
(Map<String, List<String>> theSource, SearchParameterMap theTarget)
-
Field Details
-
OO_SEVERITY_ERROR
- See Also:
-
OO_SEVERITY_INFO
- See Also:
-
OO_SEVERITY_WARN
- See Also:
-
MESSAGE_KEY_DELETE_RESOURCE_NOT_EXISTING
- See Also:
-
MESSAGE_KEY_DELETE_RESOURCE_ALREADY_DELETED
- See Also:
-
mySearchParamRegistry
-
myFhirContext
-
myDaoRegistry
-
myResourceVersionSvc
-
myStorageSettings
-
myMetaTagSorter
-
-
Constructor Details
-
BaseStorageDao
public BaseStorageDao()
-
-
Method Details
-
setSearchParamRegistry
public void setSearchParamRegistry(ca.uhn.fhir.rest.server.util.ISearchParamRegistry theSearchParamRegistry) -
setMyMetaTagSorter
-
preProcessResourceForStorage
protected void preProcessResourceForStorage(org.hl7.fhir.instance.model.api.IBaseResource theResource) Deprecated.May be overridden by subclasses to validate resources prior to storage- Parameters:
theResource
- The resource that is about to be stored
-
preProcessResourceForStorage
protected void preProcessResourceForStorage(org.hl7.fhir.instance.model.api.IBaseResource theResource, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, boolean thePerformIndexing) May be overridden by subclasses to validate resources prior to storage- Parameters:
theResource
- The resource that is about to be stored- Since:
- 5.3.0
-
toMethodOutcome
protected DaoMethodOutcome toMethodOutcome(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull IBasePersistedResource theEntity, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theResource, @Nullable String theMatchUrl, @Nonnull ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType) -
toMethodOutcomeLazy
protected DaoMethodOutcome toMethodOutcomeLazy(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ca.uhn.fhir.rest.api.server.storage.IResourcePersistentId theResourcePersistentId, @Nonnull Supplier<LazyDaoMethodOutcome.EntityAndResource> theEntity, Supplier<org.hl7.fhir.instance.model.api.IIdType> theIdSupplier) -
doCallHooks
protected void doCallHooks(ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails, ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails, ca.uhn.fhir.interceptor.api.Pointcut thePointcut, ca.uhn.fhir.interceptor.api.HookParams theParams) -
getInterceptorBroadcaster
-
createErrorOperationOutcome
public org.hl7.fhir.instance.model.api.IBaseOperationOutcome createErrorOperationOutcome(String theMessage, String theCode) -
createInfoOperationOutcome
public org.hl7.fhir.instance.model.api.IBaseOperationOutcome createInfoOperationOutcome(String theMessage) -
createInfoOperationOutcome
public org.hl7.fhir.instance.model.api.IBaseOperationOutcome createInfoOperationOutcome(String theMessage, @Nullable ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) -
createOperationOutcome
protected org.hl7.fhir.instance.model.api.IBaseOperationOutcome createOperationOutcome(String theSeverity, String theMessage, String theCode, @Nullable ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) -
createMethodOutcomeForResourceId
protected DaoMethodOutcome createMethodOutcomeForResourceId(String theResourceId, String theMessageKey, ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) Creates a base method outcome for a delete request for the provided ID.Additional information may be set on the outcome.
- Parameters:
theResourceId
- - the id of the object being deleted. Eg: Patient/123
-
createResourceGoneException
@Nonnull protected ca.uhn.fhir.rest.server.exceptions.ResourceGoneException createResourceGoneException(IBasePersistedResource theResourceEntity) -
getStorageSettings
Provide the JpaStorageSettings -
getResourceName
Returns the resource type for this DAO, or null if this is a system-level DAO -
getContext
Provides the FHIR context -
translateRawParameters
@Transactional(propagation=SUPPORTS) public void translateRawParameters(Map<String, List<String>> theSource, SearchParameterMap theTarget) -
populateOperationOutcomeForUpdate
protected void populateOperationOutcomeForUpdate(@Nullable ca.uhn.fhir.util.StopWatch theItemStopwatch, DaoMethodOutcome theMethodOutcome, String theMatchUrl, ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType) -
extractReferencesToAutoVersion
@Nonnull public static Set<org.hl7.fhir.instance.model.api.IBaseReference> extractReferencesToAutoVersion(ca.uhn.fhir.context.FhirContext theFhirContext, StorageSettings theStorageSettings, org.hl7.fhir.instance.model.api.IBaseResource theResource) Extracts a list of references that should be auto-versioned.- Returns:
- A set of references that should be versioned according to both storage settings and auto-version reference extensions, or it may also be empty.
-
clearRequestAsProcessingSubRequest
public static void clearRequestAsProcessingSubRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) -
markRequestAsProcessingSubRequest
public static void markRequestAsProcessingSubRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails)
-
preProcessResourceForStorage(IBaseResource, RequestDetails, TransactionDetails, boolean)
instead