这些关键字允许开发人员指定要返回的结果的页码、要跳过的结果数以及要返回的结果数。通过使用这些关键字,开发人员可以轻松地创建分页查询,而无需手动指定分页参数。
Repository query keywords
Supported query method subject keywords
下表列出了 Spring Data 存储库查询派生机制通常支持的主体关键字,以表示谓词。有关受支持关键字的确切列表,请查阅特定存储区的文档,因为此处列出的某些关键字可能在特定存储区中不受支持。
The following table lists the subject keywords generally supported by the Spring Data repository query derivation mechanism to express the predicate. Consult the store-specific documentation for the exact list of supported keywords, because some keywords listed here might not be supported in a particular store.
Keyword | Description |
---|---|
|
General query method returning typically the repository type, a |
|
Exists projection, returning typically a |
|
Count projection returning a numeric result. |
|
Delete query method returning either no result ( |
|
Limit the query results to the first |
|
Use a distinct query to return only unique results. Consult the store-specific documentation whether that feature is supported. This keyword can occur in any place of the subject between |
Supported query method predicate keywords and modifiers
下表列出了 Spring Data 存储库查询派生机制通常支持的谓词关键字。但是,有关受支持关键字的确切列表,请查阅特定存储区的文档,因为此处列出的某些关键字可能在特定存储区中不受支持。
The following table lists the predicate keywords generally supported by the Spring Data repository query derivation mechanism. However, consult the store-specific documentation for the exact list of supported keywords, because some keywords listed here might not be supported in a particular store.
Logical keyword | Keyword expressions |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
除了过滤器谓词之外,还支持以下修改器列表:
In addition to filter predicates, the following list of modifiers is supported:
Keyword | Description |
---|---|
|
Used with a predicate keyword for case-insensitive comparison. |
|
Ignore case for all suitable properties. Used somewhere in the query method predicate. |
|
Specify a static sorting order followed by the property path and direction (e. g. |