Examples of BookPrime


Examples of org.dozer.vo.cumulative.BookPrime

    Book book = newInstance(Book.class, new Object[] {new Long(141L), author});
    libSrc.setBooks(Collections.singletonList(book));

    LibraryPrime libDest = newInstance(LibraryPrime.class);
    AuthorPrime authorPrime = newInstance(AuthorPrime.class, new Object[] {new Long(505L), "The Ultimate One", new Long(5100L)});
    BookPrime bookDest = newInstance(BookPrime.class, new Object[] {new Long(141L), authorPrime});
    List<BookPrime> bookDests = newInstance(ArrayList.class);
    bookDests.add(bookDest);
    libDest.setBooks(bookDests);

    mapper.map(libSrc, libDest);

    assertEquals(1, libDest.getBooks().size());
    BookPrime bookPrime = (BookPrime) libDest.getBooks().get(0);
    assertEquals(new Long(141L), bookPrime.getId());
    assertEquals("The Best One", bookPrime.getAuthor().getName());

    //    assertEquals(new Long(5100L), book.getAuthor().getSalary()); TODO Enable this for non-cumulative recursion bug
  }
View Full Code Here

Examples of org.dozer.vo.cumulative.BookPrime

    Book book = newInstance(Book.class, new Object[] {new Long(141L), author});
    libSrc.setBooks(Collections.singletonList(book));

    LibraryPrime libDest = newInstance(LibraryPrime.class);
    AuthorPrime authorPrime = newInstance(AuthorPrime.class, new Object[] {new Long(505L), "The Ultimate One", new Long(5100L)});
    BookPrime bookDest = newInstance(BookPrime.class, new Object[] {new Long(141L), authorPrime});
    List<BookPrime> bookDests = newInstance(ArrayList.class);
    bookDests.add(bookDest);
    libDest.setBooks(bookDests);

    mapper.map(libSrc, libDest);

    assertEquals(1, libDest.getBooks().size());
    BookPrime bookPrime = (BookPrime) libDest.getBooks().get(0);
    assertEquals(new Long(141L), bookPrime.getId());
    assertEquals("The Best One", bookPrime.getAuthor().getName());

    //    assertEquals(new Long(5100L), book.getAuthor().getSalary()); TODO Enable this for non-cumulative recursion bug
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.