issue 186: minor fixes in partitioning config
This commit is contained in:
@@ -8,9 +8,9 @@ import ca.uhn.fhir.rest.api.EncodingEnum;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.hl7.fhir.r4.model.Bundle;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -30,7 +30,7 @@ public class AppProperties {
|
||||
private Boolean allow_multiple_delete = false;
|
||||
private Boolean allow_override_default_search_params = true;
|
||||
private Boolean allow_placeholder_references = true;
|
||||
private Boolean auto_create_placeholder_reference_targets = true;
|
||||
private Boolean auto_create_placeholder_reference_targets = false;
|
||||
private Boolean enable_index_missing_fields = false;
|
||||
private Boolean enforce_referential_integrity_on_delete = true;
|
||||
private Boolean enforce_referential_integrity_on_write = true;
|
||||
@@ -365,7 +365,11 @@ public class AppProperties {
|
||||
}
|
||||
|
||||
public void setReuse_cached_search_results_millis(Long reuse_cached_search_results_millis) {
|
||||
this.reuse_cached_search_results_millis = reuse_cached_search_results_millis;
|
||||
if (Objects.equals(reuse_cached_search_results_millis, 0L)) {
|
||||
this.reuse_cached_search_results_millis = null;
|
||||
} else {
|
||||
this.reuse_cached_search_results_millis = reuse_cached_search_results_millis;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Tester> getTester() {
|
||||
@@ -554,7 +558,7 @@ public class AppProperties {
|
||||
public static class Partitioning {
|
||||
|
||||
private Boolean partitioning_include_in_search_hashes = false;
|
||||
|
||||
private Boolean allow_references_across_partitions = false;
|
||||
|
||||
public Boolean getPartitioning_include_in_search_hashes() {
|
||||
return partitioning_include_in_search_hashes;
|
||||
@@ -563,6 +567,13 @@ public class AppProperties {
|
||||
public void setPartitioning_include_in_search_hashes(Boolean partitioning_include_in_search_hashes) {
|
||||
this.partitioning_include_in_search_hashes = partitioning_include_in_search_hashes;
|
||||
}
|
||||
public Boolean getAllow_references_across_partitions() {
|
||||
return allow_references_across_partitions;
|
||||
}
|
||||
|
||||
public void setAllow_references_across_partitions(Boolean allow_references_across_partitions) {
|
||||
this.allow_references_across_partitions = allow_references_across_partitions;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Subscription {
|
||||
|
||||
@@ -5,6 +5,7 @@ import ca.uhn.fhir.jpa.binstore.DatabaseBlobBinaryStorageSvcImpl;
|
||||
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
|
||||
import ca.uhn.fhir.jpa.config.HibernateDialectProvider;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||
@@ -77,7 +78,6 @@ public class FhirServerConfigCommon {
|
||||
retVal.setAllowMultipleDelete(appProperties.getAllow_multiple_delete());
|
||||
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
|
||||
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
|
||||
retVal.setAutoCreatePlaceholderReferenceTargets(appProperties.getAllow_placeholder_references());
|
||||
if(appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
|
||||
retVal.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
|
||||
|
||||
@@ -126,6 +126,12 @@ public class FhirServerConfigCommon {
|
||||
// Partitioning
|
||||
if (appProperties.getPartitioning() != null) {
|
||||
retVal.setPartitioningEnabled(true);
|
||||
retVal.setIncludePartitionInSearchHashes(appProperties.getPartitioning().getPartitioning_include_in_search_hashes());
|
||||
if(appProperties.getPartitioning().getAllow_references_across_partitions()) {
|
||||
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.ALLOWED_UNQUALIFIED);
|
||||
} else {
|
||||
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.NOT_ALLOWED);
|
||||
}
|
||||
}
|
||||
|
||||
return retVal;
|
||||
|
||||
Reference in New Issue
Block a user