Hibernate spring数据查询中的非严格不等式

Hibernate spring数据查询中的非严格不等式,hibernate,jpa,spring-data,spring-data-jpa,Hibernate,Jpa,Spring Data,Spring Data Jpa,我正在寻找一种在spring数据存储库中定义查询的方法,这些数据存储库使用非严格不等式,但似乎找不到这样做的方法 假设有一个实体类: @Entity class Person{ @Id @Generated Integer id; int age; } 我正在为这个类创建一个存储库。使用严格不等式创建查询非常简单: interface PersonRepository extends Repository<Person,Integer>{ List<P

我正在寻找一种在spring数据存储库中定义查询的方法,这些数据存储库使用非严格不等式,但似乎找不到这样做的方法

假设有一个实体类:

@Entity
class Person{
    @Id @Generated Integer id;
    int age;
}
我正在为这个类创建一个存储库。使用严格不等式创建查询非常简单:

interface PersonRepository extends Repository<Person,Integer>{
    List<Person> findByAgeGreaterThan(int a);
}
接口PersonRepository扩展存储库{
列表FindByagegreeaterthan(int a);
}
这将找到所有年龄>a的人 但我似乎找不到实现非严格不平等的方法,即年龄>=a

我已尝试将查询与或组合: FindByAgeoRageGraaterThan-这会导致运行时异常 此外,我还尝试使用'Not'关键字反转查询,但该关键字无法编译

除了使用@query注释创建自己的自定义查询之外,真的没有其他方法吗?

试试这个

List<Person> findByAgeGreaterThanEqual(int a);
List findByAgeGreaterThanEqual(int a);
请检查以获取所有受支持的方法名称的列表