Skip to content

Commit e15c834

Browse files
committed
Refine Query by Example string matching to call out store-specific limitations.
Closes #3058
1 parent e32b266 commit e15c834

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/main/antora/modules/ROOT/pages/query-by-example.adoc

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ Query by Example (QBE) is a user-friendly querying technique with a simple inter
1010
It allows dynamic query creation and does not require you to write queries that contain field names.
1111
In fact, Query by Example does not require you to write queries by using store-specific query languages at all.
1212

13+
NOTE: This chapter explains the core concepts of Query by Example.
14+
The information is pulled from the Spring Data Commons module.
15+
Depending on your database, String matching support can be limited.
16+
1317
[[query-by-example.usage]]
1418
== Usage
1519

@@ -21,18 +25,20 @@ It can be reused across multiple Examples.
2125
* `Example`: An `Example` consists of the probe and the `ExampleMatcher`.
2226
It is used to create the query.
2327
* `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.
28+
Using the fluent API lets you specify ordering projection and result processing for your query.
2529

2630
Query by Example is well suited for several use cases:
2731

2832
* Querying your data store with a set of static or dynamic constraints.
2933
* Frequent refactoring of the domain objects without worrying about breaking existing queries.
30-
* Working independently from the underlying data store API.
34+
* Working independently of the underlying data store API.
3135

3236
Query by Example also has several limitations:
3337

3438
* No support for nested or grouped property constraints, such as `firstname = ?0 or (firstname = ?1 and lastname = ?2)`.
35-
* Only supports starts/contains/ends/regex matching for strings and exact matching for other property types.
39+
* Store-specific support on string matching.
40+
Depending on your databases, String matching can support starts/contains/ends/regex for strings.
41+
* Exact matching for other property types.
3642

3743
Before getting started with Query by Example, you need to have a domain object.
3844
To get started, create an interface for your repository, as shown in the following example:

0 commit comments

Comments
 (0)