public UntypedExampleMatcher withMatcher(String propertyPath, MatcherConfigurer<GenericPropertyMatcher> matcherConfigurer) { return new UntypedExampleMatcher(delegate.withMatcher(propertyPath, matcherConfigurer)); }
public UntypedExampleMatcher withMatcher(String propertyPath, GenericPropertyMatcher genericPropertyMatcher) { return new UntypedExampleMatcher(delegate.withMatcher(propertyPath, genericPropertyMatcher)); }
public UntypedExampleMatcher withMatcher(String propertyPath, GenericPropertyMatcher genericPropertyMatcher) { return new UntypedExampleMatcher(delegate.withMatcher(propertyPath, genericPropertyMatcher)); }
public UntypedExampleMatcher withMatcher(String propertyPath, MatcherConfigurer<GenericPropertyMatcher> matcherConfigurer) { return new UntypedExampleMatcher(delegate.withMatcher(propertyPath, matcherConfigurer)); }
/** * Returns a copy of this {@link ExampleMatcher} with the specified {@code GenericPropertyMatcher} for the * {@code propertyPath}. This instance is immutable and unaffected by this method call. * * @param propertyPath must not be {@literal null}. * @param matcherConfigurer callback to configure a {@link GenericPropertyMatcher}, must not be {@literal null}. * @return new instance of {@link ExampleMatcher}. */ default ExampleMatcher withMatcher(String propertyPath, MatcherConfigurer<GenericPropertyMatcher> matcherConfigurer) { Assert.hasText(propertyPath, "PropertyPath must not be empty!"); Assert.notNull(matcherConfigurer, "MatcherConfigurer must not be empty!"); GenericPropertyMatcher genericPropertyMatcher = new GenericPropertyMatcher(); matcherConfigurer.configureMatcher(genericPropertyMatcher); return withMatcher(propertyPath, genericPropertyMatcher); }
@Override public PageModel<User> findAll(User param, Pageable pageable) { ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("username", ExampleMatcher.GenericPropertyMatchers.contains()) .withMatcher("realName", ExampleMatcher.GenericPropertyMatchers.contains()) .withMatcher("email", ExampleMatcher.GenericPropertyMatchers.contains()) .withMatcher("mobile", ExampleMatcher.GenericPropertyMatchers.contains()); return new PageModel<>(baseDao.findAll(Example.of(param, matcher), pageable)); }
@Override public PageModel<Resource> findAll(Resource param, Pageable pageable) { ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("name", ExampleMatcher.GenericPropertyMatchers.contains()) .withMatcher("tag", ExampleMatcher.GenericPropertyMatchers.contains()) .withMatcher("path", ExampleMatcher.GenericPropertyMatchers.contains()); return new PageModel<>(baseDao.findAll(Example.of(param, matcher), pageable)); }
public List<Customer> findCustomersByName(String firstName, String lastName) { final Customer probe = new Customer(); probe.setFirstName(firstName); probe.setLastName(lastName); final ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("firstName", ignoreCase()) .withMatcher("lastName", ignoreCase()); final Example<Customer> example = Example.of(probe, matcher); return repository.findByExample(example); }
@Override public PageModel<Dept> findAll(Dept param, Pageable pageable) { ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("name" ,ExampleMatcher.GenericPropertyMatchers.contains()); return new PageModel<>(baseDao.findAll(Example.of(param, matcher), pageable)); }
@Override public PageModel<Menu> findAll(Menu param, Pageable pageable) { ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("name" ,ExampleMatcher.GenericPropertyMatchers.contains()); PageModel<Menu> page = new PageModel<>(baseDao.findAll(Example.of(param, matcher), pageable)); return page; }
@Override public PageModel<Role> findAll(Role param, Pageable pageable) { ExampleMatcher matcher = ExampleMatcher.matching() .withMatcher("name" ,ExampleMatcher.GenericPropertyMatchers.contains()); return new PageModel<>( baseDao.findAll(Example.of(param, matcher), pageable)); }