Class OverridePathBasedReferentialIntegrityForDeletesInterceptor

java.lang.Object
ca.uhn.fhir.jpa.interceptor.OverridePathBasedReferentialIntegrityForDeletesInterceptor

This JPA interceptor can be configured with a collection of FHIRPath expressions, and will disable referential integrity for target resources at those paths.

For example, suppose this interceptor is configured with a path of AuditEvent.entity.what, and an AuditEvent resource exists in the repository that has a reference in that path to resource Patient/123. Normally this reference would prevent the Patient resource from being deleted unless the AuditEvent was first deleted as well (or a cascading delete was used). With this interceptor in place, the Patient resource could be deleted, and the AuditEvent would remain intact.

  • Constructor Details

  • Method Details

    • addPath

      public void addPath(String thePath)
      Adds a FHIRPath expression indicating a resource path that should be ignored when considering referential integrity for deletes.
      Parameters:
      thePath - The FHIRPath expression, e.g. AuditEvent.agent.who
    • clearPaths

      public void clearPaths()
      Remove all paths registered to this interceptor
    • getPaths

      public Set<String> getPaths()
      Returns the paths that will be considered by this interceptor
      See Also:
    • handleDeleteConflicts

      public void handleDeleteConflicts(DeleteConflictList theDeleteConflictList, ca.uhn.fhir.rest.api.server.RequestDetails requestDetails)
      Interceptor hook method. Do not invoke directly.