There is a test case for this issue and runs just fine in 5.4.1 and the master branch. Try to create a replicating test case that proves the issue. Or, fork Hibernate ORM, modify an existing test to replicate it, and send a Pull Request.