Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@darxriggs
Copy link
Contributor

This is to check that a getTotalCount() implementation should not have sorting in the generated query.
Otherwise, depending on the database and its strictness configuration, the query might fail.

In the gorm-hibernate5 project one test would fail a follows:

org.h2.jdbc.JdbcSQLSyntaxErrorException: Order by expression "UPPER(PERSON0_.FIRST_NAME)" must be in the result list in this case; SQL statement:
select distinct count(person0_.id) as col_0_0_ from person person0_ order by upper(person0_.first_name) desc [90068-200]

I will also provide a fix for it.

This is for consistency with the test for the criteria.
This is to check that a getTotalCount() implementation should not
have sorting in the generated query. Otherwise, depending on the
database and its strictness configuration, the query might fail.
@CLAassistant
Copy link

CLAassistant commented Oct 1, 2023

CLA assistant check
All committers have signed the CLA.

@darxriggs
Copy link
Contributor Author

@puneetbehl When merging this, please also back port it to 7.3.x.

@puneetbehl
Copy link
Contributor

Can you please cherry-pick and send a PR to 7.3.x branch?

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