Thanks for your feedback.
Indeed the current fix is a bit clumsy as there is no easy way to perform certain checks. Good to know that Hibernate 6 will come with a better tree of whole query. Looking forward to the release of 6.