Package com.jada.jpa.entity

Examples of com.jada.jpa.entity.CustomAttributeDetail


        query.setParameter("customAttribGroupId", Format.getLong(form.getCustomAttribGroupId()));
        Iterator<?> iterator = query.getResultList().iterator();
        Vector<ItemAttributeDetailDisplayForm> itemAttributeDetails = new Vector<ItemAttributeDetailDisplayForm>();
        boolean itemAttributeLangFlag = false;
        while (iterator.hasNext()) {
          CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) iterator.next();
/*
          ItemAttributeDetail itemAttributeDetail = new ItemAttributeDetail();
          itemAttributeDetail.setItem(item);
          itemAttributeDetail.setCustomAttributeDetail(customAttributeDetail);
          itemAttributeDetail.setRecUpdateBy(adminBean.getUser().getUserId());
          itemAttributeDetail.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          itemAttributeDetail.setRecCreateBy(adminBean.getUser().getUserId());
          itemAttributeDetail.setRecCreateDatetime(new Date(System.currentTimeMillis()));
         
          ItemAttributeDetailLanguage itemAttributeDetailLanguage = new ItemAttributeDetailLanguage();
          itemAttributeDetailLanguage.setItemAttribDetailValue("");
          itemAttributeDetailLanguage.setRecUpdateBy(adminBean.getUser().getUserId());
          itemAttributeDetailLanguage.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
          itemAttributeDetailLanguage.setRecCreateBy(adminBean.getUser().getUserId());
          itemAttributeDetailLanguage.setRecCreateDatetime(new Date(System.currentTimeMillis()));
          SiteProfileClass siteProfileClass = SiteProfileClassDAO.load(form.getSiteProfileClassDefaultId());
          itemAttributeDetailLanguage.setSiteProfileClass(siteProfileClass);
          if (customAttributeDetail.getCustomAttribute().getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_USER_SELECT_DROPDOWN) {
            CustomAttributeOption customAttributeOption = null;
            for (CustomAttributeOption option : customAttributeDetail.getCustomAttribute().getCustomAttributeOptions()) {
              customAttributeOption = option;
              break;
            }
            itemAttributeDetail.setCustomAttributeOption(customAttributeOption);
          }
          em.persist(itemAttributeDetailLanguage);
         
          itemAttributeDetail.setItemAttributeDetailLanguage(itemAttributeDetailLanguage);
          em.persist(itemAttributeDetail);
*/
          ItemAttributeDetailDisplayForm displayForm = new ItemAttributeDetailDisplayForm();
          displayForm.setCustomAttribId(customAttributeDetail.getCustomAttribute().getCustomAttribId().toString());
          displayForm.setCustomAttribTypeCode(String.valueOf(customAttributeDetail.getCustomAttribute().getCustomAttribTypeCode()));
          displayForm.setCustomAttribDetailId(customAttributeDetail.getCustomAttribDetailId().toString());
          displayForm.setCustomAttribName(customAttributeDetail.getCustomAttribute().getCustomAttribName());
          displayForm.setCustomAttribTypeCode(String.valueOf(customAttributeDetail.getCustomAttribute().getCustomAttribTypeCode()));
          displayForm.setItemAttribDetailValue("");
          itemAttributeDetails.add(displayForm);
        }
        form.setItemAttribDetailValueLangFlag(itemAttributeLangFlag);
        ItemAttributeDetailDisplayForm[] itemAttributeDetailDisplayForms = new ItemAttributeDetailDisplayForm[itemAttributeDetails.size()];
