官网文档:https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#query-by-example.usage

 

Person person = new Person();                          
person.setFirstname("Dave");                           

ExampleMatcher matcher = ExampleMatcher.matching()     
  .withIgnorePaths("lastname")                         
  .withIncludeNullValues()                             
  .withStringMatcherEnding();                          

Example<Person> example = Example.of(person, matcher)

 

 

Example 103. Configuring matcher options

Example 103. Configuring matcher options
ExampleMatcher matcher = ExampleMatcher.matching()
  .withMatcher("firstname", endsWith())
  .withMatcher("lastname", startsWith().ignoreCase());
}

 

Example 104. Configuring matcher options with lambdas

ExampleMatcher matcher = ExampleMatcher.matching()
  .withMatcher("firstname", match -> match.endsWith())
  .withMatcher("firstname", match -> match.startsWith());
}

 

相关文章:

  • 2022-12-23
  • 2021-06-18
  • 2021-07-13
  • 2021-12-08
  • 2021-04-22
  • 2022-01-06
  • 2021-12-23
  • 2022-02-02
猜你喜欢
  • 2021-06-19
  • 2022-12-23
  • 2021-04-25
  • 2022-12-23
  • 2021-10-26
  • 2022-12-23
相关资源
相似解决方案