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

TRUNK-3197: An option is added for each sort Obs to be in asc or desc order #671

Merged
merged 1 commit into from Mar 10, 2014
Merged

Conversation

coldcue
Copy link
Contributor

@coldcue coldcue commented Feb 25, 2014

Description:

TODO: add an option for each sort item to be asc/desc
File: /openmrs/api/src/main/java/org/openmrs/api/db/hibernate/HibernateObsDAO.java
Line: 213

@dkayiwa Daniel Kayiwa's advice:

My advice is that when iterating over the sortList parameter, for each non empty sort, check if it has a sort order and use it. Else revert to the default as the existing code.
To give an example of the contents of the sortList: "field1 asc", "field2", "field3 desc".
From the above, you would sort field1 in ascending order, you would sort field2 using the existing default, and you would sort field3 in descending order, and more.

From these sources, I've implemented the advice, please review.

@dkayiwa
Copy link
Member

dkayiwa commented Mar 3, 2014

@coldcue can you add a unit test for this?
Also remember to run "mvn clean install" before committing to ensure that your changes get formatted according to our conventions.

@coldcue
Copy link
Contributor Author

coldcue commented Mar 3, 2014

@dkayiwa of course, I can.
Yes, I have to configure my IDE to match the conventions here.

@coldcue
Copy link
Contributor Author

coldcue commented Mar 3, 2014

@dkayiwa Unit test added, please review

@coldcue
Copy link
Contributor Author

coldcue commented Mar 4, 2014

@dkayiwa All commits rebased onto one commit, please review

dkayiwa added a commit that referenced this pull request Mar 10, 2014
TRUNK-3197: An option is added for each sort Obs to be in asc or desc order
@dkayiwa dkayiwa merged commit 671f44a into openmrs:master Mar 10, 2014
@coldcue coldcue deleted the TRUNK-3197 branch March 10, 2014 15:27
RandilaP pushed a commit to RandilaP/openmrs-core that referenced this pull request Jul 31, 2023
Co-authored-by: Dennis Kigen <kigen.work@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants