Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.State


      if (stateIds != null) {
        for (int i = 0; i < stateIds.length; i++) {
          Long stateId = Format.getLong(stateIds[i]);
              Iterator<?> states = taxRegion.getStates().iterator();
              while (states.hasNext()) {
                State s = (State) states.next();
                if (s.getStateId().equals(stateId)) {
                  states.remove();
                  modified = true;
                  break;
                }
              }
View Full Code Here


       query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
View Full Code Here

       query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
View Full Code Here

       query = em.createQuery(sql);
      query.setParameter("siteId", site.getSiteId());
       iterator = query.getResultList().iterator();
       vector = new Vector<LabelValueBean>();
       while (iterator.hasNext()) {
         State state = (State) iterator.next();
         LabelValueBean bean = new LabelValueBean(state.getStateName(), state.getStateCode());
         vector.add(bean);
       }
       LabelValueBean states[] = new LabelValueBean[vector.size()];
       vector.copyInto(states);
       form.setStates(states);
View Full Code Here

    addressForm.setCustSuffix(custAddress.getCustSuffix());
    addressForm.setCustAddressLine1(custAddress.getCustAddressLine1());
    addressForm.setCustAddressLine2(custAddress.getCustAddressLine2());
    addressForm.setCustCityName(custAddress.getCustCityName());
    Country country = custAddress.getCountry();
    State state = custAddress.getState();
    if (state != null) {
      addressForm.setCustStateName(state.getStateName());
      addressForm.setCustStateCode(state.getStateCode());
    }
    addressForm.setCustCountryName(country.getCountryName());
    addressForm.setCustCountryCode(country.getCountryCode());
    addressForm.setCustZipCode(custAddress.getCustZipCode());
    addressForm.setCustPhoneNum(custAddress.getCustPhoneNum());
    addressForm.setCustFaxNum(custAddress.getCustFaxNum());
    form.setCustAddress(addressForm);
   
    OrderAddress billingAddress = orderHeader.getBillingAddress();
    addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(billingAddress.getCustUseAddress());
    if (billingAddress.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      addressForm.setOrderAddressId(billingAddress.getOrderAddressId().toString());
      addressForm.setCustPrefix(billingAddress.getCustPrefix());
      addressForm.setCustFirstName(billingAddress.getCustFirstName());
      addressForm.setCustMiddleName(billingAddress.getCustMiddleName());
      addressForm.setCustLastName(billingAddress.getCustLastName());
      addressForm.setCustSuffix(billingAddress.getCustSuffix());
      addressForm.setCustAddressLine1(billingAddress.getCustAddressLine1());
      addressForm.setCustAddressLine2(billingAddress.getCustAddressLine2());
      country = billingAddress.getCountry();
      state = billingAddress.getState();
      addressForm.setCustCityName(billingAddress.getCustCityName());
      if (state != null) {
        addressForm.setCustStateName(state.getStateName());
        addressForm.setCustStateCode(state.getStateCode());
      }
      addressForm.setCustCountryName(country.getCountryName());
      addressForm.setCustCountryCode(country.getCountryCode());
      addressForm.setCustZipCode(billingAddress.getCustZipCode());
      addressForm.setCustPhoneNum(billingAddress.getCustPhoneNum());
      addressForm.setCustFaxNum(billingAddress.getCustFaxNum());
    }
    form.setBillingAddress(addressForm);
   
    OrderAddress shippingAddress = orderHeader.getShippingAddress();
    addressForm = new CustomerAddressDisplayForm();
    addressForm.setCustUseAddress(shippingAddress.getCustUseAddress());
    if (shippingAddress.getCustUseAddress().equals(Constants.CUST_ADDRESS_USE_OWN)) {
      addressForm.setOrderAddressId(shippingAddress.getOrderAddressId().toString());
      addressForm.setCustPrefix(shippingAddress.getCustPrefix());
      addressForm.setCustFirstName(shippingAddress.getCustFirstName());
      addressForm.setCustMiddleName(shippingAddress.getCustMiddleName());
      addressForm.setCustLastName(shippingAddress.getCustLastName());
      addressForm.setCustSuffix(shippingAddress.getCustSuffix());
      addressForm.setCustAddressLine1(shippingAddress.getCustAddressLine1());
      addressForm.setCustAddressLine2(shippingAddress.getCustAddressLine2());
      addressForm.setCustCityName(shippingAddress.getCustCityName());
      country = shippingAddress.getCountry();
      state = shippingAddress.getState();
      if (state != null) {
        addressForm.setCustStateName(state.getStateName());
        addressForm.setCustStateCode(state.getStateCode());
      }
      addressForm.setCustCountryName(country.getCountryName());
      addressForm.setCustCountryCode(country.getCountryCode());
      addressForm.setCustZipCode(shippingAddress.getCustZipCode());
      addressForm.setCustPhoneNum(shippingAddress.getCustPhoneNum());
View Full Code Here

        sql = "from State where stateId in (select stateId from State state where state.country.site.siteId = :siteId)";
        query = em.createQuery(sql);
        query.setParameter("siteId", site.getSiteId());
        iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          State state = (State) iterator.next();
          state.setCountry(null);
          em.remove(state);
        }
       
        sql = "from Country where siteId = :siteId";
        query = em.createQuery(sql);
View Full Code Here

        String sql = "from State state where state.country.site.siteId = :siteId order by stateCode";
        Query query = em.createQuery(sql);
        query.setParameter("siteId", Constants.SITE_SYSTEM);
        Iterator<?> iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          State master = (State) iterator.next();
          State state = new State();
          PropertyUtils.copyProperties(state, master);
          state.setStateId(null);
          state.setRecUpdateBy(userId);
          state.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          state.setRecCreateBy(userId);
          state.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          state.setShippingRegion(null);
          Country mc = master.getCountry();
          Country country = null;
          if (mc != null) {
            country = CountryDAO.loadByCountryName(site.getSiteId(), mc.getCountryName());
          }
          state.setCountry(country);
          state.setTaxes(null);
          em.persist(state);
        }
  }
View Full Code Here

            }
          }
          if (master.getStates() != null) {
            it = master.getStates().iterator();
            while (it.hasNext()) {
              State mc = (State) it.next();
              State state = StateDAO.loadByStateName(site.getSiteId(), mc.getStateName());
              tax.getStates().add(state);
            }
          }
          em.persist(tax);
        }
View Full Code Here

            }
          }
          if (master.getStates() != null) {
            it = master.getStates().iterator();
            while (it.hasNext()) {
              State mc = (State) it.next();
              State state = StateDAO.loadByStateName(site.getSiteId(), mc.getStateName());
              shippingRegion.getStates().add(state);
            }
          }
          shippingRegions.add(shippingRegion);
          em.persist(shippingRegion);
View Full Code Here

        }

        String states[] = form.getStates();
        if (states != null) {
          for (int i = 0; i < states.length; i++) {
              State state = StateDAO.load(site.getSiteId(), Format.getLong(states[i]));
            tax.getStates().add(state);
          }
        }
        em.flush();
        initListInfo(form, tax);
View Full Code Here

TOP

Related Classes of com.jada.jpa.entity.State

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.