我有一个实体:

@RedisHash("person")
@Data
class Person{
 @Id String id;
 @Indexed
 String firstName;
 @Indexed
 String lastName;
 @Indexed
 int age;
}

和Spring Data Repository:

public interface PersonRepository extends CrudRepository<Person, String>{
 Person findByFirstName(String firstName);
 Person findByAge(int age);
     ...
    }

是否有替代方法作为JPA中的Criteria API和预测?因为我需要通过人物的一个字段来过滤Person . 现在我必须创建6种方法来涵盖所有情况 .