Package org.springframework.data.querydsl

Examples of org.springframework.data.querydsl.QPageRequest


  public void findBySpecificationWithSortByQueryDslOrderSpecifierWithQPageRequestAndQSort() {

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(),
        new QPageRequest(0, 10, new QSort(user.firstname.asc())));

    assertThat(page.getContent(), hasSize(3));
    assertThat(page.getContent(), hasItems(carter, dave, oliver));
    assertThat(page.getContent().get(0), is(carter));
    assertThat(page.getContent().get(1), is(dave));
View Full Code Here


  @Test
  public void findBySpecificationWithSortByQueryDslOrderSpecifierWithQPageRequest() {

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(), new QPageRequest(0, 10, user.firstname.asc()));

    assertThat(page.getContent(), hasSize(3));
    assertThat(page.getContent(), hasItems(carter, dave, oliver));
    assertThat(page.getContent().get(0), is(carter));
    assertThat(page.getContent().get(1), is(dave));
View Full Code Here

    dave.setManager(carter);

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(),
        new QPageRequest(0, 10, user.manager.firstname.asc()));

    assertThat(page.getContent(), hasSize(3));
    assertThat(page.getContent(), hasItems(carter, dave, oliver));
    assertThat(page.getContent().get(0), is(carter));
    assertThat(page.getContent().get(1), is(dave));
View Full Code Here

TOP

Related Classes of org.springframework.data.querydsl.QPageRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.