Package $packageName$.domain

Examples of $packageName$.domain.Customer


        return LOGGER;
    }
    // }}

    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);
        setDate(2007, 4, 13); setTime(14, 20);
        richard.placeOrder(waspCatcher, 1);
        setDate(2007, 4, 14); setTime(11, 10);
        richard.placeOrder(coolbox, 1);
    }
View Full Code Here


    proxyCustomerDH = getProxyFactory().proxy(customerDH);
    product355 = getProductRepository().findByCode("355-40311");
  }
 
  public void testCannotPlaceOrderForStillTransientCustomer() {
    Customer newCustomer =
      getProxyFactory().proxy(getCustomerRepository().newCustomer());
    try {
      newCustomer.placeOrder(product355, 1);
      fail("Exception should have been thrown");
    } catch(DisabledImperativelyException ex) {
      assertEquals("Save object first", ex.getMessage());
    }
  }
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

  }
 
  private void customer() {
    CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
   
    Customer janm = customerDao.getById(1);
    Customer robh = customerDao.getById(2);
   
    System.out.println(janm);
    System.out.println(robh);
  }
View Full Code Here

 
  public void customer() {
    CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
    List customers = customerDao.getAll();
    for (Iterator i = customers.iterator(); i.hasNext();) {
      Customer customer = (Customer)i.next();
      System.out.println(customer);
    }
   
    customers = customerDao.getAllWithOnlyOnePermission();
    for (Iterator i = customers.iterator(); i.hasNext();) {
      Customer customer = (Customer)i.next();
      System.out.println(customer);
    }   
   
    Customer customer = new Customer();
    customer.setFirstName("Jack");
    customer.setLastName("Schitt");
    customer.setPermissions(new HashSet());
    customer.setAddresses(new HashSet());
   
    CustomerAddress ca = new CustomerAddress();
    ca.setLine1("1");
    ca.setLine2("2");
    ca.setCity("Manchester");
    ca.setPostCode("M1 xx");
   
    customer.getAddresses().add(ca);
   
    Permission p = new Permission();
    p.setPermissionId(1);
   
    customer.getPermissions().add(p);
   
    //customerDao.save(customer);
  }
View Full Code Here

TOP

Related Classes of $packageName$.domain.Customer

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.