具有默认值的Spring JPA查询方法

接口上的Spring JPA Query方法是否可以具有默认值?

This is the common one: Optional<DocumentTypeEntity> findByIdAndStatus(BigInteger id, String status);

I want the status to have a value of "ACTIVE" (this won't work though) Optional<DocumentTypeEntity> findByIdAndStatus(BigInteger id, "ACTIVE");

也许有人有想法?自定义查询是我的最后选择!谢谢!

评论