Here you go https://github.com/hibernate/hibernate-orm/pull/1901
I submitted against 5.1.x because it would be nice if this was back ported.