Skip to content

Conversation

@gavinking
Copy link
Member

[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.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Jun 29, 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: [f9230bf, 250d495, 2006db1, a625481, f74c7ef, ac550f3, 7a37a85, 91dd51e, b0cd0b1, 1865c7c, e7e231e, 74c0f90, ffbc09b, 5ee2b26, 9c85ba2, b20446e, bf64bd7, 9c298ff, 9513ada, b49dccb, ba841c4, e6eaa7d, 19da9fa, 68ba41e, 480d6f5, 3b49683, 563e1e3, d696c16, 6945dd0, c4b4c7a, 1aa2fc1, 56e9294, 874f0d9, 02a45cb, 48f20d2, 9ba64d1, a60f852, fd93ee9, a107f6c]

› This message was automatically generated.

apparently we do need to use getDual() when there
is a 'where' clause but no 'from' clause
@gavinking gavinking merged commit 7e30638 into hibernate:main Jun 30, 2025
3 of 4 checks passed
}
else {
if ( source instanceof QueryLiteral<?> literal && literal.getLiteralValue() == null ) {
literal.setInCast(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're making QueryLiteral mutable and change its state as part of rendering here which is a bit dirty IMO. Can you explain why you need this?`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is code which wraps literals in a cast(). But if the literal is already the argument of an explicit cast() function, we don't need to do that.

We could detect this situation earlier in the lifecycle, for example in SQB, but then we would have to pass that info all along the different trees, which is a PITA, but doable, obviously.

Ideally, the visitor itself would record this sort of state. But without knowing the tree structure very well, I would not know how to do that in a correct-enough way.

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.

2 participants