Postgres terminology service hard coded column names migration (#5866)

* updating parent pids column name

* updating name of the fullTestField Search

* updating name of the fullTestField Search

* fixing typo.

* failing test.

* - Moving FullTextField annotation from getter method and adding it to the newly added VC property of the entity;

- reverting the name of the FullTextField entity to its previous name of 'myParentPids';

- reverting the name of the lucene index to search on in the terminology service.

- updating the changelog;

* making spotless happy

---------

Co-authored-by: peartree <etienne.poirier@smilecdr.com>
This commit is contained in:
Etienne Poirier 2024-04-22 18:46:43 -04:00 committed by GitHub
parent 4322b83257
commit 07f879d276
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 11 deletions

View File

@ -0,0 +1,5 @@
---
type: fix
issue: 5865
title: "Moving the Hibernate.Search annotation for text indexing from the lob column to the column added as part of the
PostgreSql LOB migration."

View File

@ -43,7 +43,6 @@ import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.persistence.Temporal; import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType; import jakarta.persistence.TemporalType;
import jakarta.persistence.Transient;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.EqualsBuilder;
@ -58,10 +57,7 @@ import org.hibernate.search.mapper.pojo.bridge.mapping.annotation.RoutingBinderR
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.FullTextField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.GenericField;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.Indexed;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.IndexingDependency;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.ObjectPath;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyBinding; import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyBinding;
import org.hibernate.search.mapper.pojo.mapping.definition.annotation.PropertyValue;
import org.hl7.fhir.r4.model.Coding; import org.hl7.fhir.r4.model.Coding;
import java.io.Serializable; import java.io.Serializable;
@ -177,6 +173,11 @@ public class TermConcept implements Serializable {
@Column(name = "PARENT_PIDS", nullable = true) @Column(name = "PARENT_PIDS", nullable = true)
private String myParentPids; private String myParentPids;
@FullTextField(
name = "myParentPids",
searchable = Searchable.YES,
projectable = Projectable.YES,
analyzer = "conceptParentPidsAnalyzer")
@Column(name = "PARENT_PIDS_VC", nullable = true, length = Length.LONG32) @Column(name = "PARENT_PIDS_VC", nullable = true, length = Length.LONG32)
private String myParentPidsVc; private String myParentPidsVc;
@ -362,13 +363,6 @@ public class TermConcept implements Serializable {
return this; return this;
} }
@Transient
@FullTextField(
name = "myParentPids",
searchable = Searchable.YES,
projectable = Projectable.YES,
analyzer = "conceptParentPidsAnalyzer")
@IndexingDependency(derivedFrom = @ObjectPath({@PropertyValue(propertyName = "myParentPidsVc")}))
public String getParentPidsAsString() { public String getParentPidsAsString() {
return nonNull(myParentPidsVc) ? myParentPidsVc : myParentPids; return nonNull(myParentPidsVc) ? myParentPidsVc : myParentPids;
} }