From 942edafe720fec010733eed15508851c387199c8 Mon Sep 17 00:00:00 2001 From: Ibrahim Tallouzi Date: Tue, 26 Nov 2024 12:52:57 +0100 Subject: [PATCH] Fix: Remove @Embeddable from classes already annotated with @Entity Removed @Embeddable annotations from classes that were also annotated with @Entity. This resolves conflicts introduced by Hibernate's stricter validation, which disallows a class from being both an entity (standalone table) and an embeddable (part of another entity). The change aligns with JPA specifications and ensures compatibility with recent Hibernate versions (e.g., stricter validation as per HHH-18172). --- .../java/ca/uhn/fhir/jpa/model/entity/ResourceHistoryTag.java | 1 - .../fhir/jpa/model/entity/ResourceIndexedSearchParamCoords.java | 1 - .../fhir/jpa/model/entity/ResourceIndexedSearchParamDate.java | 1 - .../fhir/jpa/model/entity/ResourceIndexedSearchParamNumber.java | 1 - .../jpa/model/entity/ResourceIndexedSearchParamQuantity.java | 1 - .../entity/ResourceIndexedSearchParamQuantityNormalized.java | 1 - .../fhir/jpa/model/entity/ResourceIndexedSearchParamString.java | 1 - .../fhir/jpa/model/entity/ResourceIndexedSearchParamToken.java | 1 - .../uhn/fhir/jpa/model/entity/ResourceIndexedSearchParamUri.java | 1 - 9 files changed, 9 deletions(-) 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 c78e68a4a90..4dfb3d1cda6 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 @@ -35,7 +35,6 @@ import org.hibernate.annotations.GenericGenerator; 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 647490860ab..0a6f1772264 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 @@ -42,7 +42,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder; 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 3a98bc66dfe..aff23ed870f 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 @@ -56,7 +56,6 @@ import java.text.ParseException; 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 393ab64d60e..d4a7cdf0a7c 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 @@ -48,7 +48,6 @@ import org.hibernate.type.SqlTypes; 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 02129a99600..9c21fe0f6f1 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 @@ -50,7 +50,6 @@ import static org.apache.commons.lang3.StringUtils.defaultString; 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 86ec8a7d9bd..6a008293d53 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 @@ -52,7 +52,6 @@ import static org.apache.commons.lang3.StringUtils.defaultString; 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 5d5466291c6..6573d28a867 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 @@ -48,7 +48,6 @@ import static ca.uhn.fhir.jpa.model.util.SearchParamHash.hashSearchParam; 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 50cd671dcb4..eec0081b87b 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 @@ -52,7 +52,6 @@ import static ca.uhn.fhir.jpa.model.util.SearchParamHash.hashSearchParam; 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 0db8b2ad2b3..47dae73191c 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 @@ -47,7 +47,6 @@ import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextFi import static ca.uhn.fhir.jpa.model.util.SearchParamHash.hashSearchParam; import static org.apache.commons.lang3.StringUtils.defaultString; -@Embeddable @EntityListeners(IndexStorageOptimizationListener.class) @Entity @Table(