Package $packageName$.domain

Examples of $packageName$.domain.Product


    }
    // }}

    public void install() {
        Customer richard = getCustomerRepository().findByName("Pawson");
        Product foldingTable = getProductRepository().findByCode("820-72721");
        Product foldingChair = getProductRepository().findByCode("820-72725");
        Product waspCatcher = getProductRepository().findByCode("850-18003");
        Product coolbox = getProductRepository().findByCode("845-01020");
       
        setDate(2007, 4, 11); setTime(10, 15);
        richard.placeOrder(foldingTable, 1);
        setDate(2007, 4, 12); setTime(9, 35);
        richard.placeOrder(foldingChair, 6);
View Full Code Here


     * Creates a new (still-transient) customer.
     *
     * @return
     */
    public Customer newCustomer() {
        Customer customer = (Customer)newTransientInstance(Customer.class);
        return customer;
    }
View Full Code Here

    public Customer newCustomer(
            String firstName,
            String lastName,
            int customerNumber) {
       
        Customer customer = newCustomer();
        customer.setFirstName(firstName);
        customer.setLastName(lastName);
        customer.setCustomerNumber(customerNumber);
       
        getContainer().makePersistent(customer);
        return customer;
    }
View Full Code Here

                String name) {
            this.name = name;
        }

        public boolean accept(Object obj) {
            Customer pojo = (Customer)obj;
            return pojo.getLastName().toLowerCase().contains(name.toLowerCase());
        }
View Full Code Here

            final String code) {
        return firstMatch(
                Product.class,
                new Filter() {
                    public boolean accept(Object obj) {
                        Product pojo = (Product)obj;
                        return code.equals(pojo.getCode());
                    }
                },
                false);
    }
View Full Code Here

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

   * @param name The name
   * @param expirationDate The expiration Date
   * @return Product object with all properties set
   */
  private Product createProduct(int productId, String name, Date expirationDate) {
    Product product = new Product();
    product.setProductId(productId);
    product.setName(name);
    product.setExpirationDate(expirationDate);
   
    return product;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
   */
  protected Object formBackingObject(HttpServletRequest request) throws Exception {
    Product command = new Product();
    int productId = RequestUtils.getIntParameter(request, "productId", 0);
    if (productId != 0) {
      // load the product
      command.setProductId(productId);
      command.setName("loaded");
    }
   
    return command;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.springframework.web.servlet.mvc.AbstractWizardFormController#processFinish(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.Object, org.springframework.validation.BindException)
   */
  protected ModelAndView processFinish(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
    Product product = (Product) command;

    System.out.println("Register " + product);
    return null;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.springframework.web.servlet.mvc.AbstractFormController#formBackingObject(javax.servlet.http.HttpServletRequest)
   */
  protected Object formBackingObject(HttpServletRequest request) throws Exception {
    Product command = new Product();
    int productId = RequestUtils.getIntParameter(request, "productId", 0);
    if (productId != 0) {
      // load the product
      command.setProductId(productId);
      command.setName("loaded");
    }
   
    return command;
  }
View Full Code Here

TOP

Related Classes of $packageName$.domain.Product

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.