You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using 'sorts.add(Sort.Order.desc("voter"));', If there are two or more voters, this.a
nswerRepository.findAllByQuestion(question, pageable); -> this doesn't get all Answers, instead gets pagination - 1 Answers
this is the result when the code above 'if (Objects.equals(sortBy, "mostVoted"))~~' executed asdfad
both counts should be same because the count means "All Answers" and it gets from same DB, same Hibernate query.
the difference between those is only 'sorts.add(Sort.Order.desc("voter"));' and attribute voter is @manytomany.
It is more strange that when the Entity Answer gets only one voter attribute, it works perfectly(both count is same) but when it gets two or more voter attribute, it just returns 9, not all of All Answers.
Please Help
If my English is Bad, I'm sorry. If you need extra explanation, Please notify me.
The text was updated successfully, but these errors were encountered:
Thank you for getting in touch. It would be great if you could take the time to reduce the linked sample application to a minimum. So just the repository, a failing testcase and if possible something using plain JPA without the spring bits to see if it is a spring or a persistence provider problem. Ideally using Testcontainers so that we can unzip or git clone, build, and deploy the reproducer.
sorry for late reply, I was so busy..
I made minimum spring app testing JpaRepository.
when the parameter of sort.by is set instance of java.utils.Set, it goes wrong
please check
this is my whole code
https://github.com/oungsi2000/jump-to-springboot
When I use JpaRepository with Sort.by and Pageable, I got some mismatch with this.
com.ll.jumptospringboot.domain.Answer.AnswerService.getList
com.ll.jumptospringboot.domain.Answer.Answer
when using 'sorts.add(Sort.Order.desc("voter"));', If there are two or more voters, this.a
nswerRepository.findAllByQuestion(question, pageable); -> this doesn't get all Answers, instead gets pagination - 1 Answers
this is the result when the code above 'if (Objects.equals(sortBy, "mostVoted"))~~' executed
asdfad
this is the result when the code above 'else~~' executed
스크린샷 2024-12-18 오후 8 39 05
both counts should be same because the count means "All Answers" and it gets from same DB, same Hibernate query.
the difference between those is only 'sorts.add(Sort.Order.desc("voter"));' and attribute voter is @manytomany.
It is more strange that when the Entity Answer gets only one voter attribute, it works perfectly(both count is same) but when it gets two or more voter attribute, it just returns 9, not all of All Answers.
Please Help
If my English is Bad, I'm sorry. If you need extra explanation, Please notify me.
The text was updated successfully, but these errors were encountered: