-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix glossary term relationship issue on updating parent/glossary #24794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a critical relationship integrity bug where moving a glossary term with children to a different glossary did not update the children's glossary relationships in the entity_relationship table. The fix ensures that when a parent term moves to a different glossary, all nested children have their HAS relationships updated from the old glossary to the new glossary.
Key Changes:
- Added
updateChildrenGlossaryRelationships()method to recursively update glossary relationships for all nested children - Added
bulkUpdateFromId()DAO method to efficiently update relationship records in batch - Added 9 comprehensive integration tests covering various move scenarios including consecutive moves, hierarchical structures, and cleanup operations
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| GlossaryTermRepository.java | Added method to update children glossary relationships when parent moves; calls new bulk update DAO method |
| CollectionDAO.java | Added bulkUpdateFromId SQL UPDATE method to change fromId in entity_relationship table for multiple records |
| GlossaryTermResourceTest.java | Added 9 test cases covering move scenarios including cross-glossary moves, nested hierarchies, consecutive moves, and post-deletion verification |
openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/GlossaryTermRepository.java
Outdated
Show resolved
Hide resolved
|



Describe your changes:
Fixes When a parent term moved to a different glossary, only the parent's relationships were updated
but the Children's glossary relationships (entity_relationship table) were not updated
Added test for the scenarios :
glossary
glossary and parent
glossary and parent
and glossary
original and intermediate glossaries
I worked on ... because ...
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>