Example usage for org.springframework.data.domain Example of

List of usage examples for org.springframework.data.domain Example of

Introduction

In this page you can find the example usage for org.springframework.data.domain Example of.

Prototype

static <T> Example<T> of(T probe) 

Source Link

Document

Create a new Example including all non-null properties by default.

Usage

From source file:com._4dconcept.springframework.data.marklogic.repository.support.RepositoryIntegrationTests.java

@Test
public void findPersonByExample() {
    Person person = new Person();
    person.setLastname("Toussaint");
    Iterable<Person> result = repository.findAll(Example.of(person));
    assertThat(result, notNullValue());//  ww  w . j  av  a  2s.c o m

    Person byAgeSample = new Person();
    byAgeSample.setAge(28);
    assertThat(repository.findAll(Example.of(byAgeSample)), hasSize(2));
}