Search in sources :

Example 6 with MyUserPredicatesBuilder

use of org.baeldung.persistence.dao.MyUserPredicatesBuilder in project tutorials by eugenp.

the class JPAQuerydslIntegrationTest method givenLast_whenGettingListOfUsers_thenCorrect.

@Test
public void givenLast_whenGettingListOfUsers_thenCorrect() {
    final MyUserPredicatesBuilder builder = new MyUserPredicatesBuilder().with("lastName", ":", "doe");
    final Iterable<MyUser> results = repo.findAll(builder.build());
    assertThat(results, containsInAnyOrder(userJohn, userTom));
}
Also used : MyUser(org.baeldung.persistence.model.MyUser) MyUserPredicatesBuilder(org.baeldung.persistence.dao.MyUserPredicatesBuilder) Test(org.junit.Test)

Aggregations

MyUserPredicatesBuilder (org.baeldung.persistence.dao.MyUserPredicatesBuilder)6 MyUser (org.baeldung.persistence.model.MyUser)5 Test (org.junit.Test)5 BooleanExpression (com.querydsl.core.types.dsl.BooleanExpression)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1