You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/query-by-example.adoc
+9-9
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,8 @@ The Query by Example API consists of four parts:
20
20
It can be reused across multiple Examples.
21
21
* `Example`: An `Example` consists of the probe and the `ExampleMatcher`.
22
22
It is used to create the query.
23
-
* `FetchableFluentQuery`: A `FetchableFluentQuery` offers a fluent API, that allows further customization of a query derived from an `Example`.
24
-
Using the fluent API allows you to specify ordering, projection and result processing for your query.
23
+
* `FetchableFluentQuery`: A `FetchableFluentQuery` offers a fluent API, that allows further customization of a query derived from an `Example`.
24
+
Using the fluent API lets you to specify ordering projection and result processing for your query.
25
25
26
26
Query by Example is well suited for several use cases:
27
27
@@ -59,7 +59,7 @@ You can use it to create an `Example`.
59
59
By default, fields having `null` values are ignored, and strings are matched by using the store specific defaults.
60
60
61
61
NOTE: Inclusion of properties into a Query by Example criteria is based on nullability.
62
-
Properties using primitive types (`int`, `double`, …) are always included unless <<query-by-example.matchers,ignoring the property path>>.
62
+
Properties using primitive types (`int`, `double`, …) are always included unless the <<query-by-example.matchers, `ExampleMatcher` ignores the property path>>.
63
63
64
64
Examples can be built by either using the `of` factory method or by using <<query-by-example.matchers,`ExampleMatcher`>>. `Example` is immutable.
65
65
The following listing shows a simple Example:
@@ -196,13 +196,13 @@ The following table describes the scope of the various `ExampleMatcher` settings
196
196
== Fluent API
197
197
198
198
`QueryByExampleExecutor` offers one more method, which we did not mention so far: `<S extends T, R> R findBy(Example<S> example, Function<FluentQuery.FetchableFluentQuery<S>, R> queryFunction)`.
199
-
As with other methods it executes a query derived from an `Example`.
200
-
But with the second argument you can control aspects of that execution, that you can't control dynamically otherwise.
199
+
As with other methods, it executes a query derived from an `Example`.
200
+
However, with the second argument, you can control aspects of that execution that you cannot dynamically control otherwise.
201
201
You do so by invoking the various methods of the `FetchableFluentQuery` in the second argument.
202
-
`sortBy` allows you to specify an ordering for your result.
203
-
`as` allows you to specify the type to which you want the result to be transformed.
204
-
`project` limits the attributes queried.
205
-
`first`, `firstValue`, `one`, `oneValue`, `all`, `page`, `stream`, `count`, `exists` define what kind of result you'll get and also how the query behaves when more than the expected number of results are available.
202
+
`sortBy` lets you specify an ordering for your result.
203
+
`as` lets you specify the type to which you want the result to be transformed.
204
+
`project` limits the queried attributes.
205
+
`first`, `firstValue`, `one`, `oneValue`, `all`, `page`, `stream`, `count`, and `exists` define what kind of result you get and how the query behaves when more than the expected number of results are available.
206
206
207
207
208
208
.Use the fluent API to get the last of potentially many results, ordered by lastname.
0 commit comments