From 1d9a0a953c338963c387c1c4fc83f62859b8bc52 Mon Sep 17 00:00:00 2001 From: Amardeep Chimber Date: Tue, 10 Dec 2024 11:47:03 +0000 Subject: [PATCH] add NumericBooleanConverter, to prevent local test failure --- .../controller/casedetails/entity/AliasEntity.kt | 10 ++++------ .../casedetails/entity/RegistrationEntity.kt | 14 ++++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/AliasEntity.kt b/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/AliasEntity.kt index a904a8775f..a2e5467858 100644 --- a/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/AliasEntity.kt +++ b/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/AliasEntity.kt @@ -1,13 +1,9 @@ package uk.gov.justice.digital.hmpps.controller.casedetails.entity -import jakarta.persistence.Column -import jakarta.persistence.Entity -import jakarta.persistence.Id -import jakarta.persistence.JoinColumn -import jakarta.persistence.ManyToOne -import jakarta.persistence.Table +import jakarta.persistence.* import org.hibernate.annotations.Immutable import org.hibernate.annotations.SQLRestriction +import org.hibernate.type.NumericBooleanConverter import java.time.LocalDate @Immutable @@ -31,5 +27,7 @@ class AliasEntity( @ManyToOne @JoinColumn(name = "offender_id", nullable = false) val case: CaseEntity, + @Column(name = "soft_deleted", columnDefinition = "number") + @Convert(converter = NumericBooleanConverter::class) val softDeleted: Boolean = false ) diff --git a/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/RegistrationEntity.kt b/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/RegistrationEntity.kt index 04724eb3cb..ff233f979a 100644 --- a/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/RegistrationEntity.kt +++ b/projects/unpaid-work-and-delius/src/main/kotlin/uk/gov/justice/digital/hmpps/controller/casedetails/entity/RegistrationEntity.kt @@ -1,13 +1,9 @@ package uk.gov.justice.digital.hmpps.controller.casedetails.entity -import jakarta.persistence.Column -import jakarta.persistence.Entity -import jakarta.persistence.Id -import jakarta.persistence.JoinColumn -import jakarta.persistence.ManyToOne -import jakarta.persistence.Table +import jakarta.persistence.* import org.hibernate.annotations.Immutable import org.hibernate.annotations.SQLRestriction +import org.hibernate.type.NumericBooleanConverter import uk.gov.justice.digital.hmpps.integrations.common.entity.ReferenceData import java.time.LocalDate @@ -33,7 +29,13 @@ class RegistrationEntity( @ManyToOne @JoinColumn(name = "registration_level", updatable = false) val level: ReferenceData, + + @Column(name = "soft_deleted", columnDefinition = "number") + @Convert(converter = NumericBooleanConverter::class) val softDeleted: Boolean = false, + + @Column(name = "deregistered", columnDefinition = "number") + @Convert(converter = NumericBooleanConverter::class) val deregistered: Boolean = false )