Package com.restfully.shop.domain

Examples of com.restfully.shop.domain.LineItem


         throw new RuntimeException("Failed to find an iPhone in the database!");
      }

      System.out.println();
      System.out.println("** Create Order for iPhone");
      LineItem item = new LineItem();
      item.setProduct(product);
      item.setQuantity(1);
      Order order = new Order();
      order.setTotal(product.getCost());
      order.setCustomer(customer);
      order.setDate(new Date().toString());
      order.getLineItems().add(item);
View Full Code Here


         throw new RuntimeException("Failed to find an iPhone in the database!");
      }

      System.out.println();
      System.out.println("** Create Order for iPhone");
      LineItem item = new LineItem();
      item.setProduct(product);
      item.setQuantity(1);
      Order order = new Order();
      order.setTotal(product.getCost());
      order.setCustomer(customer);
      order.setDate(new Date().toString());
      order.getLineItems().add(item);
View Full Code Here

      Order order = new Order();
      order.setTotal("$199.99");
      order.setCustomer(customer);
      order.setDate(new Date().toString());
      LineItem item = new LineItem();
      item.setCost("$199.99");
      item.setProduct("iPhone");
      order.setLineItems(new ArrayList<LineItem>());
      order.getLineItems().add(item);

      System.out.println();
      System.out.println("** Create an order through this URL: " + orders.getHref());
View Full Code Here

        Order order = new Order();
        order.setTotal("$199.99");
        order.setCustomer(customer);
        order.setDate(new Date().toString());
        LineItem item = new LineItem();
        item.setCost("$199.99");
        item.setProduct("iPhone");
        order.setLineItems(new ArrayList<LineItem>());
        order.getLineItems().add(item);

        System.out.println();
        System.out.println("** Create an order through this URL: " + orders.getHref());
View Full Code Here

            throw new RuntimeException("Failed to find an iPhone in the database!");
        }

        System.out.println();
        System.out.println("** Create Order for iPhone");
        LineItem item = new LineItem();
        item.setProduct(product);
        item.setQuantity(1);
        Order order = new Order();
        order.setTotal(product.getCost());
        order.setCustomer(customer);
        order.setDate(new Date().toString());
        order.getLineItems().add(item);
View Full Code Here

      CustomerEntity customerEntity = entity.getCustomer();
      Customer customer = CustomerResourceBean.entity2domain(customerEntity);
      order.setCustomer(customer);
      for (LineItemEntity item : entity.getLineItems())
      {
         LineItem lineItem = entity2domain(item);
         order.getLineItems().add(lineItem);
      }
      return order;
   }
View Full Code Here

      return order;
   }

   public static LineItem entity2domain(LineItemEntity entity)
   {
      LineItem item = new LineItem();
      item.setId(entity.getId());
      Product product = ProductResourceBean.entity2domain(entity.getProduct());
      item.setProduct(product);
      item.setQuantity(entity.getQuantity());
      return item;
   }
View Full Code Here

      CustomerEntity customerEntity = entity.getCustomer();
      Customer customer = CustomerResourceBean.entity2domain(customerEntity);
      order.setCustomer(customer);
      for (LineItemEntity item : entity.getLineItems())
      {
         LineItem lineItem = entity2domain(item);
         order.getLineItems().add(lineItem);
      }
      return order;
   }
View Full Code Here

      return order;
   }

   public static LineItem entity2domain(LineItemEntity entity)
   {
      LineItem item = new LineItem();
      item.setId(entity.getId());
      Product product = ProductResourceBean.entity2domain(entity.getProduct());
      item.setProduct(product);
      item.setQuantity(entity.getQuantity());
      return item;
   }
View Full Code Here

            throw new RuntimeException("Failed to find an iPhone in the database!");
        }

        System.out.println();
        System.out.println("** Create Order for iPhone");
        LineItem item = new LineItem();
        item.setProduct(product);
        item.setQuantity(1);
        Order order = new Order();
        order.setTotal(product.getCost());
        order.setCustomer(customer);
        order.setDate(new Date().toString());
        order.getLineItems().add(item);
View Full Code Here

TOP

Related Classes of com.restfully.shop.domain.LineItem

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.