Unfortunately, the criteria API is not well thought out.
While the fact that it will not generate HQL for you is understandable (in any case, the criteria are an alternative to HQL), there is no way to do it yourself - not without fixing the Hibernate code. The class of criteria is a one-way street; he supports all the conditions / associations / etc. that you have provided to him, but does not provide you with a way to return them.
Hibernate Generic DAO, ( ). , API- Criteria:-), QL, Hibernate JPA ( )