Examples of Product


Examples of org.springframework.data.repository.sample.Product

   */
  @Test
  public void findOneShouldDelegateToAppropriateRepository() {

    Mockito.reset(productRepository);
    Product product = new Product();
    when(productRepository.findOne(4711L)).thenReturn(product);

    assertThat(factory.getInvokerFor(Product.class).invokeFindOne(4711L), is((Object) product));
  }
View Full Code Here

Examples of org.springframework.data.solr.example.model.Product

  @Test
  public void testCRUD() {
    Assert.assertEquals(0, repo.count());

    Product initial = createProduct(1);
    repo.save(initial);
    Assert.assertEquals(1, repo.count());

    Product loaded = repo.findOne(initial.getId());
    Assert.assertEquals(initial.getName(), loaded.getName());

    loaded.setName("changed named");
    repo.save(loaded);
    Assert.assertEquals(1, repo.count());

    loaded = repo.findOne(initial.getId());
    Assert.assertEquals("changed named", loaded.getName());

    repo.delete(loaded);
    Assert.assertEquals(0, repo.count());
  }
View Full Code Here

Examples of org.springframework.samples.jpetstore.domain.Product

    Map model = new HashMap();
    String productId = request.getParameter("productId");
    if (productId != null) {
      PagedListHolder itemList = new PagedListHolder(this.petStore.getItemListByProduct(productId));
      itemList.setPageSize(4);
      Product product = this.petStore.getProduct(productId);
      request.getSession().setAttribute("ViewProductAction_itemList", itemList);
      request.getSession().setAttribute("ViewProductAction_product", product);
      model.put("itemList", itemList);
      model.put("product", product);
    }
    else {
      PagedListHolder itemList = (PagedListHolder) request.getSession().getAttribute("ViewProductAction_itemList");
      Product product = (Product) request.getSession().getAttribute("ViewProductAction_product");
      String page = request.getParameter("page");
      if ("next".equals(page)) {
        itemList.nextPage();
      }
      else if ("previous".equals(page)) {
View Full Code Here

Examples of org.springframework.uaa.client.protobuf.UaaClient.Product

                }
                // Handle there being no version sequence
                if (versionSequence == null || "".equals(versionSequence)) {
                    versionSequence = "0.0.0.UNKNOWN";
                }
                final Product product = VersionHelper.getProduct(
                        productInfo.getProductName(), versionSequence);
                // Register the Spring Product with UAA
                uaaRegistrationService.registerProject(product,
                        topLevelPackage.getFullyQualifiedPackageName());
            }
View Full Code Here

Examples of org.thymeleaf.itutorial.beans.Product

    private static final String NO_WEBSITE = null;
   
    public static Product loadProduct() {
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            return new Product("Wooden wardrobe with glass doors", Integer.valueOf(850), sdf.parse("2013-02-18"));
        } catch (ParseException ex) {
            throw new RuntimeException("Invalid date");
        }
    }
View Full Code Here

Examples of pl.com.bottega.ecommerce.sales.domain.productscatalog.Product

 
  @Override
  public Void handle(AddProdctCommand command) {
    Reservation reservation = reservationRepository.load(command.getOrderId());
   
    Product product = productRepository.load(command.getProductId());
   
    if (! product.isAvailabe()){
      Client client = loadClient()
      product = suggestionService.suggestEquivalent(product, client);
    }
     
    reservation.add(product, command.getQuantity());
View Full Code Here

Examples of pojo.Product

 
  //get infor of a product
  public Product getInfoProduct(String idProduct) {
    logger.debug("getinfoProduct start");
    Product sp = null;
    Session session = HibernateUtil.getSessionFactory().openSession();
    try {
      sp = (Product) session.get(Product.class,
          Integer.parseInt(idProduct));
      logger.debug("getinfoProduct success");
View Full Code Here

Examples of sg.edu.nus.iss.se07.bc.Product

                                        int productQty = productSet.get(i).getItem4().getValue();
                                        float productPrice = productSet.get(i).getItem5().getValue();
                                        String productBarcode = productSet.get(i).getItem6().getValue();
                                        int productReorderQty = productSet.get(i).getItem7().getValue();
                                        int productOrderQty = productSet.get(i).getItem8().getValue();
                                        Product product = new Product(productID, productName, productDesc, productQty, productPrice, productBarcode, productReorderQty, productOrderQty);
                                        String data = product.toCSVFormat(format);
                                        FileUtil.writeContents(bw, data);
                                }
                        } else {
                                throw new DataAccessException("[ProductDA::writeData]Failed to create filename " + fileName);
                        }
View Full Code Here

Examples of sg.edu.nus.iss.se07.bc.product.Product

                try {
                        bw = FileUtil.getBufferedWriter(fileName, append);
                        if (bw != null) {
                                for (int i = 0; i < productSet.length(); i++) {
                                        Product product = productSet.get(i);
                                        String data = product.toCSVFormat(format);
                                        FileUtil.writeContents(bw, data);
                                }
                        } else {
                                Logger.getLogger(ProductDA.class.getName()).log(Level.SEVERE, "[ProductDA::writeData]Failed to create filename " + fileName);
                                throw new IOException("[ProductDA::writeData]Failed to create filename " + fileName);
View Full Code Here

Examples of springapp.domain.Product

  }

  private static class ProductMapper implements
      ParameterizedRowMapper<Product> {
    public Product mapRow(ResultSet rs, int rowNum) throws SQLException {
      Product prod = new Product();
      prod.setId(rs.getInt("id"));
      prod.setDescription(rs.getString("description"));
      prod.setPrice(new Double(rs.getDouble("price")));
      return prod;
    }
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.