I have domain object Person with date fields:
public class Person {
@Id
private Long id;
private Date date
Build example like this:
The Spring Data JPA query-by-example technique uses Example
s and ExampleMatcher
s to convert entity instances into the underlying query. The current official documentation clarifies that only exact matching is available for non-string attributes. Since your requirement involves a java.util.Date
field, you can only have exact matching with the query-by-example technique.
You could write your own ExampleMatcher
that returns query clauses according to your needs.