Test case is avaiable at https://github.com/soldierkam/hibernate-orm/commit/d5f75dc3230f17ccea1ae7b7ec3808964b67475f