File tree Expand file tree Collapse file tree 5 files changed +16
-2
lines changed
hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_0_0
hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao
hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/util
hapi-fhir-server/src/main/java/ca/uhn/fhir/rest/server Expand file tree Collapse file tree 5 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ type : fix
3+ issue : 5617
4+ title : " Resource UserData RESOURCE_PARTITION_ID was incorrectly being set to null for the default partition.
5+ This has been corrected to use RequestPartitionId.defaultPartition()"
Original file line number Diff line number Diff line change 2323import ca .uhn .fhir .context .FhirVersionEnum ;
2424import ca .uhn .fhir .context .RuntimeResourceDefinition ;
2525import ca .uhn .fhir .i18n .Msg ;
26+ import ca .uhn .fhir .interceptor .model .RequestPartitionId ;
2627import ca .uhn .fhir .jpa .api .config .JpaStorageSettings ;
2728import ca .uhn .fhir .jpa .api .dao .IDao ;
2829import ca .uhn .fhir .jpa .dao .data .IResourceHistoryTableDao ;
@@ -248,7 +249,7 @@ private <R extends IBaseResource> void populateResourcePartitionInformation(
248249 myPartitionLookupSvc .getPartitionById (partitionId .getPartitionId ());
249250 retVal .setUserData (Constants .RESOURCE_PARTITION_ID , persistedPartition .toRequestPartitionId ());
250251 } else {
251- retVal .setUserData (Constants .RESOURCE_PARTITION_ID , null );
252+ retVal .setUserData (Constants .RESOURCE_PARTITION_ID , RequestPartitionId . defaultPartition () );
252253 }
253254 }
254255 }
Original file line number Diff line number Diff line change @@ -263,7 +263,7 @@ public class JpaConstants {
263263 /**
264264 * The name of the default partition
265265 */
266- public static final String DEFAULT_PARTITION_NAME = "DEFAULT" ;
266+ public static final String DEFAULT_PARTITION_NAME = ProviderConstants . DEFAULT_PARTITION_NAME ;
267267
268268 /**
269269 * The name of the collection of all partitions
Original file line number Diff line number Diff line change 2525import ca .uhn .fhir .rest .api .Constants ;
2626import ca .uhn .fhir .rest .api .RestOperationTypeEnum ;
2727import ca .uhn .fhir .rest .api .server .RequestDetails ;
28+ import ca .uhn .fhir .rest .server .provider .ProviderConstants ;
2829import com .google .common .collect .Lists ;
2930import jakarta .annotation .Nonnull ;
3031import org .apache .commons .lang3 .Validate ;
@@ -234,6 +235,11 @@ private boolean matchesResource(IBaseResource theResource) {
234235 RequestPartitionId partitionId =
235236 (RequestPartitionId ) theResource .getUserData (Constants .RESOURCE_PARTITION_ID );
236237 if (partitionId != null ) {
238+ if (partitionId .hasDefaultPartitionId ()
239+ && myTenantIds .contains (ProviderConstants .DEFAULT_PARTITION_NAME )) {
240+ return myOutcome ;
241+ }
242+
237243 String partitionNameOrNull = partitionId .getFirstPartitionNameOrNull ();
238244 if (partitionNameOrNull == null || !myTenantIds .contains (partitionNameOrNull )) {
239245 return !myOutcome ;
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ public class ProviderConstants {
5252 public static final String PARTITION_MANAGEMENT_PARTITION_NAME = "name" ;
5353 public static final String PARTITION_MANAGEMENT_PARTITION_DESC = "description" ;
5454
55+ public static final String DEFAULT_PARTITION_NAME = "DEFAULT" ;
56+
5557 /**
5658 * Operation name: diff
5759 */
You can’t perform that action at this time.
0 commit comments