openmrs-core icon indicating copy to clipboard operation
openmrs-core copied to clipboard

TRUNK-5903: Switching from hibernate mappings to annotations-Role

Open mherman22 opened this issue 1 year ago • 9 comments

Description of what I changed

  • I have changed the role domain from using hibernate xml mappings to annotations.

  • Also ensured the role class extends the extends BaseOpenmrsObject but also implements the retireable and Auditable interfaces.

  • I made the name attribute transient so that it doesn't get persisted.

Issue I worked on

see https://issues.openmrs.org/browse/TRUNK-5903

Checklist: I completed these to help reviewers :)

  • [x] My IDE is configured to follow the code style of this project.

    No? Unsure? -> configure your IDE, format the code and add the changes with git add . && git commit --amend

  • [x] I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)

    No? -> write tests and add them to this commit git add . && git commit --amend

  • [x] I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.

    No? -> execute above command

  • [x] All new and existing tests passed.

    No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.

  • [x] My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

mherman22 avatar Apr 02 '23 12:04 mherman22

@mherman22 Got some failing tests at

Error: Tests run: 29, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 2.353 s <<< FAILURE! - in org.openmrs.hl7.HL7ServiceTest Error: org.openmrs.hl7.HL7ServiceTest.resolveUserId_shouldReturnNullForAmbiguousUsersUsingFirstAndLastNameGivenUserIDIsNull Time elapsed: 0.06 s <<< ERROR!

tendomart avatar Apr 02 '23 13:04 tendomart

@mherman22 Got some failing tests at

Error: Tests run: 29, Failures: 0, Errors: 1, Skipped: 2, Time elapsed: 2.353 s <<< FAILURE! - in org.openmrs.hl7.HL7ServiceTest Error: org.openmrs.hl7.HL7ServiceTest.resolveUserId_shouldReturnNullForAmbiguousUsersUsingFirstAndLastNameGivenUserIDIsNull Time elapsed: 0.06 s <<< ERROR!

@tendomart i am looking into that. Feel free to read through this talk post though -> https://talk.openmrs.org/t/switching-from-xml-mappings-to-annotations/39277/1

mherman22 avatar Apr 02 '23 14:04 mherman22

Error:    VisitValidatorTest.validate_shouldFailIfTheStartDatetimeIsAfterAnyEncounter » StackOverflow
Error:    VisitValidatorTest.validate_shouldFailIfTheStopDatetimeIsBeforeAnyEncounter » StackOverflow

tendomart avatar Apr 12 '23 11:04 tendomart

Error:    VisitValidatorTest.validate_shouldFailIfTheStartDatetimeIsAfterAnyEncounter » StackOverflow
Error:    VisitValidatorTest.validate_shouldFailIfTheStopDatetimeIsBeforeAnyEncounter » StackOverflow

looks to be a failure on the entire core as of this commit --> https://github.com/openmrs/openmrs-core/commit/7e9a3b692d4b913e6c028791bf803b96af59651e

mherman22 avatar Apr 12 '23 11:04 mherman22

It's a flaky test... Or at least, the commit you point to only updates the README.md file, so I'm not certain how that could change test results.

ibacher avatar Apr 12 '23 12:04 ibacher

It's a flaky test... Or at least, the commit you point to only updates the README.md file, so I'm not certain how that could change test results.

This test passes when i build locally.

mherman22 avatar Apr 13 '23 13:04 mherman22

@dkayiwa @ibacher am pinging you on this

mherman22 avatar Jun 21 '23 09:06 mherman22

@mherman22 did you see the merge conflicts?

dkayiwa avatar Jan 29 '24 22:01 dkayiwa