Вы можете добавить приведенную ниже конфигурацию в application.properties, чтобы увидеть запрос, сгенерированный Spring Boot / Hibernate
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.show_sql=true
hibernate.show_sql=true
hibernate.format_sql=true
logging.level.org.hibernate.SQL=DEBUG
logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.properties.*=true
Вы можете увидеть запрос в консоли. Здесь я делюсь примером этого.
2019-07-10 11:46:38:823 [http-nio-8080-exec-7] DEBUG org.hibernate.SQL -
select
*
from
user
where
statusenable=true
Hibernate:
select
*
from
user
where
statusenable=true
Если вы передали параметры для запроса, вы также можете увидеть его (последняя строка)
2019-07-10 11:49:30:073 [http-nio-8080-exec-3] DEBUG org.hibernate.SQL -
select
*
from
user
where
id=?
and statusenable=true
Hibernate:
select
*
from
user
where
id=?
and statusenable=true
2019-07-10 11:49:30:089 [http-nio-8080-exec-3] TRACE o.h.type.descriptor.sql.BasicBinder - binding parameter [1] as [NUMERIC] - [2]