Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1851

Problem with three-way JOIN using ISCHILDNODE and reference property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Critical
    • 3.2.0.Final
    • 3.1.3.Final
    • JCR, Query
    • None

    Description

      In S-RAMP we have a use-case where this would be useful. The S-RAMP query will be something like:

      /s-ramp/wsdl/Message[@name='MyMessage']/part
      

      This should select all of the Part artifacts for the WSDL Message with the given name. If we assume there are two Parts for a particular Message, then in ModeShape we model it something like this:

      root
        |-->Message_uuid1(name='MyMessage')
              |--> Relationship(type='part', target=<multi-reference-property w/ two references)
        |-->Part_uuid1(name='Part1')
        |-->Part_uuid2(name='Part2')
      

      The attempted JCRSQL2 query to retrieve the two Part nodes is:

      SELECT DISTINCT artifact2.*
         FROM [sramp:baseArtifactType] AS artifact1
         JOIN [sramp:relationship] AS relationship1 ON ISCHILDNODE(relationship1, artifact1)
         JOIN [sramp:baseArtifactType] AS artifact2 ON relationship1.[sramp:target] = artifact2.[jcr.uuid]
         WHERE artifact1.[sramp:artifactType] = 'Message'
          AND relationship1.[sramp:type] = 'part')
      

      I have created a standalone (slimmed down) unit test that shows the behavior. See attached.

      Attachments

        Issue Links

          Activity

            People

              rhauch Randall Hauch (Inactive)
              ewittman@redhat.com Eric Wittmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: