Java 类org.springframework.data.domain.ExampleMatcher.StringMatcher 实例源码

项目:spring-data-examples    文件:UserRepositoryIntegrationTests.java   
/**
 * @see #153
 */
@Test
public void substringMatching() {

    Example<User> example = Example.of(new User("er", null, null), matching().//
            withStringMatcher(StringMatcher.ENDING));

    assertThat(repository.findAll(example), hasItems(skyler, walter));
}
项目:spring-data-examples    文件:UserRepositoryIntegrationTests.java   
/**
 * @see #153
 */
@Test
public void substringMatching() {

    Example<Person> example = Example.of(new Person("er", null, null), matching().//
            withStringMatcher(StringMatcher.ENDING));

    assertThat(repository.findAll(example), hasItems(skyler, walter));
}
项目:spring-data-examples    文件:MongoOperationsIntegrationTests.java   
/**
 * @see #153
 */
@Test
public void substringMatching() {

    Example<Person> example = Example.of(new Person("er", null, null), matching().//
            withStringMatcher(StringMatcher.ENDING));

    assertThat(operations.find(query(byExample(example)), Person.class), hasItems(skyler, walter));
}
项目:spring-data-examples    文件:ContactRepositoryIntegrationTests.java   
/**
 * @see #153
 */
@Test
public void findAllPersonsBySimpleExample() {

    Example<Person> example = Example.of(new Person(".*", null, null), //
            matching().withStringMatcher(StringMatcher.REGEX));

    assertThat(userRepository.findAll(example), containsInAnyOrder(skyler, walter, flynn));
    assertThat(userRepository.findAll(example), not(containsInAnyOrder(hank, marie)));
}
项目:spring-data-examples    文件:ContactRepositoryIntegrationTests.java   
/**
 * @see #153
 */
@Test
public void findAllRelativesBySimpleExample() {

    Example<Relative> example = Example.of(new Relative(".*", null, null), //
            matching().withStringMatcher(StringMatcher.REGEX));

    assertThat(contactRepository.findAll(example), containsInAnyOrder(hank, marie));
    assertThat(contactRepository.findAll(example), not(containsInAnyOrder(skyler, walter, flynn)));
}
项目:whats-new-in-spring-data    文件:UserRepositoryIntegrationTests.java   
@Test
public void substringMatching() {

    Example<User> example = Example.of(new User("er", null, null), matching().//
            withStringMatcher(StringMatcher.ENDING));

    assertThat(repository.findAll(example), hasItems(skyler, walter));
}
项目:whats-new-in-spring-data    文件:UserRepositoryIntegrationTests.java   
@Test
public void substringMatching() {

    Example<Person> example = Example.of(new Person("er", null, null), matching().//
            withStringMatcher(StringMatcher.ENDING));

    assertThat(repository.findAll(example), hasItems(skyler, walter));
}
项目:springentityprovider    文件:SpringEntityProvider.java   
/**
 * create an example filter with the default matcher (ignore case and match strings with CONTAINING)
 *
 * @param probe Probe to filter by
 */
public ExampleFilter(T probe) {
    this(probe, ExampleMatcher.matching().withIgnoreCase().withStringMatcher(StringMatcher.CONTAINING));
}