Thanks for the test case. I’m currently re-working all of the treat optimizations for Hibernate 6 and will try to finish that for 6.2.0.Final, but I doubt that we can reasonably fix this in 5.