Examples of Product


Examples of org.apache.isis.viewer.junit.sample.domain.Product

     *
     * @return
     */
    @Hidden
    public Product newProduct(final String code, final String description, final int priceInPence) {
        final Product product = newTransientInstance(Product.class);
        product.setCode(code);
        product.setDescription(description);
        product.setPrice(new Double(priceInPence / 100));
        persist(product);
        return product;
    }
View Full Code Here

Examples of org.apache.jdo.tck.pc.shoppingcart.Product

        // sets fetch group cart, entries, product
        setCartFetchGroups();
        // DETACH_LOAD_FIELDS true by default
        CartEntry cartEntryDetached = (CartEntry)pm.detachCopy(cartEntry1);
        try {
            Product prod = cartEntryDetached.getProduct();
        } catch (JDODetachedFieldAccessException jdoex) {
            fail("Unexpected exception caught: " + jdoex.getMessage());
        }
        pm.currentTransaction().commit();
    }
View Full Code Here

Examples of org.apache.ojb.tutorial1.Product

        writer.println("<tr><td><b>ID</b></td> <td><b>NAME</b></td> <td><b>PRICE</b></td> <td><b>STOCK</b></td></tr>");
        if (products != null)
        {
            for (Iterator it = products.iterator(); it.hasNext();)
            {
               Product a = (Product)it.next();
   
                writer.println("<tr><td>" + a.getId() + "</td> <td>" + a.getName() + "</td> <td>" + a.getPrice()+ "</td> <td>" + a.getStock() + "</td></tr>");  
            }
        }
        writer.println("</table>");
       
    }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.Product

                ProductType type = (ProductType) i.next();
                try {
                    products = client.query(query, type);
                    if (products != null && products.size() > 0) {
                        for (Iterator j = products.iterator(); j.hasNext();) {
                            Product product = (Product) j.next();
                            prodIds.add(product.getProductId());
                        }
                    }
                } catch (CatalogException e) {
                    LOG.log(Level.WARNING, "Exception querying for: ["
                            + type.getName() + "] products: Message: "
View Full Code Here

Examples of org.broadleafcommerce.core.catalog.domain.Product

    public Order setUpNamedOrder() throws AddToCartException {
        Customer customer = customerService.saveCustomer(createNamedCustomer());

        Order order = orderService.createNamedOrderForCustomer("Boxes Named Order", customer);
       
        Product newProduct = addTestProduct("Cube Box", "Boxes");       
        Category newCategory = newProduct.getDefaultCategory();
       
        order = orderService.addItem(order.getId(),
                new OrderItemRequestDTO(newProduct.getId(), newProduct.getDefaultSku().getId(), newCategory.getId(), 2),
                true);

        return order;
    }
View Full Code Here

Examples of org.campware.dream.om.Product

     * wouldn't be secure.
     */
    public void doInsert(RunData data, Context context)
        throws Exception
    {
        Product entry = new Product();
        data.getParameters().setProperties(entry);


        String myCode=data.getParameters().getString("productcode");

        entry.setCreatedBy(data.getUser().getUserName());
        entry.setCreated(new Date());
        entry.setModifiedBy(data.getUser().getUserName());
        entry.setModified(new Date());
       
        if (myCode.equals("AUTO"))
        {
            entry.setProductCode(getTempCode());

            Connection conn = Transaction.begin(ProductPeer.DATABASE_NAME);
            boolean success = false;
            try {
                entry.save(conn);
                entry.setProductCode(getRowCode("PR", entry.getProductId()));
                entry.save(conn);
                Transaction.commit(conn);
                success = true;
   
            } finally {
                if (!success) Transaction.safeRollback(conn);
            }
        }
        else
        {
            entry.save();
        }

    }
View Full Code Here

Examples of org.candlepin.model.Product

        Subscription sub = null;
        if (pool.getSubscriptionId() != null) {
            sub = subAdapter.getSubscription(pool.getSubscriptionId());
        }

        Product product = null;
        /*
         * If we have a subscription for this pool, the products we need are already
         * loaded as this saves us some product adapter lookups.
         *
         * If not we'll have to look them up based on the pool's data.
View Full Code Here

Examples of org.company.recordshop.domain.Product

  /**
   * {@inheritDoc}
   */
  public ProductWithCustomersDto readProductAsProductWithCustomersDto(Long id) {
    Product result = customerServiceModelDomainService.readProduct(id);
    return (result == null) ? null : productWithCustomersDtoTranslator
        .toDto(result);
  }
View Full Code Here

Examples of org.geotools.coverage.io.hdf4.HDF4ProductFieldType.Product

                fields = (LinkedHashMap<String, HDF4ProductFieldType>) fieldsMap.get(coverageName);

                String elementName = band.getName();
                if (!fields.containsKey(elementName)) {

                    Product product = HDF4ProductFieldType.getProduct(elementName);
                    Unit unit = Unit.ONE;
                    if (product != null) {
                        unit = product.getUoM();
                    } else {
                        String uOm = band.getUoM();
                        if(uOm == null)
                           unit = Unit.ONE.alternate(uOm);
                        else
                          try {
                            unit = Unit.valueOf(uOm);
                          } catch (IllegalArgumentException iae) {
                              try {
                                  unit = Unit.ONE.alternate(uOm);
                              } catch (IllegalArgumentException iae2) {
                                  if (LOGGER.isLoggable(Level.FINE)) {
                                      LOGGER.log(Level.FINE, "Unable to parse the provided unit " + uOm, iae2);
                                  }
                              } catch (UnsupportedOperationException uoe) {
                                  if (LOGGER.isLoggable(Level.FINE)) {
                                      LOGGER.log(Level.FINE,
                                              "Unable to parse the provided unit "
                                                      + uOm, uoe);
                                  }
                              }
                          }
                    }
                    final Name nameImpl = new NameImpl(coverageName.getLocalPart(), elementName);
                    final InternationalString description = new SimpleInternationalString(product!=null?product.getDescription():elementName);

                    // setting bands names.
                    final GridSampleDimension gridBand = Utilities.buildBands(band, elementName, unit);
                    final HDF4ProductFieldType fd = new HDF4ProductFieldType(nameImpl, description, gridBand);
                    fields.put(elementName, fd);
View Full Code Here

Examples of org.hibernate.ejb.metamodel.Product

  public void setUp() throws Exception {
    super.setUp();
    builder = factory.getCriteriaBuilder();
    EntityManager em = getOrCreateEntityManager();
    em.getTransaction().begin();
    Product product = new Product();
    product.setId( "product1" );
    product.setPrice( 1.23d );
    product.setQuantity( 1000 );
    product.setPartNumber( Integer.MAX_VALUE + 1 );
    product.setRating( 1.999f );
    product.setSomeBigInteger( BigInteger.valueOf( 987654321 ) );
    product.setSomeBigDecimal( BigDecimal.valueOf( 987654.321 ) );
    em.persist( product );
    em.getTransaction().commit();
    em.close();
  }
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.