Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *closed* an issue as *Won't Do*
Hibernate does that because it works with equals/hashCode when it comes to
strings(varchar), which is always case sensitive. So the result of the query contains
entities with identifiers `aaa`, `bbb` etc. and the foreign key value, by which Hibernate
then tries to load objects for the associations, have the values `AAA`, `BBB` etc. For
these values Hibernate can not find entities in the persistence context, so it will
consult the database again. Unless you configured a case insensitive collation, the
subsequent selects will produce no results.
Overall, there is nothing Hibernate can do here. You will just have to fix your data. Also
see the discussion with a user on Discourse that had a similar issue:
https://discourse.hibernate.org/t/how-can-i-make-a-resultsetmapping-for-a...
(
https://discourse.hibernate.org/t/how-can-i-make-a-resultsetmapping-for-a...
)
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYjM0NTQ3ZTBi...
) / Improvement (
https://hibernate.atlassian.net/browse/HHH-15470?atlOrigin=eyJpIjoiYjM0NT...
) HHH-15470 (
https://hibernate.atlassian.net/browse/HHH-15470?atlOrigin=eyJpIjoiYjM0NT...
) Prevent N+1 problem on successful join results (
https://hibernate.atlassian.net/browse/HHH-15470?atlOrigin=eyJpIjoiYjM0NT...
)
Change By: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Assignee: Unassigned Christian Beikov Resolution: Won't Do Status: Open Closed
(
https://hibernate.atlassian.net/browse/HHH-15470#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15470#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100206- sha1:1e36365 )