Skip to content

Conversation

@shivvani-r
Copy link
Contributor

Description

This is Part 2 of the TRUNK-5950 work (Part 1 was merged recently).

This PR adds the logic to automatically populate the mandatory name column based on aIsToB and bIsToA values.

Changes

  • Automation: Added a new method updateName() and added @PrePersist and @PreUpdate listeners to auto-generate the name.
  • Testing:
    • Added RelationshipTypeTest.java with unit test for updateName() verifying the auto-naming behavior.
    • Updated legacy XML datasets to include the name column (required now that name column cannot be NULL).
  • Liquibase: Added a changeset to backfill names for existing rows in the database.

Ticket

https://issues.openmrs.org/browse/TRUNK-5950

Checklist: I completed these to help reviewers :)

  • My IDE is configured to follow the code style of this project.
  • I have added tests to cover my changes.
  • I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.
  • All new and existing tests passed.
  • My pull request is based on the latest changes of the master branch.

@shivvani-r
Copy link
Contributor Author

shivvani-r commented Jan 7, 2026

@dkayiwa Thanks for merging the hibernate migrations! This is the follow-up PR that adds the auto-fill logic we discussed here. It's ready for your review when you have a moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant