mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-06 07:32:46 +00:00
MINOR: Fix Table constraint relationships for SoftDeleted entities. (#19129)
* Update TableRepository.java * Fix Checkstyle
This commit is contained in:
parent
d5360073c6
commit
ae4658f85d
@ -1138,7 +1138,7 @@ public class TableRepository extends EntityRepository<Table> {
|
|||||||
String toParent = FullyQualifiedName.getParentFQN(column);
|
String toParent = FullyQualifiedName.getParentFQN(column);
|
||||||
String columnName = FullyQualifiedName.getColumnName(column);
|
String columnName = FullyQualifiedName.getColumnName(column);
|
||||||
try {
|
try {
|
||||||
Table toTable = findByName(toParent, NON_DELETED);
|
Table toTable = findByName(toParent, ALL);
|
||||||
validateColumn(toTable, columnName);
|
validateColumn(toTable, columnName);
|
||||||
} catch (EntityNotFoundException e) {
|
} catch (EntityNotFoundException e) {
|
||||||
throw new EntitySpecViolationException("Table not found: " + toParent);
|
throw new EntitySpecViolationException("Table not found: " + toParent);
|
||||||
@ -1232,8 +1232,7 @@ public class TableRepository extends EntityRepository<Table> {
|
|||||||
for (String column : constraint.getReferredColumns()) {
|
for (String column : constraint.getReferredColumns()) {
|
||||||
String toParent = FullyQualifiedName.getParentFQN(column);
|
String toParent = FullyQualifiedName.getParentFQN(column);
|
||||||
try {
|
try {
|
||||||
EntityReference toTable =
|
EntityReference toTable = Entity.getEntityReferenceByName(TABLE, toParent, ALL);
|
||||||
Entity.getEntityReferenceByName(TABLE, toParent, NON_DELETED);
|
|
||||||
addRelationship(
|
addRelationship(
|
||||||
table.getId(), toTable.getId(), TABLE, TABLE, Relationship.RELATED_TO);
|
table.getId(), toTable.getId(), TABLE, TABLE, Relationship.RELATED_TO);
|
||||||
} catch (EntityNotFoundException e) {
|
} catch (EntityNotFoundException e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user