public static UntypedExampleMatcher matching() { return new UntypedExampleMatcher(ExampleMatcher.matching()); }
public static UntypedExampleMatcher matching() { return new UntypedExampleMatcher(ExampleMatcher.matching()); }
/** * Create a new {@link Example} including all non-null properties by default. * * @param probe must not be {@literal null}. * @return */ static <T> Example<T> of(T probe) { return new TypedExample<>(probe, ExampleMatcher.matching()); }
/** * Generates a list of {@link Interceptor} from a request. * * @param interceptorDTO The {@link InterceptorDTO} * @return The List<{@link Interceptor}> list */ @Transactional(readOnly = true) public List<Interceptor> list(InterceptorDTO interceptorDTO) { Interceptor interceptor = GenericConverter.mapper(interceptorDTO, Interceptor.class); Example<Interceptor> example = Example.of(interceptor, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); return interceptorRepository.findAll(example); }
/** * Creates a list of {@link Role} from a request. * * @param roleDTO {@link RoleDTO} * @return {@link List} of {@link Role} */ @Transactional(readOnly = false) public List<Role> list(RoleDTO roleDTO) { Role role = GenericConverter.mapper(roleDTO, Role.class); Example<Role> example = Example.of(role, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<Role> roles = roleRepository.findAll(example); return roles; }
/** * Creates a list of {@link User} from a request. * * @param userDTO {@link UserDTO} * @return {@link List} of {@link User} */ @Transactional(readOnly = false) public List<User> list(UserDTO userDTO) { User user = GenericConverter.mapper(userDTO, User.class); Example<User> example = Example.of(user, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<User> users = userRepository.findAll(example); return users; }
/** * Generates a list of {@link Plan} from a request. * * @param planDTO The {@link PlanDTO} * @return The List of {@link Plan} */ @Transactional(readOnly = true) public List<Plan> list(PlanDTO planDTO) { Plan plan = GenericConverter.mapper(planDTO, Plan.class); Example<Plan> example = Example.of(plan, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<Plan> plans = planRepository.findAll(example); return plans; }
/** * Returns a list of all {@link AccessToken} from a request * * @param accessTokenRequest {@link AccessTokenRequest} The request for {@link AccessToken} * @return The list of {@link AccessToken} */ @Transactional(readOnly = true) public List<AccessToken> list(AccessTokenRequest accessTokenRequest) { AccessToken accessToken = GenericConverter.mapper(accessTokenRequest, AccessToken.class); Example<AccessToken> example = Example.of(accessToken, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<AccessToken> accessTokens = accessTokenRepository.findAll(example); return accessTokens; }
/** * Generates a list of {@link App}. * * @param appDTO The {@link AppDTO} * @return The list of {@link App}'s */ @Transactional(readOnly = true) public List<App> list(AppRequestDTO appDTO) { App app = GenericConverter.mapper(appDTO, App.class); Example<App> example = Example.of(app, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<App> apps = appRepository.findAll(example); return apps; }
/** * Generates a list of the {@link Api}'s * * @param apiDTO {@link ApiDTO} * @return The list of {@link Api}'s */ public List<Api> list(ApiDTO apiDTO) { Api api = GenericConverter.mapper(apiDTO, Api.class); Example<Api> example = Example.of(api, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<Api> apis = apiRepository.findAll(example); return apis; }
/** * Generates a list of {@link Developer} from a request. * * @param developerDTO The {@link DeveloperDTO} * @return The list of {@link Developer} */ public List<Developer> list(DeveloperDTO developerDTO) { Developer developer = GenericConverter.mapper(developerDTO, Developer.class); Example<Developer> example = Example.of(developer, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<Developer> developers = developerRepository.findAll(example); return developers; }
/** * Generates a list of {@link Environment} from a request. * * @param environmentDTO The {@link EnvironmentDTO} * @return The List<{@link Environment}> */ public List<Environment> list(EnvironmentDTO environmentDTO) { Environment environment = GenericConverter.mapper(environmentDTO, Environment.class); Example<Environment> example = Example.of(environment, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); return environmentRepository.findAll(example); }
/** * Finds a {@link List} of {@link Privilege} associated with one Privilege provided. * * @param privilegeDTO {@link PrivilegeDTO} * @return {@link List} of {@link Privilege} */ public List<Privilege> list(PrivilegeDTO privilegeDTO) { Privilege privilege = GenericConverter.mapper(privilegeDTO, Privilege.class); Example<Privilege> example = Example.of(privilege, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); List<Privilege> privileges = repository.findAll(example); return privileges; }
@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)); }
/** * Generates a list of {@link Provider} from a request * * @param providerDTO The {@link ProviderDTO} * @return The list of {@link Provider} */ public List<Provider> listWithFilter(ProviderDTO providerDTO) { Provider provider = GenericConverter.mapper(providerDTO, Provider.class); Example<Provider> example = Example.of(provider, ExampleMatcher.matching().withIgnorePaths("providerDefault").withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING)); return this.providerRepository.findAll(example); }
@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<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)); }