openmrs-core
openmrs-core copied to clipboard
TRUNK-6231: Migrate from Hibernate Mapping XML to JPA annotations.
Description of what I changed
Migrated the following entities from Hibernate mapping XML to JPA annotations:
- DrugIngredient
- FieldAnswer
- AlertRecipient
Issue I worked on
see https://openmrs.atlassian.net/browse/TRUNK-6231
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
-
[] 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
@wikumChamith you have not yet responded to my comment.
@wikumChamith you have not yet responded to my comment.
Am I missing something :sweat_smile:
Your screenshot has pending
I replied to your question before. In case you are not seeing it, I have my answer here.
To replace this composite key.
<composite-id> <key-many-to-one name="alert" column="alert_id" class="org.openmrs.notification.Alert" /> <key-many-to-one name="recipient" class="org.openmrs.User" column="user_id" /> </composite-id>
Can't we pull this off without creating the new class?
I initially followed the recommended approach by creating a separate class. However, we can achieve this without creating an additional class. I have updated the PR accordingly.
I initially followed the recommended approach by creating a separate class. However, we can achieve this without creating an additional class. I have updated the PR accordingly.
Did you test these changes by running the webapp and confirm that all is well?
@wikumChamith i also find the title not clear enough. What are you migrating? Is it all the classes that are currently mapped to hibernate mapping xml files? In the past, we have done this as one entity at a time. That is, each with its own ticket and pull request.
I agree. I'll try to create sperate tickets and pull requests for each entity.
I am closing this PR to create separate pull requests for each entity.