【发布时间】:2020-10-20 03:00:23
【问题描述】:
是否可以使用 redis 创建 JPQL 过滤器?
如果我试试这个:
List<ContingencyDTO> findAll();
作品:
但如果我尝试使用 jpql 编号。
@Repository
public interface ContingencyRepository extends
CrudRepository<ContingencyDTO,Integer>, QueryByExampleExecutor<ContingencyDTO>
{
List<ContingencyDTO> findByInitialZipCodeLessThanEqual(Long initialZipCode);
}
返回此消息错误: Erro::handleAPIException::异常
org.springframework.dao.InvalidDataAccessApiUsageException: LESS_THAN_EQUAL (1): [IsLessThanEqual, LessThanEqual] 不支持 Redis 查询派生!;嵌套异常是 java.lang.IllegalArgumentException: LESS_THAN_EQUAL (1): [IsLessThanEqual, LessThanEqual] 不支持 Redis 查询派生!
我尝试在 DTO 中将过滤后的值更新为 @Indexed 但不起作用。
private @Indexed Long initialZipCode;
【问题讨论】:
-
您遇到错误了吗?你知道
findByZipcode和findAll是如何工作的吗? -
Erro:: handleAPIException:: 异常 org.springframework.data.mapping.PropertyReferenceException: 没有找到 ContingencyDTO 类型的属性 findByZipcode!在 org.springframework.data.mapping.PropertyPath.
标签: java spring jpa redis jpql