最新的稳定版本请使用 Spring Data Neo4j 7.3.1Spring中文文档

最新的稳定版本请使用 Spring Data Neo4j 7.3.1Spring中文文档

支持的查询方法主题关键字

下表列出了 Spring Data 存储库查询派生机制通常支持的主语关键字来表示谓词。 有关支持的关键字的确切列表,请参阅特定于商店的文档,因为此处列出的某些关键字可能在特定商店中不受支持。Spring中文文档

表 1.查询主题关键字
关键词 描述

find…By, , , , ,read…Byget…Byquery…Bysearch…Bystream…BySpring中文文档

常规查询方法通常返回存储库类型、或子类型或结果包装器(如 ,)或任何其他特定于存储区的结果包装器。可以用作 ,也可以与其他关键字结合使用。CollectionStreamablePageGeoResultsfindBy…findMyDomainTypeBy…Spring中文文档

exists…BySpring中文文档

存在投影,通常返回结果。booleanSpring中文文档

count…BySpring中文文档

计数投影返回数值结果。Spring中文文档

delete…By,remove…BySpring中文文档

删除查询方法不返回结果 () 或删除计数。voidSpring中文文档

…First<number>…,…Top<number>…Spring中文文档

将查询结果限制为第一个结果。此关键字可以出现在主题(和其他关键字)和 之间的任何位置。<number>findbySpring中文文档

…Distinct…Spring中文文档

使用非重复查询仅返回唯一结果。请参阅特定于商店的文档,了解该功能是否受支持。此关键字可以出现在主题(和其他关键字)和 之间的任何位置。findbySpring中文文档

表 1.查询主题关键字
关键词 描述

find…By, , , , ,read…Byget…Byquery…Bysearch…Bystream…BySpring中文文档

常规查询方法通常返回存储库类型、或子类型或结果包装器(如 ,)或任何其他特定于存储区的结果包装器。可以用作 ,也可以与其他关键字结合使用。CollectionStreamablePageGeoResultsfindBy…findMyDomainTypeBy…Spring中文文档

exists…BySpring中文文档

存在投影,通常返回结果。booleanSpring中文文档

count…BySpring中文文档

计数投影返回数值结果。Spring中文文档

delete…By,remove…BySpring中文文档

删除查询方法不返回结果 () 或删除计数。voidSpring中文文档

…First<number>…,…Top<number>…Spring中文文档

将查询结果限制为第一个结果。此关键字可以出现在主题(和其他关键字)和 之间的任何位置。<number>findbySpring中文文档

…Distinct…Spring中文文档

使用非重复查询仅返回唯一结果。请参阅特定于商店的文档,了解该功能是否受支持。此关键字可以出现在主题(和其他关键字)和 之间的任何位置。findbySpring中文文档

支持的查询方法谓词关键字和修饰符

下表列出了 Spring Data 存储库查询派生机制通常支持的谓词关键字。 但是,请参阅特定于商店的文档,了解支持的关键字的确切列表,因为此处列出的某些关键字可能在特定商店中不受支持。Spring中文文档

表 2.查询谓词关键字
逻辑关键字 关键字表达式

ANDSpring中文文档

AndSpring中文文档

ORSpring中文文档

OrSpring中文文档

AFTERSpring中文文档

After,IsAfterSpring中文文档

BEFORESpring中文文档

Before,IsBeforeSpring中文文档

CONTAININGSpring中文文档

Containing, ,IsContainingContainsSpring中文文档

BETWEENSpring中文文档

Between,IsBetweenSpring中文文档

ENDING_WITHSpring中文文档

EndingWith, ,IsEndingWithEndsWithSpring中文文档

EXISTSSpring中文文档

ExistsSpring中文文档

FALSESpring中文文档

False,IsFalseSpring中文文档

GREATER_THANSpring中文文档

GreaterThan,IsGreaterThanSpring中文文档

GREATER_THAN_EQUALSSpring中文文档

GreaterThanEqual,IsGreaterThanEqualSpring中文文档

INSpring中文文档

In,IsInSpring中文文档

ISSpring中文文档

Is、 、 (或无关键字)EqualsSpring中文文档

IS_EMPTYSpring中文文档

IsEmpty,EmptySpring中文文档

IS_NOT_EMPTYSpring中文文档

IsNotEmpty,NotEmptySpring中文文档

IS_NOT_NULLSpring中文文档

NotNull,IsNotNullSpring中文文档

