Class OverridePathBasedReferentialIntegrityForDeletesInterceptor

  • public class OverridePathBasedReferentialIntegrityForDeletesInterceptor
    extends Object
    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.

    • Method Detail

      • addPath

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

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

        public void handleDeleteConflicts​(ca.uhn.fhir.jpa.api.model.DeleteConflictList theDeleteConflictList)
        Interceptor hook method. Do not invoke directly.