I've incorporated the tests from the pull request, added more tests and a fix into a new commit pushed to my fork: https://github.com/gbadner/hibernate-core/commits/HHH-10476-master