Skip to content
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

O3-2904 Queue Module - queue should not have Queue Entries as a direc… #59

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

mseaton
Copy link
Member

@mseaton mseaton commented Feb 27, 2024

…t property

@mseaton mseaton merged commit 0218b94 into main Feb 27, 2024
1 check passed
@mseaton mseaton deleted the O3-2904 branch February 27, 2024 18:14
@@ -62,30 +63,9 @@ public class Queue extends BaseChangeableOpenmrsMetadata {
@JoinColumn(name = "status_concept_set", referencedColumnName = "concept_id")
private Concept statusConceptSet;

@OneToMany(mappedBy = "queue", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<QueueEntry> queueEntries;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused by this part of the change. Does this mean that queues no longer have queue entries?

Copy link
Member Author

@mseaton mseaton Feb 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ibacher yes, basically. It says that "Queue Entries" are associated with a Queue via a 1-many relationship, but a Queue does not directly have access to the entries that are associated with it. Can you find another example of where it's been our practice to have data belong to metadata directly? You can't get a List<PatientProgram> from a Program for example, even if one might think they want to do something like program.getEnrollments()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. It always bothered me that we had this direct linkage! In retrospect, I should've just read the ticket.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The refactoring makes sense. Thanks @mseaton

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.

3 participants