【发布时间】:2018-05-24 21:29:44
【问题描述】:
我正在编写一个包装Spring Data Jpa 的JpaRepository 接口的库,因为我想自动将相同的条件添加到所有JpaRepository DB 调用(类似于and where t > something)。
例如 JpaRepository 底层的 findById 函数将转换为 find by id and where t > something
有可能吗?如果是这样,我该怎么做?
谢谢!
【问题讨论】:
-
使用休眠的
@Filter或简单的@Where。
标签: java spring spring-data spring-data-jpa jpql