From ae4658f85de20b78f16f22ae2e236fa0f85a656d Mon Sep 17 00:00:00 2001 From: IceS2 Date: Thu, 19 Dec 2024 10:20:21 +0100 Subject: [PATCH] MINOR: Fix Table constraint relationships for SoftDeleted entities. (#19129) * Update TableRepository.java * Fix Checkstyle --- .../java/org/openmetadata/service/jdbi3/TableRepository.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java index 0247bf0b7cd..308b7adbd8e 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/TableRepository.java @@ -1138,7 +1138,7 @@ public class TableRepository extends EntityRepository { String toParent = FullyQualifiedName.getParentFQN(column); String columnName = FullyQualifiedName.getColumnName(column); try { - Table toTable = findByName(toParent, NON_DELETED); + Table toTable = findByName(toParent, ALL); validateColumn(toTable, columnName); } catch (EntityNotFoundException e) { throw new EntitySpecViolationException("Table not found: " + toParent); @@ -1232,8 +1232,7 @@ public class TableRepository extends EntityRepository
{ for (String column : constraint.getReferredColumns()) { String toParent = FullyQualifiedName.getParentFQN(column); try { - EntityReference toTable = - Entity.getEntityReferenceByName(TABLE, toParent, NON_DELETED); + EntityReference toTable = Entity.getEntityReferenceByName(TABLE, toParent, ALL); addRelationship( table.getId(), toTable.getId(), TABLE, TABLE, Relationship.RELATED_TO); } catch (EntityNotFoundException e) {