NativeQueryTupleTransformer doesn't handle null values in returned ResultSet
If the native query returns tuple containing null values, then NativeQueryTupleTransformer throws IllegalArgumentException with the message "Unknown alias [aliasName]", where aliasName is the name of the column having null value. For instance, "aliasToValue" contains
For this case "Unknown alias [value]" will be shown.
Bug is caused by:
which returns null for the key which is present in the map, but the value itself is null.
We have to check if the key is present in "aliasToValue" map via "containsKey" method.
Applied PR upstream.
One another existing test was modified to verify that the impacted case behaves as desired
Pull request containing the fix and couple of simple unit tests for the impacted class was raised.
Do you think we need more complex ones? Integration test cases which bring up the whole context?
Honestly the issue itself is so small and local, that i see no point in adding anything else, but if you think it is mandatory, then i will try extending the coverage.
Thanks in advance for pulling in the changes
Please attach a test case that reproduces your test case. Templates are at https://github.com/hibernate/hibernate-test-case-templates.
Or, since you have a proposed fix, it would be great if you could create a pull request with a test case and your fix.