【发布时间】:2019-11-29 13:45:04
【问题描述】:
我正在使用 spring-data 进行数据库交互。我想查看存储库中编写的查询的 jpa sql 执行计划。我该怎么做。
https://vladmihalcea.com/execution-plan-oracle-hibernate-query-hints/ 讲述使用 GATHER_PLAN_STATISTICS 和 COMMENT 查询提示。我添加了 COMMENT 提示,但不知道如何添加其他提示。
public interface StudentRepository extends JpaRepository<Student, Long>{
@QueryHints({
@QueryHint(name=org.hibernate.annotation.queryHints.COMMENT,
value="SQL_PLAN_STUDENT")
})
List<Student>findByStudentIDIn(List<Long> ids);
}
【问题讨论】:
标签: oracle spring-data-jpa sql-execution-plan query-hints