Skip to content

HHH-17002, HHH-18820, HHH-19391, HHH-18514 equals() and hashCode() for SQM nodes #10090

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

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

Conversation

gavinking
Copy link
Member

  • finally enables efficient caching of criteria query plans
  • also reconsider how alias generation is done - aliases should only be unique to a given query, NOT globally unique, since that results in interpretation cache misses
  • ran into and fixed several other problems along the way
  • note that the previous solution based on translating to HQL was not working at all, partly because the translation to HQL is not very correct - but anyway this is more efficient, since hashCodes are in general more flexible from an efficiency perspective
  • there is still a remaining problem where NavigablePaths elements are assigned globally unique aliases resulting in cache misses

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


…r SQM nodes

- finally enables efficient caching of criteria query plans
- also reconsider how alias generation is done - aliases should only
  be unique to a given query, NOT globally unique, since that results
  in interpretation cache misses
- ran into and fixed several other problems along the way
- note that the previous solution based on translating to HQL was not
  working at all, partly because the translation to HQL is not very
  correct - but anyway this is more efficient, since hashCodes are
  in general more flexible from an efficiency perspective
- there is still a remaining problem where NavigablePaths elements
  are assigned globally unique aliases resulting in cache misses
@gavinking gavinking force-pushed the criteria-plan-caching branch from 180bb04 to cb857b1 Compare April 28, 2025 09:25
@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Apr 28, 2025

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [9f58d54]

› This message was automatically generated.

…oblem

- just deprecate the method, since HQL doesn't allow anonymous CTEs
- perhaps we need to do the same for the withRescursiveXxxxx() methods
- I don't really see a better fix, since nested CTEs can be composed
  before composing them with the outer query (perhaps we could modify
  the aliases of all CTEs after the whole query is built)
Oracle disapproves of aliases of form "_1"
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.

1 participant