Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomAttributeLanguage


      customAttribute.setRecCreateBy(adminBean.getUser().getUserId());
      customAttribute.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      form.setCustomAttribDataTypeCodeDesc(resources.getMessage("customAttrib.dataTypeCode." + form.getCustomAttribDataTypeCode()));
      form.setCustomAttribTypeCodeDesc(resources.getMessage("customAttrib.typeCode." + form.getCustomAttribTypeCode()));
     
      CustomAttributeLanguage customAttribLanguage = new CustomAttributeLanguage();
      customAttribute.setSystemRecord(Constants.VALUE_NO);
      customAttribLanguage.setRecCreateBy(adminBean.getUser().getUserId());
      customAttribLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, form.getSiteProfileClassDefaultId());
        customAttribLanguage.setSiteProfileClass(siteProfileClass);
        customAttribLanguage.setCustomAttribute(customAttribute);
        customAttribute.setCustomAttributeLanguage(customAttribLanguage);
        customAttribute.getCustomAttributeLanguages().add(customAttribLanguage);
    }
    customAttribute.setSite(site);
    customAttribute.setCustomAttribName(form.getCustomAttribName());
View Full Code Here


    return mapping.findForward("success");
  }
 
  private void saveDefault(CustomAttribute customAttribute, CustomAttributeMaintActionForm form, AdminBean adminBean) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      CustomAttributeLanguage customAttribLanguage = customAttribute.getCustomAttributeLanguage();
      customAttribLanguage.setCustomAttribDesc(form.getCustomAttribDesc());
      customAttribLanguage.setRecUpdateBy(adminBean.getUser().getUserId());
      customAttribLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      em.persist(customAttribLanguage);
   
    customAttribute.setItemCompare(Constants.VALUE_NO);
    if (form.isItemCompare()) {
      customAttribute.setItemCompare(Constants.VALUE_YES);
View Full Code Here

    }
  }
 
  private void saveLanguage(CustomAttribute customAttribute, CustomAttributeMaintActionForm form, AdminBean adminBean) throws Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    CustomAttributeLanguage customAttribLanguage = null;
    User user = adminBean.getUser();
      Long siteProfileClassId = form.getSiteProfileClassId();
    boolean found = false;
    Iterator<?> iterator = customAttribute.getCustomAttributeLanguages().iterator();
    while (iterator.hasNext()) {
      customAttribLanguage = (CustomAttributeLanguage) iterator.next();
      if (customAttribLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
        found = true;
        break;
      }
    }
    if (!found) {
      customAttribLanguage = new CustomAttributeLanguage();
      customAttribLanguage.setRecCreateBy(user.getUserId());
      customAttribLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
        SiteProfileClass siteProfileClass = (SiteProfileClass) em.find(SiteProfileClass.class, siteProfileClassId);
        customAttribLanguage.setSiteProfileClass(siteProfileClass);
        customAttribLanguage.setCustomAttribute(customAttribute);
        customAttribute.getCustomAttributeLanguages().add(customAttribLanguage);
    }
    if (form.isCustomAttribDescLangFlag()) {
      customAttribLanguage.setCustomAttribDesc(form.getCustomAttribDescLang());
    }
    else {
      customAttribLanguage.setCustomAttribDesc(null);
    }
    customAttribLanguage.setRecUpdateBy(user.getUserId());
    customAttribLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
    em.persist(customAttribLanguage);
   
    for (int i = 0; i < form.getCustomAttribOptions().length; i++) {
      CustomAttributeOptionDisplayForm optionForm = form.getCustomAttribOptions()[i];
      CustomAttributeOption customAttributeOption = null;
View Full Code Here

    query.setParameter("siteId", site.getSiteId());
    iterator = query.getResultList().iterator();
    while (iterator.hasNext()) {
      CustomAttribute customAttribute = (CustomAttribute) iterator.next();
        em.remove(customAttribute);
      CustomAttributeLanguage customAttributeLanguage = customAttribute.getCustomAttributeLanguage();
      customAttributeLanguage.setCustomAttribute(null);
       em.remove(customAttributeLanguage);
    }

    sql = "from SiteDomain siteDomain where siteDomain.site.siteId = :siteId";
    query = em.createQuery(sql);
View Full Code Here

      customAttribute.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      customAttribute.setRecCreateBy(userId);
      customAttribute.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      customAttribute.setSite(site);
     
      CustomAttributeLanguage customAttributeLanguage = new CustomAttributeLanguage();
      customAttributeLanguage.setCustomAttribDesc("Price");
      customAttributeLanguage.setRecUpdateBy(userId);
      customAttributeLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      customAttributeLanguage.setRecCreateBy(userId);
      customAttributeLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      customAttributeLanguage.setCustomAttribute(customAttribute);
      customAttributeLanguage.setSiteProfileClass(siteProfileClass);
      customAttribute.setCustomAttributeLanguage(customAttributeLanguage);
      em.persist(customAttributeLanguage);
      em.persist(customAttribute);

    String prefix = getNextPrefix();
View Full Code Here

TOP

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

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.