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

Make JpaSort.unsafe() operational for HQL, EQL, and JPQL. #3187

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gregturn
Copy link
Contributor

@gregturn gregturn commented Oct 5, 2023

To support testing various configurations, I also implemente @HideHibernate, @HideEclipseLink, and @HidePersistenceProviders so that test methods and test classes can verify these classpath checks.

@gregturn
Copy link
Contributor Author

gregturn commented Oct 5, 2023

Considering it's a bug fix and all the new code is package-private (or private), then all the HQL and JPQL parts should be a candidate for backporting, at least to all versions that have query parsing.

However, to do so would ALSO require backporting the PersistenceProvider.isPresent from #3170 (which I'm in favor of).

We have offered this method as a way for people to customize an ORDER BY clause beyond a simple property name. For example, someone could use "LENGTH(firstname)" as a function to order by the length of each row's lastname instead of ordering by the lastname itself.

By using the relevant parser and applying a different visitor, this commit make operational a feature that shows little evidence of ever having worked.

See #3172.
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.

Why default implementation JpaRepository doesn't support JpaSort.unsafe(...)?
1 participant