Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-4977

Limitation and issue with delegator.findByPrimaryKeyPartial method : returns error when partialKeyset contains PK value.

    XMLWordPrintableJSON

Details

    • Bug Crush Event - 21/2/2015

    Description

      • Issue with method:
        delegator.findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys)
      • Problem Statement:
        Above method return error when fieldsToSelect(keys) set contains any of primary key.
      • Expected Result:
        Method should return GenericValue object containing all valid fields which has been passed in fieldToSelect keyset.
      • Example:
        GenericPK genericPk = delegator.makePK("Product", UtilMisc.toMap("productId", "GZ-2644"));
        GenericValue product = delegator.findByPrimaryKeyPartial(genericPk, UtilMisc.toSet("productId", "productTypeId", "internalName", "longDescription"));
      • Response :
        org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen component://ecommerce/widget/CommonScreens.xml#xxxx: org.ofbiz.base.util.GeneralException: Error running Groovy script at location [component://ecommerce/webapp/ecommerce/WEB-INF/actions/xxxx.groovy] (In partialSelect invalid field names specified: [productId]) (Error running Groovy script at location [component://ecommerce/webapp/ecommerce/WEB-INF/actions/xxxx.groovy] (In partialSelect invalid field names specified: [productId]))
      • Where productId is completely valid field name.

      Attachments

        1. OFBIZ-4977.patch
          0.9 kB
          Sumit Pandit

        Activity

          People

            toashishvijay Ashish Vijaywargiya
            sumitp Sumit Pandit
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: