Spring 启动:属性 spring.jpa.show-sql 不适用于 Datastore
Spring Boot: property spring.jpa.show-sql doesn't work with Datastore
我有一个与 Google 数据存储一起使用的应用程序。为了使用数据库,我使用 JPA。存储库从 org.springframework.cloud.gcp.data.datastore.repository
.
实现 DatastoreRepository
我想查看应用程序对数据库进行的所有查询,因此我将 spring.jpa.show-sql
设置为 true
,但它对我不起作用。
有人遇到同样的问题吗?如何修复?
编辑
项目中的依赖项:
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-gcp-starter-data-datastore:1.1.1.RELEASE'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
谢谢
您可以尝试添加数据源代理:
有文档:https://github.com/ttddyy/datasource-proxy
下面是 Spring 引导的示例:
我有一个与 Google 数据存储一起使用的应用程序。为了使用数据库,我使用 JPA。存储库从 org.springframework.cloud.gcp.data.datastore.repository
.
DatastoreRepository
我想查看应用程序对数据库进行的所有查询,因此我将 spring.jpa.show-sql
设置为 true
,但它对我不起作用。
有人遇到同样的问题吗?如何修复?
编辑
项目中的依赖项:
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.cloud:spring-cloud-gcp-starter-data-datastore:1.1.1.RELEASE'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
谢谢
您可以尝试添加数据源代理:
有文档:https://github.com/ttddyy/datasource-proxy
下面是 Spring 引导的示例: