Skip to content

Support Hibernate 6.1 native query parser #3010

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

Closed
wants to merge 2 commits into from
Closed

Support Hibernate 6.1 native query parser #3010

wants to merge 2 commits into from

Conversation

gregturn
Copy link
Contributor

@gregturn gregturn commented Jun 9, 2023

Because Hiberante 6.1's HQL query parser is different than Hibernate 6.2, we must support both if we are to migrate to using their parser.

This stipulates that we compile against BOTH versions of Hibernate and selectively choose which actual parser based on a classpath check. Thus, we need each parser in a separate maven module.

Original Pull Request: #3003

@gregturn gregturn requested a review from mp911de June 9, 2023 19:15
Rewrite our custom visitors to plug into Hibernate's official parser for HQL.

See #3002
Original Pull Request: #3003
@mp911de
Copy link
Member

mp911de commented Jun 12, 2023

This isn't a viable approach. With the increased frequency of Hibernate introducing changes, we're effectively always behind and at risk of missing a change which then leads to us breaking applications.

While it initially seemed a good idea to reuse Hibernate's parser, it turns out this is a much worse approach regarding coupling. It is best to roll back to a state in which we have control over the parser. We still need to upgrade our HQL grammar variant with each Hibernate release but we do not use Hibernate API that frequently changes.

@mp911de mp911de added the status: declined A suggestion or change that we don't feel we should currently apply label Jun 12, 2023
@gregturn gregturn closed this Jun 12, 2023
@gregturn gregturn added type: enhancement A general enhancement in: query-parser Everything related to parsing JPQL or SQL labels Jun 12, 2023
@gregturn gregturn deleted the issue/hql branch June 12, 2023 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: query-parser Everything related to parsing JPQL or SQL status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants