I am also facing the same issue in Hibernate 5.3.7 .
I have observed that this issue is reproducible only if the key type is a non primitive type.