Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation is lacking for implied equals on Query by Method Name #625

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@
* in the same order specified.
* Most conditions, such as {@code Like} or {@code LessThan},
* correspond to a single method parameter. The exception to this rule is
* {@code Between}, which corresponds to two method parameters.</p>
* {@code Between}, which corresponds to two method parameters.
* Multiple conditions are delimited by the keywords {@code And}
* and {@code Or}. The equality condition is implied when no
* condition operator keyword is present.</p>
*
* <p>Key-value and Wide-Column databases raise {@link UnsupportedOperationException}
* for queries on attributes other than the identifier/key.</p>
Expand Down
4 changes: 2 additions & 2 deletions spec/src/main/asciidoc/repository.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ The parsing of query method names follows a specific format:

- The method name consists of the subject, the predicate, and optionally the order clause.
- The subject begins with the action (such as `find` or `delete`) and is optionally followed by an expression (for example, `First10`), followed by any number of other characters, followed by `By`.
- The predicate defines the query's condition or filtering criteria, where multiple conditions are delimited by `And` or `Or`. For example, `PriceLessThanAndNameLike`.
- The predicate defines the query's condition or filtering criteria, where multiple conditions are delimited by `And` or `Or`. For example, `PriceLessThanAndNameLike`. Each condition consists of a property name, optionally followed by `IgnoreCase` (for text properties), optionally followed by `Not`, optionally followed by an operator such as `LessThan` or `Like`. Absence of the operator implies the equality condition.
- The order clause, which is optional, begins with `OrderBy` and is followed by one or more ordered pairings consisting of entity attribute name and direction of sorting (`Asc` or `Desc`). The direction can be omitted on the final property, in which case `Asc` is implied. Ordering of results is performed by sorting the first entity attribute according to its respective direction, where results that sort to the same position are subsequently sorted by the second entity attribute according to its respective direction, and so forth.
- The method name is formed by combining the subject, predicate, and order clause, in that order.

Expand Down Expand Up @@ -333,7 +333,7 @@ Explanation of the BNF elements:
- `<ignored-text>`: Optional text that does not contain "By".
- `<predicate>`: Represents the query's condition or filtering criteria, which can include multiple conditions separated by "And" or "Or."
- `<condition>`: Specifies a property and an operator for the condition.
- `<operator>`: Defines the operator for the condition, like "Between" or "LessThan."
- `<operator>`: Defines the operator for the condition, like "Between" or "LessThan." When absent, equality is implied.
- `<property>`: Represents a property name, which can include underscores for nested properties.
- `<identifier>`: Represents a word (e.g., property names, action names, etc.).
- `<positive-integer>`: Represents a whole number greater than zero.
Expand Down