solved table api throw 404 error (#12261)

This commit is contained in:
07Himank 2023-07-03 16:08:06 +05:30 committed by GitHub
parent bdb438d12d
commit 245303c8c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -2057,6 +2057,9 @@ public interface CollectionDAO {
@SqlUpdate("DELETE FROM tag_usage where tagFQNHash = :tagFQNHash AND source = :source")
void deleteTagLabels(@Bind("source") int source, @Bind("tagFQNHash") String tagFQNHash);
@SqlUpdate("DELETE FROM tag_usage where tagFQNHash = :tagFQNHash")
void deleteTagLabelsByFqn(@Bind("tagFQNHash") String tagFQNHash);
@SqlUpdate("DELETE FROM tag_usage where tagFQNHash LIKE CONCAT(:tagFQNHash, '.%') AND source = :source")
void deleteTagLabelsByPrefix(@Bind("source") int source, @Bind("tagFQNHash") String tagFQNHash);

View File

@ -830,8 +830,14 @@ public abstract class EntityRepository<T extends EntityInterface> {
daoCollection.entityExtensionDAO().deleteAll(id);
// Delete all the tag labels
daoCollection.tagUsageDAO().deleteTagLabelsByTargetPrefix(entityInterface.getFullyQualifiedName());
daoCollection
.tagUsageDAO()
.deleteTagLabelsByTargetPrefix(FullyQualifiedName.buildHash(entityInterface.getFullyQualifiedName()));
// when the glossary and tag is deleted .. delete its usage
daoCollection
.tagUsageDAO()
.deleteTagLabelsByFqn(FullyQualifiedName.buildHash(entityInterface.getFullyQualifiedName()));
// Delete all the usage data
daoCollection.usageDAO().delete(id);