Skip to content

HHH-20339 MappedSuperclass query with embeddable path comparison against parameter throws UnsupportedOperationException#12178

Merged
mbellade merged 1 commit intohibernate:mainfrom
mbellade:HHH-20339
Apr 30, 2026
Merged

HHH-20339 MappedSuperclass query with embeddable path comparison against parameter throws UnsupportedOperationException#12178
mbellade merged 1 commit intohibernate:mainfrom
mbellade:HHH-20339

Conversation

@mbellade
Copy link
Copy Markdown
Member

@mbellade mbellade commented Apr 14, 2026

Note the test was already working on 7.x as it was "fixed" by side effect of https://hibernate.atlassian.net/browse/HHH-19449

The only SQM node with a CompositeSqmPathSource as node type is SqmEmbeddedValuedSimplePath, which is also an SqmPath, so BaseSqmToSqlAstConverter#determineValueMapping always resolves it via the SqmPath branch.

That returns null when the lhs is a root but not an entity type (like in this case with the polymorphic @MappedSuperclass query). Then SqmEmbeddedValuedSimplePath#getNodeType() returns an EmbeddableTypeImpl (since the fix for HHH-19449), and MappingMetamodelImpl#resolveMappingExpressible just returns null, and the implementation resorts to resolveInferredType().


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.



Please make sure that the following tasks are completed:
Tasks specific to HHH-20339 (Bug):

  • Add test reproducing the bug
  • Add entries as relevant to migration-guide.adoc OR check there are no breaking changes

https://hibernate.atlassian.net/browse/HHH-20339

@sonarqubecloud
Copy link
Copy Markdown

@mbellade mbellade merged commit 01991e3 into hibernate:main Apr 30, 2026
25 of 27 checks passed
@mbellade mbellade deleted the HHH-20339 branch April 30, 2026 12:34
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