Package org.springframework.data.jpa.domain.sample

Examples of org.springframework.data.jpa.domain.sample.QUser


  public void findBySpecificationWithSortByPluralAssociationPropertyInPageableShouldUseSortNullValuesLast() {

    oliver.getColleagues().add(dave);
    dave.getColleagues().add(oliver);

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(), new PageRequest(0, 10, new Sort(
        Sort.Direction.ASC, "colleagues.firstname")));

    assertThat(page.getContent(), hasSize(3));
View Full Code Here


  public void findBySpecificationWithSortBySingularAssociationPropertyInPageableShouldUseSortNullValuesLast() {

    oliver.setManager(dave);
    dave.setManager(carter);

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(), new PageRequest(0, 10, new Sort(
        Sort.Direction.ASC, "manager.firstname")));

    assertThat(page.getContent(), hasSize(3));
View Full Code Here

   * @see DATAJPA-427
   */
  @Test
  public void findBySpecificationWithSortBySingularPropertyInPageableShouldUseSortNullValuesFirst() {

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(), new PageRequest(0, 10, new Sort(
        Sort.Direction.ASC, "firstname")));

    assertThat(page.getContent(), hasSize(3));
View Full Code Here

   * @see DATAJPA-427
   */
  @Test
  public void findBySpecificationWithSortByOrderIgnoreCaseBySingularPropertyInPageableShouldUseSortNullValuesFirst() {

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(), new PageRequest(0, 10, new Sort(new Order(
        Sort.Direction.ASC, "firstname").ignoreCase())));

    assertThat(page.getContent(), hasSize(3));
View Full Code Here

  @Test
  public void findBySpecificationWithSortByNestedEmbeddedPropertyInPageableShouldUseSortNullValuesFirst() {

    oliver.setAddress(new Address("Germany", "Saarbrücken", "HaveItYourWay", "123"));

    QUser user = QUser.user;

    Page<User> page = repository.findAll(user.firstname.isNotNull(), new PageRequest(0, 10, new Sort(
        Sort.Direction.ASC, "address.streetName")));

    assertThat(page.getContent(), hasSize(3));
View Full Code Here

   * @see DATAJPA-12
   */
  @Test
  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));
View Full Code Here

   * @see DATAJPA-12
   */
  @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));
View Full Code Here

  public void findBySpecificationWithSortByQueryDslOrderSpecifierForAssociationShouldGenerateLeftJoinWithQPageRequest() {

    oliver.setManager(dave);
    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));
View Full Code Here

TOP

Related Classes of org.springframework.data.jpa.domain.sample.QUser

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.