Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ShippingType


        String sql = "from ShippingType where siteId = :siteId order by shippingTypeId";
        Query query = em.createQuery(sql);
        query.setParameter("siteId", Constants.SITE_SYSTEM);
        Iterator<?> iterator = query.getResultList().iterator();
        while (iterator.hasNext()) {
          ShippingType master = (ShippingType) iterator.next();
          ShippingType shippingType = new ShippingType();
          PropertyUtils.copyProperties(shippingType, master);
          shippingType.setSite(site);
          shippingType.setRecUpdateBy(userId);
          shippingType.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          shippingType.setRecCreateBy(userId);
          shippingType.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          shippingType.setShippingMethodRegionTypes(null);
            shippingTypes.add(shippingType);
          em.persist(shippingType);
        }
  }
View Full Code Here


  }
 
  public ShippingType getShippingType(String shippingTypeName) {
    Iterator<?> iterator = shippingTypes.iterator();
    while (iterator.hasNext()) {
      ShippingType shippingType = (ShippingType) iterator.next();
      if (shippingType.getShippingTypeName().equals(shippingTypeName)) {
        return shippingType;
      }
    }
    return null;
  }
View Full Code Here

          query.setParameter("shippingTypeName", "%" + form.getSrShippingTypeName() + "%");
        }
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<ShippingTypeDisplayForm> vector = new Vector<ShippingTypeDisplayForm>();
        while (iterator.hasNext()) {
          ShippingType shippingType = (ShippingType) iterator.next();
        ShippingTypeDisplayForm shippingTypeDisplay = new ShippingTypeDisplayForm();
        shippingTypeDisplay.setShippingTypeId(Format.getLong(shippingType.getShippingTypeId()));
        shippingTypeDisplay.setShippingTypeName(shippingType.getShippingTypeName());
        shippingTypeDisplay.setSystemRecord(String.valueOf(shippingType.getSystemRecord()));
        vector.add(shippingTypeDisplay);
        }
        form.setShippingTypes(vector);
       
        ActionForward actionForward = actionMapping.findForward("success");
View Full Code Here

        String shippingTypeIds[] = form.getShippingTypeIds();
       
        try {
          if (shippingTypeIds != null) {
            for (int i = 0; i < shippingTypeIds.length; i++) {
                ShippingType shippingType = new ShippingType();
                shippingType = ShippingTypeDAO.load(getAdminBean(request).getSite().getSiteId(), Format.getLong(shippingTypeIds[i]));
                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);
          }
View Full Code Here

public class ShippingTypeDAO extends ShippingType {
  private static final long serialVersionUID = 4041713304293897947L;

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

                     "and   shippingTypeName = :shippingTypeName");
      query.setParameter("siteId", siteId);
      query.setParameter("shippingTypeName", shippingTypeName);
      Iterator<?> iterator = query.getResultList().iterator();
      if (iterator.hasNext()) {
        ShippingType shippingType = (ShippingType) iterator.next();
        return shippingType;
      }
      return null;
  }
View Full Code Here

      productClass.setRecCreateBy(userId);
      productClass.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      productClass.setSite(site);
      em.persist(productClass);

      ShippingType shippingType = new ShippingType();
      shippingType.setShippingTypeName(Constants.SHIPPING_TYPE_REGULAR);
      shippingType.setSystemRecord(Constants.VALUE_YES);
      shippingType.setRecUpdateBy(userId);
      shippingType.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      shippingType.setRecCreateBy(userId);
      shippingType.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      shippingType.setSite(site);
      em.persist(shippingType);
     
      CustomAttribute customAttribute = new CustomAttribute();
      customAttribute.setCustomAttribDataTypeCode(Constants.CUSTOM_ATTRIBUTE_DATA_TYPE_CURRENCY);
      customAttribute.setCustomAttribTypeCode(Constants.CUSTOM_ATTRIBUTE_TYPE_USER_SELECT_DROPDOWN);
View Full Code Here

          iterator = shoppingCartItems.iterator();
          while (iterator.hasNext()) {
            ShoppingCartItem shoppingCartItem = (ShoppingCartItem) iterator.next();
            Item item = shoppingCartItem.getItem();
            logger.debug("Calculating shipping for item " + item.getItemId() + " " + item.getItemNum());
            ShippingType shippingType = item.getShippingType();
            Long shippingTypeId = shippingType.getShippingTypeId();
            if (shippingTypeId == null) {
              logger.debug("No shipping type can be found");
                shoppingCartItem.setItemShippingFee(0);
                shoppingCartItem.setItemAdditionalShippingFee(0);
              continue;
View Full Code Here

TOP

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

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.