1. Supported query method subject keywords
find…By read…By get…By query…By search…By stream…By |
General query method - can be used in combination with additional keywords Return type: the repository type - Collection, Streamable subtype, result wrapper (Page, GeoResults, store-specific) |
exists…By | Exists projection Return type: boolean |
count…By | Count projection Return type: boolean |
delete…By remove…By |
Delete query method Return type: void or delete count |
…First<numbe>… …Top<number>… |
Limit the query results to the first <number> of results. - can occur in any place of the subject (between find and by) |
…Distinct… | Use a distinct query to return only unique results. - Consult the store-specific documentation whether that feature is supported - can occur in any place of the subject (between find and by) |
2. Supported query method predicate keywords and modifiers
AND | And |
OR | Or |
AFTER | After, IsAfter |
BEFORE | Before, IsBefore |
CONTAINING | Containing, IsContaining, Contains |
BETWEEN | Between, IsBetween |
ENDING_WITH | EndingWith, IsEndingWith, EndsWith |
EXISTS | Exists |
FALSE | False, IsFalse |
GREATER_THAN | GreaterThan, IsGreaterThan |
GREATER_THAN_EQUALS | GreaterThanEqual, IsGreaterThanEqual |
IN | In, IsIn |
IS | Is, Equals, (or no keyword) |
IS_EMPTY | IsEmpty, Empty |
IS_NOT_EMPTY | IsNotEmpty, NotEmpty |
IS_NOT_NULL | NotNull, IsNotNull |
IS_NULL | Null, IsNull |
LESS_THAN | LessThan, IsLessThan |
LESS_THAN_EQUAL | LessThanEqual, IsLessThanEqual |
LIKE | Like, IsLike |
NEAR | Near, IsNear |
NOT | Not, IsNot |
NOT_IN | NotIn, IsNotIn |
NOT_LIKE | NotLike, IsNotLike |
REGEX | Regex, MatchesRegex, Matches |
STARTING_WITH | StartingWith, IsStartingWith, StartsWith |
TRUE | True, IsTrue |
WITHIN | Within, IsWithin |
출처
'Spring > Spring Data JPA' 카테고리의 다른 글
[Spring Data JPA] 3-1. Defining Query Methods (1) (0) | 2024.08.02 |
---|---|
[Spring Data JPA] 3-8. Repository query return types (0) | 2024.08.02 |
[자바 ORM 표준 JPA 프로그래밍] 8. 프록시와 연관관계 관리 (0) | 2023.12.28 |
[자바 ORM 표준 JPA 프로그래밍] 7. 고급 매핑 (1) | 2023.12.28 |
[자바 ORM 표준 JPA 프로그래밍] 6. 다양한 연관관계 매핑 (0) | 2023.12.27 |