View Full Code Here


    ItemAttributeDetailDisplayForm itemAttributeDetails[] = form.getItemAttributeDetails();
    for (int i = 0; i < itemAttributeDetails.length; i++) {
      CustomAttribute customAttribute = CustomAttributeDAO.load(site.getSiteId(), Format.getLong(itemAttributeDetails[i].getCustomAttribId()));
      ItemAttributeDetail itemAttributeDetail = new ItemAttributeDetail();
      Long customAttribDetailId = Format.getLong(itemAttributeDetails[i].getCustomAttribDetailId());
      CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) em.find(CustomAttributeDetail.class, customAttribDetailId);
      itemAttributeDetail.setCustomAttributeDetail(customAttributeDetail);
      itemAttributeDetail.setRecUpdateBy(adminBean.getUser().getUserId());
      itemAttributeDetail.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      itemAttributeDetail.setRecCreateBy(adminBean.getUser().getUserId());
      itemAttributeDetail.setRecCreateDatetime(new Date(System.currentTimeMillis()));
View Full Code Here

      query = em.createQuery(sql);
      query.setParameter("customAttribGroupId", item.getCustomAttributeGroup().getCustomAttribGroupId());
      iterator = query.getResultList().iterator();
      boolean itemAttributeLangFlag = false;
      while (iterator.hasNext()) {
        CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) iterator.next();
        CustomAttribute customAttribute = customAttributeDetail.getCustomAttribute();
        ItemAttributeDetailDisplayForm displayForm = new ItemAttributeDetailDisplayForm();
        displayForm.setCustomAttribId(customAttribute.getCustomAttribId().toString());
        displayForm.setCustomAttribDetailId(customAttributeDetail.getCustomAttribDetailId().toString());
        displayForm.setCustomAttribName(customAttribute.getCustomAttribName());
        displayForm.setCustomAttribTypeCode(String.valueOf(customAttribute.getCustomAttribTypeCode()));
        boolean attributeExist = false;
        Iterator<?> details = item.getItemAttributeDetails().iterator();
        ItemAttributeDetail itemAttributeDetail = null;
        while (details.hasNext()) {
          itemAttributeDetail = (ItemAttributeDetail) details.next();
          if (itemAttributeDetail.getCustomAttributeDetail().getCustomAttribDetailId().equals(customAttributeDetail.getCustomAttribDetailId())) {
            attributeExist = true;
            break;
          }
        }
        if (attributeExist) {
View Full Code Here

    jsonResult.put("customAttributeGroupName", customAttributeGroup.getCustomAttribGroupName());
   
    Vector<JSONEscapeObject> vector = new Vector<JSONEscapeObject>();
    Iterator<?> iterator = customAttributeGroup.getCustomAttributeDetails().iterator();
    while (iterator.hasNext()) {
      CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) iterator.next();
      JSONEscapeObject detail = new JSONEscapeObject();
      detail.put("customAttribDetailId", customAttributeDetail.getCustomAttribDetailId());
      detail.put("seqNum", customAttributeDetail.getSeqNum().toString());
      detail.put("customAttribName", customAttributeDetail.getCustomAttribute().getCustomAttribName());
      vector.add(detail);
    }
    jsonResult.put("customAttributeDetails", vector);
    return jsonResult.toHtmlString();
  }
