
Package ca.uhn.fhir.jpa.dao
Class BaseStorageDao
java.lang.Object
ca.uhn.fhir.jpa.dao.BaseStorageDao
- Direct Known Subclasses:
BaseStorageResourceDao
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected DaoRegistryprotected ca.uhn.fhir.context.FhirContextprotected IMetaTagSorterprotected IResourceVersionSvcprotected ca.uhn.fhir.rest.server.util.ISearchParamRegistryprotected JpaStorageSettingsstatic final Stringstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.moved toOperationOutcomeUtil.OO_SEVERITY_INFOstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.moved toOperationOutcomeUtil.OO_SEVERITY_WARN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringaddIssueToOperationOutcomeForAutoCreatedPlaceholder(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IIdType thePlaceholderId, org.hl7.fhir.instance.model.api.IBaseOperationOutcome theOperationOutcomeToPopulate) static voidclearRequestAsProcessingSubRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) org.hl7.fhir.instance.model.api.IBaseOperationOutcomecreateErrorOperationOutcome(String theMessage, String theCode) org.hl7.fhir.instance.model.api.IBaseOperationOutcomecreateInfoOperationOutcome(String theMessage) org.hl7.fhir.instance.model.api.IBaseOperationOutcomecreateInfoOperationOutcome(String theMessage, ca.uhn.fhir.model.api.StorageResponseCodeEnum theStorageResponseCode) protected DaoMethodOutcomecreateMethodOutcomeForResourceId(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 ca.uhn.fhir.rest.server.exceptions.ResourceGoneExceptioncreateResourceGoneException(IBasePersistedResource theResourceEntity) org.hl7.fhir.instance.model.api.IBaseOperationOutcomecreateWarnOperationOutcome(String theMsg, String theCode, ca.uhn.fhir.model.api.StorageResponseCodeEnum theResponseCodeEnum) protected voiddoCallHooks(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.static Set<org.hl7.fhir.instance.model.api.IBaseReference> extractReferencesToAvoidReplacement(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theResource) Extracts a list of references that have versions in their ID whose versions should not be strippedprotected abstract ca.uhn.fhir.context.FhirContextProvides the FHIR contextprotected abstract ca.uhn.fhir.interceptor.api.IInterceptorBroadcasterprotected abstract StringReturns the resource type for this DAO, or null if this is a system-level DAOprotected abstract JpaStorageSettingsProvide the JpaStorageSettingsstatic voidmarkRequestAsProcessingSubRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) protected voidpopulateOperationOutcomeForUpdate(ca.uhn.fhir.util.StopWatch theItemStopwatch, DaoMethodOutcome theMethodOutcome, String theMatchUrl, ca.uhn.fhir.rest.api.RestOperationTypeEnum theOperationType, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) protected voidpreProcessResourceForStorage(org.hl7.fhir.instance.model.api.IBaseResource theResource) Deprecated.protected voidpreProcessResourceForStorage(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 storagevoidsetMyMetaTagSorter(IMetaTagSorter theMetaTagSorter) voidsetSearchParamRegistry(ca.uhn.fhir.rest.server.util.ISearchParamRegistry theSearchParamRegistry) protected DaoMethodOutcometoMethodOutcome(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 DaoMethodOutcometoMethodOutcomeLazy(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) voidtranslateRawParameters(Map<String, List<String>> theSource, SearchParameterMap theTarget) protected voidverifyResourceIdIsValid(org.hl7.fhir.instance.model.api.IBaseResource theResource) Verify that the resource ID is actually valid according to FHIR's rules
-
Field Details
-
OO_SEVERITY_ERROR
Deprecated, for removal: This API element is subject to removal in a future version.moved toOperationOutcomeUtil.OO_SEVERITY_ERROR- See Also:
-
OO_SEVERITY_INFO
Deprecated, for removal: This API element is subject to removal in a future version.moved toOperationOutcomeUtil.OO_SEVERITY_INFO- See Also:
-
OO_SEVERITY_WARN
Deprecated, for removal: This API element is subject to removal in a future version.moved toOperationOutcomeUtil.OO_SEVERITY_WARN- See Also:
-
MESSAGE_KEY_DELETE_RESOURCE_NOT_EXISTING
- See Also:
-
MESSAGE_KEY_DELETE_RESOURCE_ALREADY_DELETED
- See Also:
-
OO_ISSUE_CODE_INFORMATIONAL
- 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
-
verifyResourceIdIsValid
Verify that the resource ID is actually valid according to FHIR's rules -
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) -
createWarnOperationOutcome
@Nonnull public org.hl7.fhir.instance.model.api.IBaseOperationOutcome createWarnOperationOutcome(String theMsg, String theCode, ca.uhn.fhir.model.api.StorageResponseCodeEnum theResponseCodeEnum) -
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, ca.uhn.fhir.rest.api.server.storage.TransactionDetails theTransactionDetails) -
addIssueToOperationOutcomeForAutoCreatedPlaceholder
public static String addIssueToOperationOutcomeForAutoCreatedPlaceholder(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IIdType thePlaceholderId, org.hl7.fhir.instance.model.api.IBaseOperationOutcome theOperationOutcomeToPopulate) -
extractReferencesToAvoidReplacement
public static Set<org.hl7.fhir.instance.model.api.IBaseReference> extractReferencesToAvoidReplacement(ca.uhn.fhir.context.FhirContext theFhirContext, org.hl7.fhir.instance.model.api.IBaseResource theResource) Extracts a list of references that have versions in their ID whose versions should not be stripped- Returns:
- A set of references that should not have their client-given versions stripped according to the versioned references settings.
-
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)
-
OperationOutcomeUtil.OO_SEVERITY_ERROR