ExampleMatcher matcher = ExampleMatcher.matching()
.withMatcher("firstname", endsWith())
.withMatcher("lastname", startsWith().ignoreCase());
}
Matching | Logical result |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 起始日期
if (startTime != null) {
predicate.getExpressions()
.add(cb.greaterThanOrEqualTo(root.get("lastLogin").as(Date.class), startTime));
}
// 结束日期
if (endTime != null) {
predicate.getExpressions().add(cb.lessThanOrEqualTo(root.get("lastLogin").as(Date.class), endTime));
}