Examples of Customer


Examples of org.apache.isis.core.integtestsupport.legacy.sample.domain.Customer

        return (WrapperObject) proxiedNewCustomer;
    }

    @Test
    public void invokingSaveThroughProxyMakesTransientObjectPersistent() {
        final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));
        final Customer newCustomerVO = getWrapperFactory().wrap(newCustomer);
        newCustomerVO.setCustomerNumber(123);
        newCustomerVO.setFirstNameMandatory("Joe");
        newCustomerVO.setLastName("Smith");
        newCustomerVO.setMandatoryAssociation(countryGbrDO);
        newCustomerVO.setCountryOfBirthMandatory(countryGbrDO);
        newCustomerVO.setMandatoryValue("foo");
        newCustomerVO.setMaxLengthField("abc");
        newCustomerVO.setRegExCaseInsensitiveField("ABCd");
        newCustomerVO.setRegExCaseSensitiveField("abcd");
        final WrapperObject proxyNewCustomer = asWrapperObject(newCustomerVO);
        proxyNewCustomer.save();
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(true));
    }
View Full Code Here

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

        return (WrapperObject) proxiedNewCustomer;
    }

    @Test
    public void invokingSaveThroughProxyMakesTransientObjectPersistent() {
        final Customer newCustomer = getDomainObjectContainer().newTransientInstance(Customer.class);
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(false));
        final Customer newCustomerVO = getWrapperFactory().wrap(newCustomer);
        newCustomerVO.setCustomerNumber(123);
        newCustomerVO.setLastName("Smith");
        newCustomerVO.setMandatoryAssociation(countryGbrDO);
        newCustomerVO.setMandatoryValue("foo");
        newCustomerVO.setMaxLengthField("abc");
        newCustomerVO.setRegExCaseInsensitiveField("ABCd");
        newCustomerVO.setRegExCaseSensitiveField("abcd");
        final WrapperObject proxyNewCustomer = asWrapperObject(newCustomerVO);
        proxyNewCustomer.save();
        assertThat(getDomainObjectContainer().isPersistent(newCustomer), is(true));
    }
View Full Code Here

Examples of org.apache.openjpa.persistence.jdbc.query.domain.Customer

    int nCustomer = 20;
    int nOrder    = 10;
    EntityManager em = emf.createEntityManager();
    em.getTransaction().begin();
    for (int j = 0; j < nCustomer; j++) {
      Customer customer = new Customer();
      customer.setName("Customer-" + j);
      for (int k = 0; k < nOrder; k++) {
        Order order = new Order();
        order.setAmount(100);
        customer.addOrder(order);
        em.persist(order);
      }
      em.persist(customer);
    }
    em.getTransaction().commit();
View Full Code Here

Examples of org.apache.openjpa.persistence.xmlmapping.entities.Customer

    public static void main(String[] args) {
        TestRunner.run(TestXMLCustomerOrder.class);
    }

    private void persistEntities(EntityManager em) {
        Customer c2 = new Customer();
        c2.setCid( new Customer.CustomerKey("USA", 2) );
        c2.setName("A&J Auto");
        c2.setRating( CreditRating.GOOD );
        c2.setAddress(new EAddress("2480 Campbell Ave", "Campbell", "CA"
                , "95123"));
        em.persist(c2);

        Customer c1 = new Customer();
        c1.setCid( new Customer.CustomerKey("USA", 1) );
        c1.setName("Harry's Auto");
        c1.setRating( CreditRating.GOOD );
        c1.setAddress( new EAddress("12500 Monterey", "San Jose", "CA",
                "95141"));
        em.persist(c1);

        Order o1 = new Order(ORDER_1_OID, ORDER_1_AMOUNT, ORDER_1_DELIVERED,
                c1);
        o1.setShipAddress(createUSAAddress(c1.getName()));
        em.persist(o1);

        Order o2 = new Order(ORDER_2_OID, ORDER_2_AMOUNT, ORDER_2_DELIVERED,
                c1);
        o2.setShipAddress(createCANAddress(c2.getName()));
View Full Code Here

Examples of org.apache.taglibs.standard.examples.beans.Customer

    //*********************************************************************
    // ConditionalTagSupport methods
   
    protected boolean condition() throws JspTagException {
  try {
         Customer customerObj = (Customer)eval("customer", customer, Customer.class);
         if (customerObj == null) {
             throw new NullAttributeException("usCustomer", "test");
         } else {
             System.out.println("country: " + customerObj.getAddress().getCountry());
             return (customerObj.getAddress().getCountry().equalsIgnoreCase("USA"));
         }
        } catch (JspException ex) {
   throw new JspTagException(ex.toString());
  }
    }
View Full Code Here

Examples of org.apache.tuscany.das.rdb.test.customer.Customer

    DataGraphRoot root = (DataGraphRoot) cmd.executeQuery();

    List customers = root.getCustomers();
    assertEquals(4, customers.size());
   
    Customer cust1 = (Customer) customers.get(0);
    assertEquals("Williams", cust1.getLastName());

  }
