diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml index 0331ee9c487f..4c86813da8e3 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/changes.yaml @@ -5,4 +5,40 @@ (dependent HAPI modules listed in brackets): " diff --git a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/upgrade.md b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/upgrade.md index e69de29bb2d1..d4b0609fbdd4 100644 --- a/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/upgrade.md +++ b/hapi-fhir-docs/src/main/resources/ca/uhn/hapi/fhir/changelog/7_8_0/upgrade.md @@ -0,0 +1,3 @@ +## Entities annotations + +The `@Embedded` Annotation is no longer allowed, in presences of the `@Entity` one. diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IBatch2WorkChunkRepository.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IBatch2WorkChunkRepository.java index e9611614e45b..2b6462072957 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IBatch2WorkChunkRepository.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/data/IBatch2WorkChunkRepository.java @@ -150,6 +150,6 @@ List fetchAllChunkIdsForStepWithStatus( @Param("status") WorkChunkStatusEnum theStatus); @Query( - "SELECT new ca.uhn.fhir.batch2.model.BatchWorkChunkStatusDTO(e.myTargetStepId, e.myStatus, min(e.myStartTime), max(e.myEndTime), avg(e.myEndTime - e.myStartTime), count(*)) FROM Batch2WorkChunkEntity e WHERE e.myInstanceId=:instanceId GROUP BY e.myTargetStepId, e.myStatus") + "SELECT new ca.uhn.fhir.batch2.model.BatchWorkChunkStatusDTO(e.myTargetStepId, e.myStatus, min(e.myStartTime), max(e.myEndTime), avg(cast((e.myEndTime - e.myStartTime) as long)), count(*)) FROM Batch2WorkChunkEntity e WHERE e.myInstanceId=:instanceId GROUP BY e.myTargetStepId, e.myStatus") List fetchWorkChunkStatusForInstance(@Param("instanceId") String theInstanceId); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java index 3576e9b79084..0aee74c44116 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/search/PathContext.java @@ -20,9 +20,11 @@ package ca.uhn.fhir.jpa.dao.search; import jakarta.annotation.Nonnull; +import org.hibernate.search.engine.search.common.NamedValues; import org.hibernate.search.engine.search.predicate.SearchPredicate; import org.hibernate.search.engine.search.predicate.dsl.BooleanPredicateClausesStep; import org.hibernate.search.engine.search.predicate.dsl.ExistsPredicateFieldStep; +import org.hibernate.search.engine.search.predicate.dsl.KnnPredicateFieldStep; import org.hibernate.search.engine.search.predicate.dsl.MatchAllPredicateOptionsStep; import org.hibernate.search.engine.search.predicate.dsl.MatchIdPredicateMatchingStep; import org.hibernate.search.engine.search.predicate.dsl.MatchNonePredicateFinalStep; @@ -34,6 +36,8 @@ import org.hibernate.search.engine.search.predicate.dsl.NotPredicateFinalStep; import org.hibernate.search.engine.search.predicate.dsl.PhrasePredicateFieldStep; import org.hibernate.search.engine.search.predicate.dsl.PredicateFinalStep; +import org.hibernate.search.engine.search.predicate.dsl.PrefixPredicateFieldStep; +import org.hibernate.search.engine.search.predicate.dsl.QueryStringPredicateFieldStep; import org.hibernate.search.engine.search.predicate.dsl.RangePredicateFieldStep; import org.hibernate.search.engine.search.predicate.dsl.RegexpPredicateFieldStep; import org.hibernate.search.engine.search.predicate.dsl.SearchPredicateFactory; @@ -221,6 +225,11 @@ public WildcardPredicateFieldStep wildcard() { return myPredicateFactory.wildcard(); } + @Override + public PrefixPredicateFieldStep prefix() { + return myPredicateFactory.prefix(); + } + @Override public RegexpPredicateFieldStep regexp() { return myPredicateFactory.regexp(); @@ -246,6 +255,11 @@ public SimpleQueryStringPredicateFieldStep simpleQueryString() { return myPredicateFactory.simpleQueryString(); } + @Override + public QueryStringPredicateFieldStep queryString() { + return myPredicateFactory.queryString(); + } + @Override public ExistsPredicateFieldStep exists() { return myPredicateFactory.exists(); @@ -262,6 +276,16 @@ public NamedPredicateOptionsStep named(String path) { return myPredicateFactory.named(path); } + @Override + public KnnPredicateFieldStep knn(int i) { + return myPredicateFactory.knn(i); + } + + @Override + public PredicateFinalStep withParameters(Function function) { + return myPredicateFactory.withParameters(function); + } + @Override public T extension(SearchPredicateFactoryExtension extension) { return myPredicateFactory.extension(extension); diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java index 1d08ddbc41da..cb34cc222ff5 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/graphql/GraphQLProviderWithIntrospection.java @@ -33,6 +33,8 @@ import ca.uhn.fhir.util.VersionUtil; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonSerializer; import graphql.ExecutionResult; import graphql.GraphQL; import graphql.language.InterfaceTypeDefinition; @@ -80,6 +82,7 @@ public class GraphQLProviderWithIntrospection extends GraphQLProvider { private final ISearchParamRegistry mySearchParamRegistry; private final VersionSpecificWorkerContextWrapper myContext; private final IDaoRegistry myDaoRegistry; + private final Gson myGson; /** * Constructor @@ -97,6 +100,11 @@ public GraphQLProviderWithIntrospection( myContext = VersionSpecificWorkerContextWrapper.newVersionSpecificWorkerContextWrapper(theValidationSupport); myGenerator = new GraphQLSchemaGenerator(myContext, VersionUtil.getVersion()); + + GsonBuilder gsonBuilder = new GsonBuilder(); + gsonBuilder.registerTypeAdapter(Collections.emptyList().getClass(), (JsonSerializer) + (src, typeOfSrc, context) -> new JsonArray()); + myGson = gsonBuilder.create(); } @Override @@ -250,8 +258,7 @@ private String generateSchema( ExecutionResult executionResult = build.execute(theQueryBody); Map data = executionResult.toSpecification(); - Gson gson = new GsonBuilder().create(); - return gson.toJson(data); + return myGson.toJson(data); } @Nonnull diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTag.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTag.java index c78e68a4a902..25ac724a1a68 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTag.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTag.java @@ -20,7 +20,6 @@ package ca.uhn.fhir.jpa.model.entity; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.ForeignKey; import jakarta.persistence.GeneratedValue; @@ -35,7 +34,6 @@ import java.io.Serializable; -@Embeddable @Entity @Table( name = "HFJ_HISTORY_TAG", diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamCoords.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamCoords.java index 647490860ab3..a0c210d1bef3 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamCoords.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamCoords.java @@ -24,7 +24,6 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import jakarta.annotation.Nullable; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -42,7 +41,6 @@ import org.apache.commons.lang3.builder.ToStringStyle; import org.hibernate.annotations.GenericGenerator; -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamDate.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamDate.java index 3a98bc66dfe1..ed6de776b5f1 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamDate.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamDate.java @@ -28,7 +28,6 @@ import ca.uhn.fhir.rest.param.DateRangeParam; import ca.uhn.fhir.util.DateUtils; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -56,7 +55,6 @@ import java.text.SimpleDateFormat; import java.util.Date; -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamNumber.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamNumber.java index 393ab64d60e6..8a6a8417d0b6 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamNumber.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamNumber.java @@ -24,7 +24,6 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.param.NumberParam; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -48,7 +47,6 @@ import java.math.BigDecimal; import java.util.Objects; -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantity.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantity.java index 02129a996004..4ec11e41f3c0 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantity.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantity.java @@ -24,7 +24,6 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.param.QuantityParam; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -50,7 +49,6 @@ import static org.apache.commons.lang3.StringUtils.isBlank; // @formatter:off -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantityNormalized.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantityNormalized.java index 86ec8a7d9bd5..8666cff81719 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantityNormalized.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamQuantityNormalized.java @@ -25,7 +25,6 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.param.QuantityParam; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -52,7 +51,6 @@ import static org.apache.commons.lang3.StringUtils.isBlank; // @formatter:off -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamString.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamString.java index 5d5466291c65..c1e5240bf8b7 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamString.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamString.java @@ -27,7 +27,6 @@ import ca.uhn.fhir.rest.param.StringParam; import ca.uhn.fhir.util.StringUtil; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.ForeignKey; @@ -48,7 +47,6 @@ import static org.apache.commons.lang3.StringUtils.defaultString; // @formatter:off -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamToken.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamToken.java index 50cd671dcb44..3f93d6969742 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamToken.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamToken.java @@ -26,7 +26,6 @@ import ca.uhn.fhir.rest.api.Constants; import ca.uhn.fhir.rest.param.TokenParam; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -52,7 +51,6 @@ import static org.apache.commons.lang3.StringUtils.defaultString; import static org.apache.commons.lang3.StringUtils.trim; -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamUri.java b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamUri.java index 0db8b2ad2b39..95329046bc84 100644 --- a/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamUri.java +++ b/hapi-fhir-jpaserver-model/src/main/java/ca/uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamUri.java @@ -25,7 +25,6 @@ import ca.uhn.fhir.model.api.IQueryParameterType; import ca.uhn.fhir.rest.param.UriParam; import jakarta.persistence.Column; -import jakarta.persistence.Embeddable; import jakarta.persistence.Entity; import jakarta.persistence.EntityListeners; import jakarta.persistence.FetchType; @@ -47,7 +46,6 @@ import static ca.uhn.fhir.jpa.model.util.SearchParamHash.hashSearchParam; import static org.apache.commons.lang3.StringUtils.defaultString; -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table( diff --git a/hapi-fhir-sql-migrate/pom.xml b/hapi-fhir-sql-migrate/pom.xml index 01295205e79b..fd8e441f1f5a 100644 --- a/hapi-fhir-sql-migrate/pom.xml +++ b/hapi-fhir-sql-migrate/pom.xml @@ -54,13 +54,13 @@ org.apache.derby derby test - 10.16.1.1 + 10.17.1.0 org.apache.derby derbytools test - 10.16.1.1 + 10.17.1.0 org.postgresql @@ -80,13 +80,6 @@ logback-classic test - - - ca.uhn.hapi.fhir - hapi-fhir-test-utilities - ${project.version} - test - org.testcontainers junit-jupiter @@ -131,7 +124,6 @@ - ca.uhn.hapi.fhir hapi-fhir-test-utilities diff --git a/pom.xml b/pom.xml index cc6e28944003..830826f7a783 100644 --- a/pom.xml +++ b/pom.xml @@ -957,6 +957,11 @@ Ibrahim Trifork A/S + + madduci + Michele Adduci + gematik GmbH + @@ -1013,53 +1018,54 @@ 4.0.4 4.9.0 3.0.3 - 12.0.9 + 12.0.15 3.0.2 5.10.1 0.64.8 - 9.4.0 - 6.4.1.Final - 1.4.14 + 10.20.1 + 6.6.2.Final + 1.5.12 - 7.0.0.Final + 7.2.1.Final - 9.8.0 + 9.12.0 2.2 8.0.0.Final - 4.4.13 - 4.5.13 - 2.17.1 - 2.17.1 + 4.4.16 + 4.5.14 + 2.18.1 + 2.18.1 3.3.0 1.8 4.12.0 - 2.8.0 + 2.9.0 4.1.2 1.4 - 6.2.9.Final + 6.2.10.Final 7.1.2 9.5.4 2.13.0 0.9.11 9.8.0-15 1.2_5 - 2.2.22 - 2.0.13 - 2.19.0 - 6.1.8 - 2023.1.6 + 2.2.25 + 2.0.16 + 2.24.1 + 6.1.14 + 2024.0.5 4.3.10 - 3.2.6 - 2.0.6 + 3.3.5 + 2.0.10 2.9.0 + 3.6.1.Final 3.1.4 - 1.19.3 + 1.20.3 3.1.2.RELEASE 4.4.1 UTF-8 1.0.1 - 1.44.0 - 8.14.3 + 1.52.0 + 8.15.3 1.0.8 @@ -1114,6 +1120,11 @@ logback-core ${logback_version} + + org.jboss.logging + jboss-logging + ${jboss_logging_version} + com.atlassian.commonmark commonmark @@ -1167,18 +1178,18 @@ com.googlecode.owasp-java-html-sanitizer owasp-java-html-sanitizer - 20211018.2 + 20240325.1 com.graphql-java graphql-java - 21.5 + 22.3 org.simplejavamail simple-java-mail - 8.11.2 + 8.12.2 com.github.bbottema @@ -1277,14 +1288,14 @@ com.squareup.okio okio-jvm - 3.4.0 + 3.9.1 com.tngtech.archunit archunit-junit5 - 1.0.1 + 1.3.0 test @@ -1310,7 +1321,7 @@ commons-cli commons-cli - 1.5.0 + 1.9.0 commons-codec @@ -1355,7 +1366,7 @@ org.jetbrains annotations - 23.0.0 + 26.0.1 commons-io @@ -1486,12 +1497,12 @@ com.mysql mysql-connector-j - 8.2.0 + 9.1.0 org.springdoc springdoc-openapi-starter-webmvc-ui - 2.2.0 + 2.6.0 net.sf.json-lib @@ -2023,12 +2034,12 @@ org.postgresql postgresql - 42.7.3 + 42.7.4 com.oracle.database.jdbc ojdbc11 - 23.3.0.23.09 + 23.6.0.24.10 org.quartz-scheduler @@ -2167,17 +2178,17 @@ org.webjars.npm ace-builds - 1.22.0 + 1.36.3 org.webjars.npm bootstrap - 4.5.2 + 4.6.2 org.webjars Eonasdan-bootstrap-datetimepicker - 4.17.47 + 4.17.49 * @@ -2188,7 +2199,7 @@ org.webjars font-awesome - 5.8.2 + 5.15.4 org.webjars.bower @@ -2229,12 +2240,12 @@ org.webjars swagger-ui - 4.1.3 + 4.19.1 org.xmlunit xmlunit-core - 2.4.0 + 2.10.0 org.testcontainers