I have started my preliminary fix for this at https://github.com/Naros/hibernate-orm/tree/HHH-12612. If no one brings up any other known issues between now and the time we release the next 5.2 and 5.3 builds, I'll merge what I have.