Examples of BookRepresentation


Examples of com.bookstore.service.representation.BookRepresentation

  public List<BookRepresentation> getBooks() {
    List<BookRepresentation> bookRepresentations = new ArrayList<BookRepresentation>();
   
    for (Book book : bookDao.getBooks()) {
      // Create a representation of the Book.
      BookRepresentation bookRepresentation = new BookRepresentation();
      bookRepresentation.setId(book.getId());
      bookRepresentation.setISBN(book.getISBN());
      bookRepresentation.setTitle(book.getTitle());
      bookRepresentation.setAuthor(book.getAuthor());
      bookRepresentation.setPrice(book.getPrice());
     
      // Add it to the list of Book representations.
      bookRepresentations.add(bookRepresentation);
     
    }
View Full Code Here

Examples of com.bookstore.service.representation.BookRepresentation

   * @return
   */
  public BookRepresentation getBook(String id, String orderId) {
    Book book = bookDao.getBook(id);
   
    BookRepresentation bookRepresentation = new BookRepresentation();
    bookRepresentation.setId(book.getId());
    bookRepresentation.setISBN(book.getISBN());
    bookRepresentation.setTitle(book.getTitle());
    bookRepresentation.setAuthor(book.getAuthor());
    bookRepresentation.setPrice(book.getPrice());
   
    // Add the links
    setLinks(bookRepresentation, orderId);
   
    return bookRepresentation;
View Full Code Here

Examples of com.bookstore.service.representation.BookRepresentation

   * @return
   */
  public BookRepresentation createBook(String isbn, String title, String author, double price) {
    Book book = bookDao.addBook(isbn, title, author, price);
   
    BookRepresentation bookRepresentation = new BookRepresentation();
    bookRepresentation.setId(book.getId());
    bookRepresentation.setISBN(book.getISBN());
    bookRepresentation.setTitle(book.getTitle());
    bookRepresentation.setAuthor(book.getAuthor());
    bookRepresentation.setPrice(book.getPrice());
   
    return bookRepresentation;
  }
View Full Code Here

Examples of com.bookstore.service.representation.BookRepresentation

   
    for (Book book : bookDao.getBooks()) {
     
      if (book.getTitle().toLowerCase().contains(title.toLowerCase())) {
        // Create a representation of the Book.
        BookRepresentation bookRepresentation = new BookRepresentation();
        bookRepresentation.setId(book.getId());
        bookRepresentation.setISBN(book.getISBN());
        bookRepresentation.setTitle(book.getTitle());
        bookRepresentation.setAuthor(book.getAuthor());
        bookRepresentation.setPrice(book.getPrice());
       
        // Add it to the list of Book representations.
        bookRepresentations.add(bookRepresentation);
      }
    }
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.