View Full Code Here

    Long customAttribGroupId = Format.getLong(form.getCustomAttribGroupId());
    CustomAttributeGroup customAttributeGroup = CustomAttributeGroupDAO.load(site.getSiteId(), customAttribGroupId);
    String customAttribDetailIds[] = form.getCustomAttribDetailIds();
    if (customAttribDetailIds != null) {
      for (int i = 0; i < customAttribDetailIds.length; i++) {
        CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) em.find(CustomAttributeDetail.class, Format.getLong(customAttribDetailIds[i]));
        if (customAttributeDetail.getCustomAttribute().getCustomAttribTypeCode() == Constants.CUSTOM_ATTRIBUTE_TYPE_SKU_MAKEUP) {
          String sql = "select  count(*) " +
                 "from    ItemAttributeDetail itemAttributeDetail " +
                 "where    itemAttributeDetail.customAttributeDetail = :customAttributeDetail " +
                 "and     itemAttributeDetail.item.itemTypeCd = :itemTypeCd";
          Query query = em.createQuery(sql);
View Full Code Here

    CustomAttributeGroup customAttributeGroup = (CustomAttributeGroup) em.find(CustomAttributeGroup.class, customAttribGroupId);
    int seqNum = 0;
    Iterator<?> iterator = customAttributeGroup.getCustomAttributeDetails().iterator();
    boolean found = false;
    while (iterator.hasNext()) {
      CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) iterator.next();
      if (customAttributeDetail.getCustomAttribute().getCustomAttribId().equals(customAttribute.getCustomAttribId())) {
        found = true;
      }
      if (customAttributeDetail.getSeqNum().intValue() >= seqNum) {
        seqNum = customAttributeDetail.getSeqNum() + 1;
      }
    }
   
    if (!found) {
      CustomAttributeDetail customAttributeDetail = new CustomAttributeDetail();
      customAttributeDetail.setCustomAttribute(customAttribute);
      customAttributeDetail.setSeqNum(seqNum);
      customAttributeDetail.setRecUpdateBy(adminBean.getUser().getUserId());
      customAttributeDetail.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
      customAttributeDetail.setRecCreateBy(adminBean.getUser().getUserId());
      customAttributeDetail.setRecCreateDatetime(new Date(System.currentTimeMillis()));
      customAttributeGroup.getCustomAttributeDetails().add(customAttributeDetail);
      em.persist(customAttributeDetail);
    }

    streamWebService(response, jsonResult.toHtmlString());
View Full Code Here

        streamWebService(response, jsonResult.toHtmlString());
        return null;
      }
     
      for (int i = 0; i < customAttribDetailIds.length; i++) {
        CustomAttributeDetail customAttributeDetail = (CustomAttributeDetail) em.find(CustomAttributeDetail.class, Format.getLong(customAttribDetailIds[i]));
        customAttributeDetail.setSeqNum(Format.getInt(seqNums[i]));
        em.persist(customAttributeDetail);
      }
    }

    streamWebService(response, jsonResult.toHtmlString());
View Full Code Here

            }
          }
        }
        if (!foundDetail) {
          itemAttributeDetail = new com.jada.jpa.entity.ItemAttributeDetail();
          CustomAttributeDetail customAttributeDetail = null;
          for (CustomAttributeDetail d : customAttributeGroup.getCustomAttributeDetails()) {
            CustomAttribute customAttribute = d.getCustomAttribute();
            if (itemAttributeDetailImport.getCustomAttribOptionId() != null) {
              if (itemAttributeDetailImport.getCustomAttribId() == customAttribute.getCustomAttribId()) {
                customAttributeDetail = d;
                break;
              }
            }
            else {
              if (itemAttributeDetailImport.getCustomAttribName() == customAttribute.getCustomAttribName()) {
                customAttributeDetail = d;
                break;
              }
            }
          }
          itemAttributeDetail.setCustomAttributeDetail(customAttributeDetail);
          itemAttributeDetail.setRecCreateBy(Constants.USERNAME_IMPORT);
          itemAttributeDetail.setRecCreateDatetime(new Date());
          itemAttributeDetail.setItem(item);
        }
        if (itemAttributeDetailImport.getCustomAttribId() != null) {
          for (CustomAttributeDetail customAttributeDetail : customAttributeGroup.getCustomAttributeDetails()) {
            if (customAttributeDetail.getCustomAttribute().getCustomAttribId().equals(itemAttributeDetailImport.getCustomAttribId())) {
              itemAttributeDetail.setCustomAttributeDetail(customAttributeDetail);
              break;
            }
          }
        }
        if (!Format.isNullOrEmpty(itemAttributeDetailImport.getCustomAttribName())) {
          for (CustomAttributeDetail customAttributeDetail : customAttributeGroup.getCustomAttributeDetails()) {
            if (customAttributeDetail.getCustomAttribute().getCustomAttribName().equals(itemAttributeDetailImport.getCustomAttribName())) {
              itemAttributeDetail.setCustomAttributeDetail(customAttributeDetail);
              break;
            }
          }
        }
View Full Code Here

TOP

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

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.