Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ShippingMethodRegionType


      shippingMethodRegion.setShippingMethod(shippingMethod);
        em.persist(shippingMethodRegion);
        shippingMethod.getShippingMethodRegions().add(shippingMethodRegion);
    }
    if (!foundRegionType) {
        ShippingMethodRegionType shippingMethodRegionType = new ShippingMethodRegionType();
        shippingMethodRegionType.setPublished(Constants.VALUE_NO);
        shippingMethodRegionType.setRecUpdateBy(user.getUserId());
        shippingMethodRegionType.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
        shippingMethodRegionType.setRecCreateBy(user.getUserId());
        shippingMethodRegionType.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        shippingMethodRegionType.setShippingMethod(shippingMethod);
        shippingMethodRegionType.setShippingMethodRegion(shippingMethodRegion);
        shippingMethodRegionType.setShippingRegion(shippingRegion);
        shippingMethodRegionType.setShippingType(shippingType);
        em.persist(shippingMethodRegionType);
        shippingMethodRegion.getShippingMethodRegionTypes().add(shippingMethodRegionType);
    }
    return null;
  }
View Full Code Here


      Long shippingTypeId = Format.getLong(form.getShippingTypeId());
    ShippingMethod shippingMethod = (ShippingMethod) em.find(ShippingMethod.class, shippingMethodId);

    ShippingRate shippingRate = null;
    ShippingRateCurrency shippingRateCurrency = null;
    ShippingMethodRegionType shippingMethodRegionType = null;
    for (ShippingMethodRegion shippingMethodRegion : shippingMethod.getShippingMethodRegions()) {
      if (shippingMethodRegion.getShippingRegion().getShippingRegionId().equals(shippingRegionId)) {
        for (ShippingMethodRegionType smrt : shippingMethodRegion.getShippingMethodRegionTypes()) {
          if (smrt.getShippingType().getShippingTypeId().equals(shippingTypeId)) {
            shippingMethodRegionType = smrt;
            shippingRate = shippingMethodRegionType.getShippingRate();
            break;
          }
        }
      }
    }
    if (shippingRate == null) {
      shippingRate = new ShippingRate();
      shippingRate.setRecUpdateBy(adminBean.getUser().getUserId());
      shippingRate.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      shippingRate.setRecCreateBy(adminBean.getUser().getUserId());
      shippingRate.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      shippingRate.setPublished(Constants.VALUE_YES);
      shippingMethodRegionType.setShippingRate(shippingRate);
    }
    if (form.isSiteCurrencyClassDefault()) {
      shippingRateCurrency = shippingRate.getShippingRateCurrency();
      if (shippingRateCurrency == null) {
        shippingRateCurrency = new ShippingRateCurrency();
View Full Code Here

    ShippingTypeMaintActionForm form = (ShippingTypeMaintActionForm) actionForm;
    try {
      ShippingType shippingType = ShippingTypeDAO.load(site.getSiteId(), Format.getLong(form.getShippingTypeId()));
      Iterator<?> iterator = shippingType.getShippingMethodRegionTypes().iterator();
      while (iterator.hasNext()) {
        ShippingMethodRegionType shippingMethodRegionType = (ShippingMethodRegionType) iterator.next();
        em.remove(shippingMethodRegionType.getShippingRate());
        em.remove(shippingMethodRegionType);
      }
      em.remove(shippingType);
      em.getTransaction().commit();
    }
View Full Code Here

              shippingMethodRegion.setShippingRegion(shippingRegion);
             
              if (m_shippingMethodRegion.getShippingMethodRegionTypes() != null) {
                Iterator<?> it1 = m_shippingMethodRegion.getShippingMethodRegionTypes().iterator();
                while (it1.hasNext()) {
                  ShippingMethodRegionType m_shippingMethodRegionType = (ShippingMethodRegionType) it1.next();
                  ShippingMethodRegionType shippingMethodRegionType = new ShippingMethodRegionType();
                      shippingMethodRegionType.setPublished(m_shippingMethodRegionType.getPublished());
                      shippingMethodRegionType.setRecUpdateBy(userId);
                      shippingMethodRegionType.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
                      shippingMethodRegionType.setRecCreateBy(userId);
                      shippingMethodRegionType.setRecCreateDatetime(new Date(System.currentTimeMillis()));
                      shippingMethodRegionType.setShippingRegion(shippingRegion);
                      shippingMethodRegionType.setShippingMethod(shippingMethod);
                      shippingMethodRegionType.setShippingType(getShippingType(m_shippingMethodRegionType.getShippingType().getShippingTypeName()));
                     
                      ShippingRate m_shippingRate = m_shippingMethodRegionType.getShippingRate();
                      ShippingRate shippingRate = new ShippingRate();
                          PropertyUtils.copyProperties(shippingRate, m_shippingRate);
                      shippingRate.setPublished(m_shippingRate.getPublished());
                      shippingRate.setRecUpdateBy(userId);
                      shippingRate.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
                      shippingRate.setRecCreateBy(userId);
                      shippingRate.setRecCreateDatetime(new Date(System.currentTimeMillis()));
                      shippingMethodRegionType.setShippingRate(shippingRate);
                     
                      em.persist(shippingRate);
                      em.persist(shippingMethodRegionType);
                      shippingMethodRegion.getShippingMethodRegionTypes().add(shippingMethodRegionType);
                }
View Full Code Here

                if (shippingType.getSystemRecord() == Constants.VALUE_YES) {
                  continue;
                }
          Iterator<?> iterator = shippingType.getShippingMethodRegionTypes().iterator();
          while (iterator.hasNext()) {
            ShippingMethodRegionType shippingMethodRegionType = (ShippingMethodRegionType) iterator.next();
            em.remove(shippingMethodRegionType.getShippingRate());
            em.remove(shippingMethodRegionType);
          }
                em.remove(shippingType);
            }
            em.getTransaction().commit();
View Full Code Here

public class ShippingMethodRegionTypeDAO extends ShippingMethodRegionType {
  private static final long serialVersionUID = 7472414945481322221L;

  public static ShippingMethodRegionType load(String siteId, Long shippingMethodRegionTypeId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    ShippingMethodRegionType shippingmethodregiontype = (ShippingMethodRegionType) em.find(ShippingMethodRegionType.class, shippingMethodRegionTypeId);
    if (!shippingmethodregiontype.getShippingMethod().getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return shippingmethodregiontype;
  }
View Full Code Here

              continue;
            }
            Iterator<?> shippingMethodRegionTypes = shippingMethodRegion.getShippingMethodRegionTypes().iterator();
            ShippingRate shippingRate = null;
            while (shippingMethodRegionTypes.hasNext()) {
              ShippingMethodRegionType shippingMethodRegionType = (ShippingMethodRegionType) shippingMethodRegionTypes.next();
              if (shippingMethodRegionType.getShippingType().getShippingTypeId().equals(shippingTypeId)) {
                shippingRate = shippingMethodRegionType.getShippingRate();
                break;
              }
            }
            float itemPrice = shoppingCartItem.getItemPriceTotal();
           
View Full Code Here

TOP

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

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.