You could give Blaze-Persistence JPA Criteria a chance. It is a implemention of the JPA Criteria API on top a custom query builder that outputs JPQL/HQL. That implementation correctly supports the TREAT operator and works for Hibernate 4.2 - 5.x