View Full Code Here

Examples of org.apache.tuscany.sca.itest.policies.Customer

    private Map<String, Customer> customers = new HashMap<String, Customer>();
   
   
    @Init
    public void init() {
        Customer c1 = new Customer();
        c1.setId("001");
        c1.setName("John Smith");
        CreditCard creditCard = new CreditCard();
        creditCard.setNumber("1234-5678-1234");
        creditCard.setType("Visa");
        creditCard.setOwner("John Smith");
        creditCard.setExpMonth(6);
        creditCard.setExpYear(2015);
        c1.setCreditCard(creditCard);
        customers.put(c1.getId(), c1);
       
        Customer c2 = new Customer();
        c2.setId("002");
        c2.setName("Jane Smith");
        creditCard = new CreditCard();
        creditCard.setNumber("1234-5678-5678");
        creditCard.setType("MasterCard");
        creditCard.setOwner("Jane Smith");
        creditCard.setExpMonth(9);
        creditCard.setExpYear(2012);
        c2.setCreditCard(creditCard);
        customers.put(c2.getId(), c2);
    }
View Full Code Here

Examples of org.apache.tuscany.tools.java2wsdl.generate.customer.Customer

    public int getValue(String custId, String stockSymbol) {
        return 0;
    }

    public Customer getCustomerDetails(String custId) {
        return new Customer();
    }
View Full Code Here

Examples of org.blueoxygen.postila.partnerrelations.businesspartnerrules.entity.Customer

   
    if(getCustomer().getCreditLimit() == 0 || "".equals(getCustomer().getCreditLimit())){
      addActionError("Credit Limit is required");
    }
   
    Customer customer;
    if(getCustomer().getId() == null && "".equalsIgnoreCase(getCustomer().getId())){
      customer = new Customer();
      logInfo = new LogInformation();
      logInfo.setCreateBy(sessionCredentials.getCurrentUser().getId());
      logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
    } else {
      customer = (Customer) manager.getById(Customer.class, getCustomer().getId());
      logInfo = customer.getLogInformation();
    }

    logInfo.setActiveFlag(getActive());
    logInfo.setLastUpdateBy(sessionCredentials.getCurrentUser().getId());
    logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
   
    customer.setLogInformation(logInfo);
    customer.setIsCustomer(getCustomer().getIsCustomer());
    customer.setDocumentCopies(getCustomer().getDocumentCopies());
    customer.setInvoiceRule(getCustomer().getInvoiceRule());
    customer.setInvoiceSchedule(getInvoiceSchedule());
    customer.setDeliveryRule(getCustomer().getDeliveryRule());
    customer.setDeliveryVia(getCustomer().getDeliveryVia());
    customer.setPriceList(getPriceList());
    customer.setDiscountSchema(getDiscountSchema());
    customer.setFlatDiscount(getCustomer().getFlatDiscount());
    customer.setPaymentRule(getCustomer().getPaymentRule());
    customer.setPaymentTerm(getPaymentTerm());
    customer.setSalesRepresentative(getContact());
    customer.setDunning(getDunning());
    customer.setOrderReference(getCustomer().getOrderReference());
    customer.setOrderDescription(getCustomer().getOrderDescription());
    customer.setDiscountPrinted(getCustomer().getDiscountPrinted());
    customer.setOrderDescription(getCustomer().getOrderDescription());
    customer.setMinShelfLife(getCustomer().getMinShelfLife());
    customer.setCreditLimit(getCustomer().getCreditLimit());
    customer.setCreditUsed(getCustomer().getCreditUsed());
    customer.setDunningGrace(getCustomer().getDunningGrace());
   
    manager.save(customer);
    setCustomer(customer);
   
    return SUCCESS;
View Full Code Here

Examples of org.broadleafcommerce.profile.core.domain.Customer

    private String totalQuantityVar;

    @Override
    public int doStartTag() throws JspException {
        WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(pageContext.getServletContext());
        Customer customer = CustomerState.getCustomer((HttpServletRequest) pageContext.getRequest());
        LegacyCartService cartService = (LegacyCartService) applicationContext.getBean("blOrderService");
        Order order = null;
        if (orderName != null && orderId != null) {
            throw new IllegalArgumentException("Only orderName or orderId attribute may be specified on orderLookup tag");
        } else if (orderId != null) {
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.