Package com.bookstore.service.representation

Examples of com.bookstore.service.representation.CustomerRepresentation


  public List<CustomerRepresentation> getCustomers() {
    List<CustomerRepresentation> customerRepresentations = new ArrayList<CustomerRepresentation>();
   
    for (Customer customer : customerDao.getCustomers()) {
      // Create a representation of the Book.
      CustomerRepresentation custRep = new CustomerRepresentation();
      custRep.setId(customer.getId());
      custRep.setFirstName(customer.getFirstName());
      custRep.setLastName(customer.getLastName());
      custRep.setAddresses(customer.getAddresses());
      custRep.setCreditCards(customer.getCreditCards());
      custRep.setBooks(customer.getBooks());
     
      // Add it to the list of Book representations.
      customerRepresentations.add(custRep);
    }
   
View Full Code Here


   * @return
   */
  public CustomerRepresentation getCustomer(String id) {
    Customer customer = customerDao.getCustomer(id);
   
    CustomerRepresentation custRep = new CustomerRepresentation();
    custRep.setId(customer.getId());
    custRep.setFirstName(customer.getFirstName());
    custRep.setLastName(customer.getLastName());
    custRep.setAddresses(customer.getAddresses());
    custRep.setCreditCards(customer.getCreditCards());
    custRep.setBooks(customer.getBooks());
   
    return custRep;
  }
View Full Code Here

  public CustomerRepresentation createCustomer(String firstName, String lastName,
                         List<Address> addresses, List<CreditCard> creditCards,
                         List<Book> books) {
    Customer customer = customerDao.addCustomer(firstName, lastName, addresses, creditCards, books);
   
    CustomerRepresentation custRep = new CustomerRepresentation();
    custRep.setId(customer.getId());
    custRep.setFirstName(customer.getFirstName());
    custRep.setLastName(customer.getLastName());
    custRep.setAddresses(customer.getAddresses());
    custRep.setCreditCards(customer.getCreditCards());
    custRep.setBooks(customer.getBooks());
   
    return custRep;
  }
View Full Code Here

TOP

Related Classes of com.bookstore.service.representation.CustomerRepresentation

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.