我正在尝试使用Spring JPA的示例来进行搜索.使用以下代码,大部分代码符合要求.
public Page<Shop> findShops(Shop condition, Pageable pageable) {
ExampleMatcher matcher = ExampleMatcher.matching().withStringMatcher(StringMatcher.CONTAINING).withIgnoreCase();
return shopDao.findAll(Example.of(condition, matcher), pageable);
}
Run Code Online (Sandbox Code Playgroud)
另外,我只需要状态NOT等于DELETED的SHOP.类似的东西,.withMatcher("status", notEqual())
或者可能 .withMatcher("status", contains())是列表.
我不确定示例匹配器是否以及如何做这样的事情.有人可以帮帮我吗?