Description
Hi all,
I'm having an issue with pagination + projections + orm.xml + native queries.
I've described the issue in full detail here: https://stackoverflow.com/questions/72859385/hibernate-pagination-not-working-when-using-native-queries-named-query-exists-b, and I've created a fully reproducible sample here: https://github.com/bodiam/hibernate-bug, but in a nutshell, the issue is that when I create a native count query, the result type of the count query is not compatible.
Most likely the issue is here:
I have a workaround for now, which is to specify the mapping of the result like so:
<sql-result-set-mapping name="cntColumnResult">
<column-result name="cnt"/>
</sql-result-set-mapping>
But I was hoping there might be a slightly more user friendly way of dealing with this, since it's been giving me quite the troubles to fix this (thanks Eugene!)