Skip to content

Conversation

cigaly
Copy link
Contributor

@cigaly cigaly commented Aug 11, 2025

Jira issue HHH-19703

In method org.hibernate.query.sql.internal.NativeQueryImpl#addScalar(java.lang.String, java.lang.Class) first check if BasicType is registered. If yes, use it to create result builder (similarily as in org.hibernate.query.sql.internal.NativeQueryImpl#addScalar(java.lang.String, org.hibernate.metamodel.model.domain.BasicDomainType)`. If not then fall back to existing implementation.

Note: Method org.hibernate.query.sql.internal.NativeQueryImpl#addScalar(int, java.lang.Class<?>) is not used anywhere. If it is "reserved for future use" or something like that, then it should be fixed. It will fail in exactly opposite case than one with column name - when no JavaType is registered.


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.


cigaly added 2 commits August 11, 2025 16:50
… is BasicType registered for class.

          If yes, use it to create scalar result builder; if not fall back to existing implementation.
 # Date:      Fri Aug 8 10:11:57 2025 +0200
Copy link
Member

@gavinking gavinking left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Cedomir

@gavinking gavinking merged commit 9cb1851 into hibernate:main Aug 12, 2025
23 of 24 checks passed
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