diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_2_0/4128-preserve-tags-on-delete.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_2_0/4128-preserve-tags-on-delete.yaml new file mode 100644 index 00000000000..741b9dadad3 --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_2_0/4128-preserve-tags-on-delete.yaml @@ -0,0 +1,7 @@ +--- +type: fix +issue: 4128 +title: "In the JPA server, when deleting a resource the associated tags were previously deleted even though + the FHIR specification states that tags are independent of FHIR versioning. After this fix, resource tags + and security labels will remain when a resource is deleted. They can be fetched using the `$meta` operation + against the deleted resource, and will remain if the resource is brought back in a subsequent update." diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_2_0/4128-return-tag-state-after-update.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_2_0/4128-return-tag-state-after-update.yaml new file mode 100644 index 00000000000..a58f2b9948e --- /dev/null +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/6_2_0/4128-return-tag-state-after-update.yaml @@ -0,0 +1,6 @@ +--- +type: fix +issue: 4128 +title: "In the JPA server, when a resource is being updated, the response will now include any tags or + security labels which were not present in the request but were carried forward from the previous + version of the resource." diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java index 08b8719f70f..6b04277cc9c 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java @@ -1178,13 +1178,7 @@ public abstract class BaseHapiFhirDao extends BaseStora } // 5. fill MetaData - if (retVal instanceof IResource) { - IResource res = (IResource) retVal; - retVal = populateResourceMetadataHapi(resourceType, theEntity, tagList, theForHistoryOperation, res, version); - } else { - IAnyResource res = (IAnyResource) retVal; - retVal = populateResourceMetadataRi(resourceType, theEntity, tagList, theForHistoryOperation, res, version); - } + retVal = populateResourceMetadata(theEntity, theForHistoryOperation, tagList, version, resourceType, retVal); // 6. Handle source (provenance) if (isNotBlank(provenanceRequestId) || isNotBlank(provenanceSourceUri)) { @@ -1209,6 +1203,17 @@ public abstract class BaseHapiFhirDao extends BaseStora return retVal; } + protected R populateResourceMetadata(IBaseResourceEntity theEntity, boolean theForHistoryOperation, @Nullable Collection tagList, long theVersion, Class theResourceType, R theResource) { + if (theResource instanceof IResource) { + IResource res = (IResource) theResource; + theResource = populateResourceMetadataHapi(theResourceType, theEntity, tagList, theForHistoryOperation, res, theVersion); + } else { + IAnyResource res = (IAnyResource) theResource; + theResource = populateResourceMetadataRi(theResourceType, theEntity, tagList, theForHistoryOperation, res, theVersion); + } + return theResource; + } + public String toResourceName(Class theResourceType) { return myContext.getResourceType(theResourceType); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java index f0f0ac1420d..e10ba2de5ec 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirResourceDao.java @@ -1808,6 +1808,16 @@ public abstract class BaseHapiFhirResourceDao extends B * Otherwise, we're not in a transaction */ ResourceTable savedEntity = updateInternal(theRequest, resource, thePerformIndexing, theForceUpdateVersion, entity, resourceId, oldResource, theTransactionDetails); + + if (thePerformIndexing) { + Collection tagList = Collections.emptyList(); + if (entity.isHasTags()) { + tagList = entity.getTags(); + } + long version = entity.getVersion(); + populateResourceMetadata(entity, false, tagList, version, getResourceType(), resource); + } + DaoMethodOutcome outcome = toMethodOutcome(theRequest, savedEntity, resource).setCreated(wasDeleted); if (!thePerformIndexing) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java index 1fa5665e57c..6999ec2643a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/expunge/ResourceExpungeService.java @@ -311,10 +311,6 @@ public class ResourceExpungeService implements IResourceExpungeService { if (resource == null || resource.isHasLinks()) { myResourceLinkDao.deleteByResourceId(theResourceId.getIdAsLong()); } - - if (resource == null || resource.isHasTags()) { - myResourceTagDao.deleteByResourceId(theResourceId.getIdAsLong()); - } } private void expungeHistoricalVersionsOfId(RequestDetails theRequestDetails, Long myResourceId, AtomicInteger theRemainingCount) { diff --git a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/BaseJpaDstu2Test.java b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/BaseJpaDstu2Test.java index dae619ffd1a..e7b395c0b9e 100644 --- a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/BaseJpaDstu2Test.java +++ b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/BaseJpaDstu2Test.java @@ -10,6 +10,7 @@ import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao; import ca.uhn.fhir.jpa.api.svc.ISearchCoordinatorSvc; import ca.uhn.fhir.jpa.bulk.export.api.IBulkDataExportJobSchedulingHelper; import ca.uhn.fhir.jpa.dao.IFulltextSearchSvc; +import ca.uhn.fhir.jpa.dao.data.IResourceHistoryTableDao; import ca.uhn.fhir.jpa.dao.data.IResourceIndexedSearchParamStringDao; import ca.uhn.fhir.jpa.dao.data.IResourceIndexedSearchParamTokenDao; import ca.uhn.fhir.jpa.dao.data.IResourceLinkDao; diff --git a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java index 4354e713499..7bceb99264b 100644 --- a/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java +++ b/hapi-fhir-jpaserver-test-dstu2/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2Test.java @@ -1035,14 +1035,6 @@ public class FhirResourceDaoDstu2Test extends BaseJpaDstu2Test { myDaoConfig.setHistoryCountMode(HistoryCountModeEnum.COUNT_ACCURATE); String methodName = "testHistoryOverMultiplePages"; - /* - * for (int i = 0; i < 1000; i++) { - * Patient patient = new Patient(); - * patient.addName().addFamily(methodName + "__" + i); - * myPatientDao.create(patient).getId().toUnqualifiedVersionless(); - * } - */ - Patient patient = new Patient(); patient.addName().addFamily(methodName); IIdType id = myPatientDao.create(patient, mySrd).getId().toUnqualifiedVersionless(); diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java index 0869afa9b80..bc91cfefa42 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4QueryCountTest.java @@ -26,6 +26,7 @@ import ca.uhn.fhir.rest.server.interceptor.auth.AuthorizationInterceptor; import ca.uhn.fhir.rest.server.interceptor.auth.PolicyEnum; import ca.uhn.fhir.util.BundleBuilder; import org.apache.commons.lang3.StringUtils; +import org.hl7.fhir.instance.model.api.IBaseResource; import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.CareTeam; @@ -91,6 +92,7 @@ public class FhirResourceDaoR4QueryCountTest extends BaseResourceProviderR4Test myDaoConfig.setAutoCreatePlaceholderReferenceTargets(new DaoConfig().isAutoCreatePlaceholderReferenceTargets()); myDaoConfig.setPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets(new DaoConfig().isPopulateIdentifierInAutoCreatedPlaceholderReferenceTargets()); myDaoConfig.setResourceClientIdStrategy(new DaoConfig().getResourceClientIdStrategy()); + myDaoConfig.setTagStorageMode(new DaoConfig().getTagStorageMode()); BaseTermReadSvcImpl.setForceDisableHibernateSearchForUnitTest(false); } @@ -153,6 +155,40 @@ public class FhirResourceDaoR4QueryCountTest extends BaseResourceProviderR4Test } + @Test + public void testUpdateWithChangesAndTags() { + myDaoConfig.setTagStorageMode(DaoConfig.TagStorageModeEnum.NON_VERSIONED); + + IIdType id = runInTransaction(() -> { + Patient p = new Patient(); + p.getMeta().addTag("http://system", "foo", "display"); + p.addIdentifier().setSystem("urn:system").setValue("2"); + return myPatientDao.create(p).getId().toUnqualified(); + }); + + runInTransaction(()->{ + assertEquals(1, myResourceTagDao.count()); + }); + + myCaptureQueriesListener.clear(); + runInTransaction(() -> { + Patient p = new Patient(); + p.setId(id.getIdPart()); + p.addIdentifier().setSystem("urn:system").setValue("3"); + IBaseResource newRes = myPatientDao.update(p).getResource(); + assertEquals(1, newRes.getMeta().getTag().size()); + }); + myCaptureQueriesListener.logSelectQueriesForCurrentThread(); + assertEquals(4, myCaptureQueriesListener.getSelectQueriesForCurrentThread().size()); + myCaptureQueriesListener.logUpdateQueriesForCurrentThread(); + assertEquals(2, myCaptureQueriesListener.getUpdateQueriesForCurrentThread().size()); + myCaptureQueriesListener.logInsertQueriesForCurrentThread(); + assertEquals(1, myCaptureQueriesListener.getInsertQueriesForCurrentThread().size()); + myCaptureQueriesListener.logDeleteQueriesForCurrentThread(); + assertEquals(0, myCaptureQueriesListener.getDeleteQueriesForCurrentThread().size()); + } + + @Test public void testRead() { IIdType id = runInTransaction(() -> { diff --git a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java index 4c3bd92d10a..808b505fb90 100644 --- a/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java +++ b/hapi-fhir-jpaserver-test-r4/src/test/java/ca/uhn/fhir/jpa/dao/r4/FhirResourceDaoR4TagsTest.java @@ -6,9 +6,11 @@ import ca.uhn.fhir.jpa.provider.r4.BaseResourceProviderR4Test; import ca.uhn.fhir.jpa.searchparam.SearchParameterMap; import ca.uhn.fhir.rest.api.server.IBundleProvider; import ca.uhn.fhir.rest.gclient.TokenClientParam; +import org.hl7.fhir.instance.model.api.IIdType; import org.hl7.fhir.r4.model.Bundle; import org.hl7.fhir.r4.model.Enumerations; import org.hl7.fhir.r4.model.IdType; +import org.hl7.fhir.r4.model.Meta; import org.hl7.fhir.r4.model.Patient; import org.hl7.fhir.r4.model.SearchParameter; import org.junit.jupiter.api.AfterEach; @@ -36,6 +38,88 @@ public class FhirResourceDaoR4TagsTest extends BaseResourceProviderR4Test { } + /** + * Make sure tags are preserved + */ + @Test + public void testDeleteResourceWithTags_NonVersionedTags() { + initializeNonVersioned(); + + // Delete + + runInTransaction(() -> assertEquals(3, myResourceTagDao.count())); + IIdType outcomeId = myPatientDao.delete(new IdType("Patient/A"), mySrd).getId(); + assertEquals("3", outcomeId.getVersionIdPart()); + runInTransaction(() -> assertEquals(3, myResourceTagDao.count())); + + // Make sure $meta-get can fetch the tags of the deleted resource + + Meta meta = myPatientDao.metaGetOperation(Meta.class, new IdType("Patient/A"), mySrd); + assertThat(toProfiles(meta).toString(), toProfiles(meta), contains("http://profile2")); + assertThat(toTags(meta).toString(), toTags(meta), containsInAnyOrder("http://tag1|vtag1|dtag1", "http://tag2|vtag2|dtag2")); + assertEquals("3", meta.getVersionId()); + + // Revive and verify + + Patient patient = new Patient(); + patient.setId("A"); + patient.getMeta().addProfile("http://profile3"); + patient.setActive(true); + + myCaptureQueriesListener.clear(); + patient = (Patient) myPatientDao.update(patient, mySrd).getResource(); + assertThat(toProfiles(patient).toString(), toProfiles(patient), containsInAnyOrder("http://profile3")); + assertThat(toTags(patient).toString(), toTags(patient), containsInAnyOrder("http://tag1|vtag1|dtag1", "http://tag2|vtag2|dtag2")); + myCaptureQueriesListener.logAllQueries(); + runInTransaction(() -> assertEquals(3, myResourceTagDao.count())); + + // Read it back + + patient = myPatientDao.read(new IdType("Patient/A"), mySrd); + assertThat(toProfiles(patient).toString(), toProfiles(patient), containsInAnyOrder("http://profile3")); + assertThat(toTags(patient).toString(), toTags(patient), containsInAnyOrder("http://tag1|vtag1|dtag1", "http://tag2|vtag2|dtag2")); + + } + + /** + * Make sure tags are preserved + */ + @Test + public void testDeleteResourceWithTags_VersionedTags() { + initializeVersioned(); + + // Delete + + runInTransaction(() -> assertEquals(3, myResourceTagDao.count())); + myPatientDao.delete(new IdType("Patient/A"), mySrd); + runInTransaction(() -> assertEquals(3, myResourceTagDao.count())); + + // Make sure $meta-get can fetch the tags of the deleted resource + + Meta meta = myPatientDao.metaGetOperation(Meta.class, new IdType("Patient/A"), mySrd); + assertThat(toProfiles(meta).toString(), toProfiles(meta), contains("http://profile2")); + assertThat(toTags(meta).toString(), toTags(meta), containsInAnyOrder("http://tag1|vtag1|dtag1", "http://tag2|vtag2|dtag2")); + + // Revive and verify + + Patient patient = new Patient(); + patient.setId("A"); + patient.getMeta().addProfile("http://profile3"); + patient.setActive(true); + + myCaptureQueriesListener.clear(); + patient = (Patient) myPatientDao.update(patient, mySrd).getResource(); + myCaptureQueriesListener.logAllQueries(); + runInTransaction(() -> assertEquals(3, myResourceTagDao.count())); + + // Read it back + + patient = myPatientDao.read(new IdType("Patient/A"), mySrd); + assertThat(toProfiles(patient).toString(), toProfiles(patient), containsInAnyOrder("http://profile3")); + assertThat(toTags(patient).toString(), toTags(patient), containsInAnyOrder("http://tag1|vtag1|dtag1", "http://tag2|vtag2|dtag2")); + + } + @Test public void testStoreAndRetrieveNonVersionedTags_Read() { initializeNonVersioned(); @@ -163,7 +247,7 @@ public class FhirResourceDaoR4TagsTest extends BaseResourceProviderR4Test { patient.setActive(true); myPatientDao.update(patient, mySrd); - runInTransaction(()->{ + runInTransaction(() -> { assertEquals(0, myResourceTagDao.count()); assertEquals(0, myResourceHistoryTagDao.count()); assertEquals(0, myTagDefinitionDao.count()); @@ -184,7 +268,7 @@ public class FhirResourceDaoR4TagsTest extends BaseResourceProviderR4Test { patient.setActive(true); myPatientDao.update(patient, mySrd); - runInTransaction(()->{ + runInTransaction(() -> { assertEquals(0, myResourceTagDao.count()); assertEquals(0, myResourceHistoryTagDao.count()); assertEquals(0, myTagDefinitionDao.count()); @@ -350,17 +434,32 @@ public class FhirResourceDaoR4TagsTest extends BaseResourceProviderR4Test { @Nonnull private List toTags(Patient patient) { - return patient.getMeta().getTag().stream().map(t -> t.getSystem() + "|" + t.getCode() + "|" + t.getDisplay()).collect(Collectors.toList()); + return toTags(patient.getMeta()); } @Nonnull private List toSecurityLabels(Patient patient) { - return patient.getMeta().getSecurity().stream().map(t -> t.getSystem() + "|" + t.getCode() + "|" + t.getDisplay()).collect(Collectors.toList()); + return toSecurityLabels(patient.getMeta()); } @Nonnull private List toProfiles(Patient patient) { - return patient.getMeta().getProfile().stream().map(t -> t.getValue()).collect(Collectors.toList()); + return toProfiles(patient.getMeta()); + } + + @Nonnull + private static List toTags(Meta meta) { + return meta.getTag().stream().map(t -> t.getSystem() + "|" + t.getCode() + "|" + t.getDisplay()).collect(Collectors.toList()); + } + + @Nonnull + private static List toSecurityLabels(Meta meta) { + return meta.getSecurity().stream().map(t -> t.getSystem() + "|" + t.getCode() + "|" + t.getDisplay()).collect(Collectors.toList()); + } + + @Nonnull + private static List toProfiles(Meta meta) { + return meta.getProfile().stream().map(t -> t.getValue()).collect(Collectors.toList()); } @Nonnull diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationException.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationException.java index b436112e834..ad15ef14163 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationException.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationException.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + public class HapiMigrationException extends RuntimeException { private MigrationResult myResult; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationStorageSvc.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationStorageSvc.java index 917fe6b09ac..a8137c7e5f4 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationStorageSvc.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/HapiMigrationStorageSvc.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.migrate.dao.HapiMigrationDao; import ca.uhn.fhir.jpa.migrate.entity.HapiMigrationEntity; import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IHapiMigrationCallback.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IHapiMigrationCallback.java index 1b14c040d77..df3835d6a1a 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IHapiMigrationCallback.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/IHapiMigrationCallback.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; public interface IHapiMigrationCallback { diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationResult.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationResult.java index d2c29b815e1..b76a4d0a517 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationResult.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationResult.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; import java.util.ArrayList; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java index 1b436f128fa..995534ebb6b 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/MigrationTaskList.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; import org.flywaydb.core.api.MigrationVersion; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/HapiMigrationDao.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/HapiMigrationDao.java index 9512c1642db..201b90db4c9 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/HapiMigrationDao.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/HapiMigrationDao.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate.dao; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.i18n.Msg; import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.entity.HapiMigrationEntity; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/MigrationQueryBuilder.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/MigrationQueryBuilder.java index dcb9e52fe89..0e837d36352 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/MigrationQueryBuilder.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/dao/MigrationQueryBuilder.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate.dao; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.migrate.DriverTypeEnum; import ca.uhn.fhir.jpa.migrate.entity.HapiMigrationEntity; import ca.uhn.fhir.jpa.migrate.taskdef.ColumnTypeEnum; diff --git a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/entity/HapiMigrationEntity.java b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/entity/HapiMigrationEntity.java index 5fde280e02f..cb4df2d8ebd 100644 --- a/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/entity/HapiMigrationEntity.java +++ b/hapi-fhir-sql-migrate/src/main/java/ca/uhn/fhir/jpa/migrate/entity/HapiMigrationEntity.java @@ -1,5 +1,25 @@ package ca.uhn.fhir.jpa.migrate.entity; +/*- + * #%L + * HAPI FHIR Server - SQL Migration + * %% + * Copyright (C) 2014 - 2022 Smile CDR, Inc. + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ + import ca.uhn.fhir.jpa.migrate.taskdef.BaseTask; import org.springframework.jdbc.core.PreparedStatementSetter; import org.springframework.jdbc.core.RowMapper;