IS_NULLSpring中文文档

Null,IsNullSpring中文文档

LESS_THANSpring中文文档

LessThan,IsLessThanSpring中文文档

LESS_THAN_EQUALSpring中文文档

LessThanEqual,IsLessThanEqualSpring中文文档

LIKESpring中文文档

Like,IsLikeSpring中文文档

NEARSpring中文文档

Near,IsNearSpring中文文档

NOTSpring中文文档

Not,IsNotSpring中文文档

NOT_INSpring中文文档

NotIn,IsNotInSpring中文文档

NOT_LIKESpring中文文档

NotLike,IsNotLikeSpring中文文档

REGEXSpring中文文档

Regex, ,MatchesRegexMatchesSpring中文文档

STARTING_WITHSpring中文文档

StartingWith, ,IsStartingWithStartsWithSpring中文文档

TRUESpring中文文档

True,IsTrueSpring中文文档

WITHINSpring中文文档

Within,IsWithinSpring中文文档

除了筛选器谓词之外,还支持以下修饰符列表:Spring中文文档

表 3.查询谓词修饰符关键字
关键词 描述

IgnoreCase,IgnoringCaseSpring中文文档

与谓词关键字一起使用,进行不区分大小写的比较。Spring中文文档

AllIgnoreCase,AllIgnoringCaseSpring中文文档

忽略所有合适属性的大小写。在查询方法谓词中的某处使用。Spring中文文档

OrderBy…Spring中文文档

指定静态排序顺序,后跟属性路径和方向(例如)。OrderByFirstnameAscLastnameDescSpring中文文档

表 2.查询谓词关键字
逻辑关键字 关键字表达式

ANDSpring中文文档

AndSpring中文文档

ORSpring中文文档

OrSpring中文文档

AFTERSpring中文文档

After,IsAfterSpring中文文档

BEFORESpring中文文档

Before,IsBeforeSpring中文文档

CONTAININGSpring中文文档

Containing, ,IsContainingContainsSpring中文文档

BETWEENSpring中文文档

Between,IsBetweenSpring中文文档

ENDING_WITHSpring中文文档

EndingWith, ,IsEndingWithEndsWithSpring中文文档

EXISTSSpring中文文档

ExistsSpring中文文档

FALSESpring中文文档

False,IsFalseSpring中文文档

GREATER_THANSpring中文文档

GreaterThan,IsGreaterThanSpring中文文档

GREATER_THAN_EQUALSSpring中文文档

GreaterThanEqual,IsGreaterThanEqualSpring中文文档

INSpring中文文档

In,IsInSpring中文文档

ISSpring中文文档

Is、 、 (或无关键字)EqualsSpring中文文档

IS_EMPTYSpring中文文档

IsEmpty,EmptySpring中文文档

IS_NOT_EMPTYSpring中文文档

IsNotEmpty,NotEmptySpring中文文档

IS_NOT_NULLSpring中文文档

NotNull,IsNotNullSpring中文文档

IS_NULLSpring中文文档

Null,IsNullSpring中文文档

LESS_THANSpring中文文档

LessThan,IsLessThanSpring中文文档

LESS_THAN_EQUALSpring中文文档

LessThanEqual,IsLessThanEqualSpring中文文档

LIKESpring中文文档

Like,IsLikeSpring中文文档

NEARSpring中文文档

Near,IsNearSpring中文文档

NOTSpring中文文档

Not,IsNotSpring中文文档

NOT_INSpring中文文档

NotIn,IsNotInSpring中文文档

NOT_LIKESpring中文文档

NotLike,IsNotLikeSpring中文文档

REGEXSpring中文文档

Regex, ,MatchesRegexMatchesSpring中文文档

STARTING_WITHSpring中文文档

StartingWith, ,IsStartingWithStartsWithSpring中文文档

TRUESpring中文文档

True,IsTrueSpring中文文档

WITHINSpring中文文档

Within,IsWithinSpring中文文档

表 3.查询谓词修饰符关键字
关键词 描述

IgnoreCase,IgnoringCaseSpring中文文档

与谓词关键字一起使用,进行不区分大小写的比较。Spring中文文档

AllIgnoreCase,AllIgnoringCaseSpring中文文档

忽略所有合适属性的大小写。在查询方法谓词中的某处使用。Spring中文文档

OrderBy…Spring中文文档

指定静态排序顺序,后跟属性路径和方向(例如)。OrderByFirstnameAscLastnameDescSpring中文文档