Start branch for 4.0.0 release
This commit is contained in:
@@ -25,6 +25,7 @@ public class HapiProperties {
|
||||
static final String DEFAULT_PRETTY_PRINT = "default_pretty_print";
|
||||
static final String ETAG_SUPPORT = "etag_support";
|
||||
static final String FHIR_VERSION = "fhir_version";
|
||||
static final String ALLOW_CASCADING_DELETES = "allow_cascading_deletes";
|
||||
static final String HAPI_PROPERTIES = "hapi.properties";
|
||||
static final String LOGGER_ERROR_FORMAT = "logger.error_format";
|
||||
static final String LOGGER_FORMAT = "logger.format";
|
||||
@@ -239,6 +240,10 @@ public class HapiProperties {
|
||||
return HapiProperties.getBooleanProperty(ALLOW_MULTIPLE_DELETE, false);
|
||||
}
|
||||
|
||||
public static Boolean getAllowCascadingDeletes() {
|
||||
return HapiProperties.getBooleanProperty(ALLOW_CASCADING_DELETES, false);
|
||||
}
|
||||
|
||||
public static Boolean getAllowExternalReferences() {
|
||||
return HapiProperties.getBooleanProperty(ALLOW_EXTERNAL_REFERENCES, false);
|
||||
}
|
||||
|
||||
@@ -2,9 +2,12 @@ package ca.uhn.fhir.jpa.starter;
|
||||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.context.FhirVersionEnum;
|
||||
import ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster;
|
||||
import ca.uhn.fhir.interceptor.api.IInterceptorService;
|
||||
import ca.uhn.fhir.jpa.dao.DaoConfig;
|
||||
import ca.uhn.fhir.jpa.dao.DaoRegistry;
|
||||
import ca.uhn.fhir.jpa.dao.IFhirSystemDao;
|
||||
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
||||
import ca.uhn.fhir.jpa.provider.JpaConformanceProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.JpaSystemProviderDstu2;
|
||||
import ca.uhn.fhir.jpa.provider.SubscriptionTriggeringProvider;
|
||||
@@ -218,6 +221,14 @@ public class JpaRestfulServer extends RestfulServer {
|
||||
interceptorService.registerInterceptor(new SubscriptionDebugLogInterceptor());
|
||||
}
|
||||
|
||||
// Cascading deletes
|
||||
DaoRegistry daoRegistry = appCtx.getBean(DaoRegistry.class);
|
||||
IInterceptorBroadcaster interceptorBroadcaster = appCtx.getBean(IInterceptorBroadcaster.class);
|
||||
if (HapiProperties.getAllowCascadingDeletes()) {
|
||||
CascadingDeleteInterceptor cascadingDeleteInterceptor = new CascadingDeleteInterceptor(daoRegistry, interceptorBroadcaster);
|
||||
getInterceptorService().registerInterceptor(cascadingDeleteInterceptor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user