I need to get the string from an Hibernate query and process it later (so I can\'t solve it with \"hibernate.show_sql\"
).
I have already looked at How t
There is no such thing as "the full SQL string with the parameters values".
Hibernate uses prepared statements, therefore it sends query string with ?
s and parameter values to the database separately, so that the actual query is never constructed.
Perhaps you can find a way extract parameter values from QueryImpl
, but even in this case you won't be able to get a query ready for execution, because you'll need to handle escaping, conversion of parameter values to SQL literals, etc.