Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.ShippingMethodLanguage


    form.setPublished(shippingMethod.getPublished() == Constants.PUBLISHED_YES);
   
    if (!form.isSiteProfileClassDefault()) {
      form.setShippingMethodNameLang(shippingMethod.getShippingMethodLanguage().getShippingMethodName());
        boolean found = false;
        ShippingMethodLanguage shippingMethodLanguage = null;
        Long siteProfileClassId = form.getSiteProfileClassId();
        Iterator<?> iterator = shippingMethod.getShippingMethodLanguages().iterator();
        while (iterator.hasNext()) {
          shippingMethodLanguage = (ShippingMethodLanguage) iterator.next();
          if (shippingMethodLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
            found = true;
            break;
          }
        }
        if (found) {
          if (shippingMethodLanguage.getShippingMethodName() != null) {
            form.setShippingMethodNameLangFlag(true);
            form.setShippingMethodNameLang(shippingMethodLanguage.getShippingMethodName());
          }
        }
    }

    initJsonSmRegions(form, shippingMethod, site.getSiteId(), adminBean.getUser());
View Full Code Here


    if (form.getMode().equals("C")) {
      insertMode = true;
    }
   
    ShippingMethod shippingMethod = new ShippingMethod();
    ShippingMethodLanguage shippingMethodLanguage = new ShippingMethodLanguage();
    if (!insertMode) {
      shippingMethod = ShippingMethodDAO.load(site.getSiteId(), Format.getLong(form.getShippingMethodId()));
      shippingMethodLanguage = shippingMethod.getShippingMethodLanguage();
    }
    if (insertMode) {
          String sql = "select max(seqNum) " +
                   "from   ShippingMethod " +
                   "where  siteId = :siteId ";
          int seqNum = 0;
      Query query = em.createQuery(sql);
      query.setParameter("siteId", site.getSiteId());
      Integer i = (Integer) query.getResultList().iterator().next();
      if (i != null) {
        seqNum = i.intValue() + 1;
      }
      shippingMethod.setSeqNum(seqNum);
      shippingMethod.setSite(site);
      shippingMethod.setRecCreateBy(adminBean.getUser().getUserId());
      shippingMethod.setRecCreateDatetime(new Date(System.currentTimeMillis()));
     
      shippingMethodLanguage.setRecCreateBy(adminBean.getUser().getUserId());
      shippingMethodLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      shippingMethodLanguage.setShippingMethod(shippingMethod);
      SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassId());
      shippingMethodLanguage.setSiteProfileClass(siteProfileClass);
      shippingMethod.getShippingMethodLanguages().add(shippingMethodLanguage);
    }

    for (ShippingMethodRegion shippingMethodRegion : shippingMethod.getShippingMethodRegions()) {
      shippingMethodRegion.setPublished(Constants.PUBLISHED_NO);
View Full Code Here

      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      Long siteProfileClassId = form.getSiteProfileClassId();
      User user = adminBean.getUser();
      Iterator<?> iterator = shippingMethod.getShippingMethodLanguages().iterator();
      boolean found = false;
      ShippingMethodLanguage shippingMethodLanguage = null;
      while (iterator.hasNext()) {
        shippingMethodLanguage = (ShippingMethodLanguage) iterator.next();
        if (shippingMethodLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
          found = true;
          break;
        }
      }
      if (!found) {
        shippingMethodLanguage = new ShippingMethodLanguage();
        shippingMethodLanguage.setRecCreateBy(user.getUserId());
        shippingMethodLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
        shippingMethodLanguage.setSiteProfileClass(siteProfileClass);
        shippingMethodLanguage.setShippingMethod(shippingMethod);
      }
      if (form.isShippingMethodNameLangFlag()) {
        shippingMethodLanguage.setShippingMethodName(form.getShippingMethodNameLang());
      }
      else {
        shippingMethodLanguage.setShippingMethodName(null);
      }

      shippingMethodLanguage.setRecUpdateBy(user.getUserId());
      shippingMethodLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      em.persist(shippingMethodLanguage);
  }
View Full Code Here

   
    if (!form.isSiteProfileClassDefault()) {
      form.setShippingMethodNameLangFlag(false);
      form.setShippingMethodNameLang(shippingMethod.getShippingMethodLanguage().getShippingMethodName());
        boolean found = false;
        ShippingMethodLanguage shippingMethodLanguage = null;
        Long siteProfileClassId = form.getSiteProfileClassId();
        Iterator<?> iterator = shippingMethod.getShippingMethodLanguages().iterator();
        while (iterator.hasNext()) {
          shippingMethodLanguage = (ShippingMethodLanguage) iterator.next();
          if (shippingMethodLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
            found = true;
            break;
          }
        }
        if (found) {
          if (shippingMethodLanguage.getShippingMethodName() != null) {
            form.setShippingMethodNameLangFlag(true);
            form.setShippingMethodNameLang(shippingMethodLanguage.getShippingMethodName());
          }
        }
    }
    initJsonSmRegions(form, shippingMethod, site.getSiteId(), adminBean.getUser());
   
View Full Code Here

          shippingMethod.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          shippingMethod.setRecCreateBy(userId);
          shippingMethod.setRecCreateDatetime(new Date(System.currentTimeMillis()));
         
          for (ShippingMethodLanguage language : master.getShippingMethodLanguages()) {
            ShippingMethodLanguage shippingMethodLanguage = new ShippingMethodLanguage();
            shippingMethodLanguage.setShippingMethodName(language.getShippingMethodName());
            shippingMethodLanguage.setRecUpdateBy(userId);
            shippingMethodLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
            shippingMethodLanguage.setRecCreateBy(userId);
            shippingMethodLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
            em.persist(shippingMethodLanguage);
            if (language.getShippingMethodLangId().equals(master.getShippingMethodLanguage().getShippingMethodLangId())) {
              shippingMethod.setShippingMethodLanguage(shippingMethodLanguage);
            }
            shippingMethod.getShippingMethodLanguages().add(shippingMethodLanguage);
View Full Code Here

TOP

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

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.