-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Replace derived CriteriaQuery
with String-based queries
#3588
Comments
It is possible to use String-based queries. We should consider how to inject Keyset-pagination predicates and introduce joins for sort by fields that work for part tree queries and JPQL queries using ideally the same mechanism. |
Is this why FilterDef broke somewhere between Spring Boot 2.1 and 2.5? See #2565 If queries are rendered to JPQL/HQL again, then can they be created through EntityManager, so that those of us who unwrap Session and enable filters will be able to use |
We've been using CriteriaQuery for derived queries and |
Why does JPQL queries perform better than Criteria Queries? Parsing JPQL into SQM seems more heavy than mapping CriteriaQuery to SQM, maybe it should be improved at Hibernate side, or something going wrong at Spring Data JPA side. |
Because Hibernate seems to cache the parsed HQL query. |
CriteriaQuery
with String-based queries
We should explore how we could switch from Criteria Queries to JPQL queries as Hibernate has a much better efficiency running String-based queries:
We would need to build our own
JpqlQueryBuilder
that mimicsCriteriaBuilder
in terms of expressions, predicates and automated inclusion of joins.Collection of related tickets:
NULLS
precedence usingSort
for Criteria Queries #3587The text was updated successfully, but these errors were encountered: