I'd like to get the sql string from a CriteriaQuery using Hibernate 6.
- Query.getQueryString() does no longer work in Hibernate 6 for
CriteriaQuery
. SQLExtractor.from()
dos not work either because it just uses reflection to call Query.getQueryString()- How to get SQL from Hibernate Criteria API (*not* for logging) only works for hibernate versions up to 5.
- logging the sql statements is not enough in my use case. I need to store them in a string for processing.
Any ideas?