Add callback for resource deletion
@@ -1482,6 +1482,15 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao,
// nothing
}
+ /**
+ * Subclasses may override to provide behaviour. Called when a pre-existing resource has been updated in the database
+ *
+ * @param theEntity The resource
+ */
+ protected void postDelete(ResourceTable theEntity) {
+ // nothing
+ }
+
/**
* Subclasses may override to provide behaviour. Called when a pre-existing resource has been updated in the database
*
@@ -2027,6 +2036,10 @@ public abstract class BaseHapiFhirDao<T extends IBaseResource> implements IDao,
postPersist(theEntity, (T) theResource);
+ } else if (theEntity.getDeleted() != null) {
+
+ postDelete(theEntity);
+
} else {
theEntity = myEntityManager.merge(theEntity);
