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

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


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

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

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

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


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

   * @DATAJPA-500
   */
  @Test
  public void sortByNestedEmbeddedAttribite() {

    carter.setAddress(new Address("U", "Z", "Y", "41"));
    dave.setAddress(new Address("U", "A", "Y", "41"));
    oliver.setAddress(new Address("G", "D", "X", "42"));

    List<User> users = repository.findAll(QUser.user.id.goe(0), QUser.user.address.streetName.asc());

    assertThat(users, hasSize(3));
    assertThat(users, hasItems(dave, oliver, carter));
View Full Code Here

TOP

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

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.