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

Some entity-auto services fields doesn't have optional false in case of multiple PK's

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: 16.11.01
    • Component/s: accounting, content, marketing
    • Labels:
      None

      Description

      Some services with entity-auto doesn't have optional false in case of multiple PK's. In this cases if any of the PK is missing then sql error returns.

      Please find attached screenshot of error.

      According to my analysis of entity auto engine, Here are some cases:

      1. One primary key: Takes new sequence if PK not passed.
      2. Two primary key: Both PK should be mandatory except the case of secondary primary key (like agreementItemSeqId) where next subsequence is generated.
      3. More than two PK's, all PK's should be mandatory except the fromDate.

      Here is the list of services which need to be fixed according to above points.

      1. createAgreementItem
      2. updateAgreementItem
      3. deleteAgreementItem
      4. updateAgreementTerm
      5. deleteAgreementTerm
      6. createContentMetaData
      7. createContentPurpose
      8. createContentPurposeOperation
      9. createContentAttribute
      10. createContentRevisionItem
      11. createContentTypeAttr
      12. createDataResourceMetaData
      13. createDataResourcePurpose
      14. createSurveyTrigger
      15. createDataResourceAttribute
      16. createSalesOpportunityRole

      I am working on it and will add patch soon.

      1. OFBIZ-7519.patch
        11 kB
        Amardeep Singh Jhajj
      2. OFBIZ-7519-Screen-Shot.png
        629 kB
        Amardeep Singh Jhajj

        Issue Links

          Activity

          Hide
          amardeepsj Amardeep Singh Jhajj added a comment -

          Please find attached patch for trunk. Thanks

          Show
          amardeepsj Amardeep Singh Jhajj added a comment - Please find attached patch for trunk. Thanks
          Hide
          pandeypranay Pranay Pandey added a comment -

          Committed to Trunk r1749532. Thanks Amardeep Singh Jhajj for the contribution.

          Show
          pandeypranay Pranay Pandey added a comment - Committed to Trunk r1749532. Thanks Amardeep Singh Jhajj for the contribution.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks guys for the "generalisation", though before being totally sure about that I have to read OFBIZ-7511. I'll do tomorrow...

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks guys for the "generalisation", though before being totally sure about that I have to read OFBIZ-7511 . I'll do tomorrow...
          Hide
          pandeypranay Pranay Pandey added a comment -

          Sure thing Jacques, please take your time.

          Show
          pandeypranay Pranay Pandey added a comment - Sure thing Jacques, please take your time.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks for your comprehension Pranay

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks for your comprehension Pranay
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Please see my comment at https://issues.apache.org/jira/browse/OFBIZ-7511?focusedCommentId=15343963

          With Deepak's solution we would no longer need to put the changes you and I did

          Show
          jacques.le.roux Jacques Le Roux added a comment - Please see my comment at https://issues.apache.org/jira/browse/OFBIZ-7511?focusedCommentId=15343963 With Deepak's solution we would no longer need to put the changes you and I did
          Hide
          pandeypranay Pranay Pandey added a comment -

          Hi Jacques,

          Thanks for your comment. I don't think both of these are the same thing. The changes committed under this patch are to correct server side validations of input parameters to a service. OFBIZ-7511 is talking about enhancement in Form-Widget to enforce right client side validation.

          Show
          pandeypranay Pranay Pandey added a comment - Hi Jacques, Thanks for your comment. I don't think both of these are the same thing. The changes committed under this patch are to correct server side validations of input parameters to a service. OFBIZ-7511 is talking about enhancement in Form-Widget to enforce right client side validation.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Oops, you are right I mixed the 2 things

          Show
          jacques.le.roux Jacques Le Roux added a comment - Oops, you are right I mixed the 2 things
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          This was most needed, thanks!

          Show
          jacques.le.roux Jacques Le Roux added a comment - This was most needed, thanks!
          Hide
          pandeypranay Pranay Pandey added a comment -

          Thanks for the confirmation Jacques .

          Show
          pandeypranay Pranay Pandey added a comment - Thanks for the confirmation Jacques .
          Hide
          soledad Nicolas Malin added a comment -

          I confirm, this patch is good. When I converted simple to entity-auto I just control that we haven't regression to centralise the modification only on the engine, and with this issue you finish to correct the service definition.

          Thanks for that

          Show
          soledad Nicolas Malin added a comment - I confirm, this patch is good. When I converted simple to entity-auto I just control that we haven't regression to centralise the modification only on the engine, and with this issue you finish to correct the service definition. Thanks for that
          Hide
          pandeypranay Pranay Pandey added a comment -

          Thanks for the confirmation Nicolas.

          Show
          pandeypranay Pranay Pandey added a comment - Thanks for the confirmation Nicolas.

            People

            • Assignee:
              pandeypranay Pranay Pandey
              Reporter:
              amardeepsj Amardeep Singh Jhajj
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development