Is there any way to Extract the final SQL from Hibernate?

Here is my Use Case , I generate Code with JPA or QueryDsL in java
but i need the filter and QueryCondition for another Program can use it ,which is python ,
So i need a native SQL can direct use in database
I’m using MySql in this case and Hibernate version is 6.1
with QueyDsl 5.0

Sorry, but that is not enough information for anyone to help you. Please provide code samples of what you want to do or ask specific questions.

It sounds like you might want to log the sql that Hibernate is running against MySQL. I use a variation of datasource-proxy-examples/springboot-autoconfig-example/src/main/java/net/ttddyy/dsproxy/example/ at master · ttddyy/datasource-proxy-examples · GitHub to accomplish that. You’ll only be able to see the sql by actually running the queries though.