Skip to content

Commit

Permalink
for @njr-11
Browse files Browse the repository at this point in the history
- bring Contains back to life (but only from Strings)
- add Empty to reserved words
  • Loading branch information
gavinking committed Mar 16, 2024
1 parent 43c8875 commit 7805071
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 16 deletions.
38 changes: 23 additions & 15 deletions api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,32 +289,39 @@
* <td>{@code findByAgeBetween(minAge, maxAge)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code EndsWith}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code Contains}</td>
* <td>strings</td>
* <td>Requires that a substring of the entity's attribute value
* matches the parameter value, which can be a pattern.</td>
* <td>{@code findByNameContains(middleName)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top"><td>{@code EndsWith}</td>
* <td>strings</td>
* <td>Requires that the characters at the end of the entity's attribute value
* match the parameter value, which can be a pattern.</td>
* <td>{@code findByNameEndsWith(surname)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top"><td>{@code False}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code False}</td>
* <td>boolean</td>
* <td>Requires that the entity's attribute value has a boolean value of false.</td>
* <td>{@code findByCanceledFalse()}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code GreaterThan}</td>
* <tr style="vertical-align: top"><td>{@code GreaterThan}</td>
* <td>numeric, strings, time</td>
* <td>Requires that the entity's attribute value be larger than the parameter value.</td>
* <td>{@code findByStartTimeGreaterThan(startedAfter)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top"><td>{@code GreaterThanEqual}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code GreaterThanEqual}</td>
* <td>numeric, strings, time</td>
* <td>Requires that the entity's attribute value be at least as big as the parameter value.</td>
* <td>{@code findByAgeGreaterThanEqual(minimumAge)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code IgnoreCase}</td>
* <tr style="vertical-align: "><td>{@code IgnoreCase}</td>
* <td>strings</td>
* <td>Requires case insensitive comparison. For query conditions
* as well as ordering, the {@code IgnoreCase} keyword can be
Expand All @@ -323,58 +330,58 @@
* <br>{@code findByZipcodeOrderByStreetIgnoreCaseAscHouseNumAsc(55904)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top"><td>{@code In}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code In}</td>
* <td>all attribute types</td>
* <td>Requires that the entity's attribute value be within the list that is the parameter value.</td>
* <td>{@code findByNameIn(names)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code LessThan}</td>
* <tr style="vertical-align: top"><td>{@code LessThan}</td>
* <td>numeric, strings, time</td>
* <td>Requires that the entity's attribute value be less than the parameter value.</td>
* <td>{@code findByStartTimeLessThan(startedBefore)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top"><td>{@code LessThanEqual}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code LessThanEqual}</td>
* <td>numeric, strings, time</td>
* <td>Requires that the entity's attribute value be at least as small as the parameter value.</td>
* <td>{@code findByAgeLessThanEqual(maximumAge)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code Like}</td>
* <tr style="vertical-align: top"><td>{@code Like}</td>
* <td>strings</td>
* <td>Requires that the entity's attribute value match the parameter value, which can be a pattern.</td>
* <td>{@code findByNameLike(namePattern)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top"><td>{@code Not}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code Not}</td>
* <td>condition</td>
* <td>Negates a condition.</td>
* <td>{@code deleteByNameNotLike(namePattern)}
* <br>{@code findByStatusNot("RUNNING")}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code Null}</td>
* <tr style="vertical-align: top"><td>{@code Null}</td>
* <td>nullable types</td>
* <td>Requires that the entity's attribute has a null value.</td>
* <td>{@code findByEndTimeNull()}
* <br>{@code findByAgeNotNull()}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top"><td>{@code Or}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code Or}</td>
* <td>conditions</td>
* <td>Requires at least one of the two conditions to be satisfied in order to match an entity.</td>
* <td>{@code findByPriceLessThanEqualOrDiscountGreaterThanEqual(maxPrice, minDiscount)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column</td></tr>
*
* <tr style="vertical-align: top; background-color:#eee"><td>{@code StartsWith}</td>
* <tr style="vertical-align: top"><td>{@code StartsWith}</td>
* <td>strings</td>
* <td>Requires that the characters at the beginning of the entity's attribute value
* match the parameter value, which can be a pattern.</td>
* <td>{@code findByNameStartsWith(firstTwoLetters)}</td>
* <td style="font-family:sans-serif; font-size:0.8em">Key-value<br>Wide-Column<br>Document<br>Graph</td></tr>
*
* <tr style="vertical-align: top"><td>{@code True}</td>
* <tr style="vertical-align: top; background-color:#eee"><td>{@code True}</td>
* <td>boolean</td>
* <td>Requires that the entity's attribute value has a boolean value of true.</td>
* <td>{@code findByAvailableTrue()}</td>
Expand Down Expand Up @@ -442,7 +449,8 @@
* future releases without introducing breaking changes to applications.
* </p>
* <p>
* Reserved for query conditions: {@code AbsoluteValue}, {@code CharCount}, {@code ElementCount},
* Reserved for query conditions: {@code AbsoluteValue}, {@code CharCount},
* {@code ElementCount}, {@code Empty}
* {@code Rounded}, {@code RoundedDown}, {@code RoundedUp}, {@code Trimmed},
* {@code WithDay}, {@code WithHour}, {@code WithMinute}, {@code WithMonth},
* {@code WithQuarter}, {@code WithSecond}, {@code WithWeek}, {@code WithYear}.
Expand Down
7 changes: 6 additions & 1 deletion spec/src/main/asciidoc/repository.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ Query methods allow developers to create database queries using method naming co
<find-expression> ::= "First" [<positive-integer>]
<predicate> ::= <condition> { ("And" | "Or") <condition> }
<condition> ::= <property> ["IgnoreCase"] ["Not"] [<operator>]
<operator> ::= "EndsWith" | "StartsWith" | "LessThan"| "LessThanEqual" | "GreaterThan" | "GreaterThanEqual" | "Between" | "Like" | "In" | "Null" | "True" | "False"
<operator> ::= "Contains" | "EndsWith" | "StartsWith" | "LessThan"| "LessThanEqual" | "GreaterThan" | "GreaterThanEqual" | "Between" | "Like" | "In" | "Null" | "True" | "False"
<property> ::= <identifier> | <identifier> "_" <property>
<identifier> ::= <word>
<positive-integer> ::= <digit> { <digit> }
Expand Down Expand Up @@ -1012,6 +1012,11 @@ Jakarta Data implementations must support the following list of Query by Method
|findByDateBetween
|Key-value, Wide-Column

|Contains
|Matches String values with the given substring, which can be a pattern.
|findByProductNameContains
|Key-value, Wide-Column, Document, Graph

|EndsWith
|Matches String values with the given ending, which can be a pattern.
|findByProductNameEndsWith
Expand Down

0 comments on commit 7805071

Please sign in to comment.