Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-4464

VCS: allow NXQL to query complex properties

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.3 GA
    • Fix Version/s: 5.5
    • Component/s: Core, Core VCS
    • Tags:
    • Impact type:
      API added
    • Upgrade notes:
      Hide

      NXQL queries can now reference any list element or complex property (including as ORDER BY clauses, and as selected values using queryAndFetch) with the following syntax:

      • foo/123 - the 123th element of the foo simple list
      • foo/* - any element of the foo simple list (multiple results)
      • foo/*5 - any element like above, but several references using the same number after * (here 5 in this example) will refer to the same value of the list
      • foo/bar - the bar property of the foo complex property
      • foo/123/bar - the bar property of the 123th element of the foo complex list
      • foo/*/bar - the bar property of any element of the foo complex list
      • foo5/*/bar - the bar property of any element like above, but several references using the same number will refer to the same element of the complex list

      Examples:
      SELECT * FROM File WHERE content/length > 0
      SELECT * FROM File WHERE content/name = 'testfile.txt'
      SELECT * FROM File ORDER BY content/length DESC
      SELECT * FROM Document WHERE tst:couple/first/firstname = 'Steve'
      SELECT * FROM Document WHERE tst:friends/0/firstname = 'John'
      SELECT * FROM Document WHERE tst:friends/*/firstname = 'John'
      SELECT * FROM Document WHERE tst:friends/*1/firstname = 'John' AND tst:friends/*1/lastname = 'Smith'
      SELECT tst:friends/*1/lastname FROM Document WHERE tst:friends/*1/firstname = 'John'
      SELECT * FROM Document WHERE dc:subjects/0 = 'something'
      SELECT * FROM Document WHERE dc:subjects/* = 'something'
      SELECT dc:subjects/*1 FROM Document WHERE dc:subjects/*1 LIKE 'abc%'

      Show
      NXQL queries can now reference any list element or complex property (including as ORDER BY clauses, and as selected values using queryAndFetch) with the following syntax: foo/123 - the 123th element of the foo simple list foo/* - any element of the foo simple list (multiple results) foo/*5 - any element like above, but several references using the same number after * (here 5 in this example) will refer to the same value of the list foo/bar - the bar property of the foo complex property foo/123/bar - the bar property of the 123th element of the foo complex list foo/*/bar - the bar property of any element of the foo complex list foo5/*/bar - the bar property of any element like above, but several references using the same number will refer to the same element of the complex list Examples: SELECT * FROM File WHERE content/length > 0 SELECT * FROM File WHERE content/name = 'testfile.txt' SELECT * FROM File ORDER BY content/length DESC SELECT * FROM Document WHERE tst:couple/first/firstname = 'Steve' SELECT * FROM Document WHERE tst:friends/0/firstname = 'John' SELECT * FROM Document WHERE tst:friends/*/firstname = 'John' SELECT * FROM Document WHERE tst:friends/*1/firstname = 'John' AND tst:friends/*1/lastname = 'Smith' SELECT tst:friends/*1/lastname FROM Document WHERE tst:friends/*1/firstname = 'John' SELECT * FROM Document WHERE dc:subjects/0 = 'something' SELECT * FROM Document WHERE dc:subjects/* = 'something' SELECT dc:subjects/*1 FROM Document WHERE dc:subjects/*1 LIKE 'abc%'

      Description

      Add a way for NXQL to be able to express queries on complex properties, and for NXQLQueryMaker to appropriately transform them to native SQL that uses JOINs.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: