【发布时间】:2022-01-06 10:40:41
【问题描述】:
我想在 JPA 中转换一个 sql 查询。
SELECT status, count(*)
FROM abc
WHERE type='XXX'
GROUP BY status
我需要一个带有 sql 的 JPARepository 中的东西。
@Repository
public interface ABCRepository extends JpaRepository<abc, Long> {
long countByStatusAndType(final A type, final B status);
}
有可能吗?
【问题讨论】:
标签: java spring-boot jpa spring-data-jpa spring-data