Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18730

Allow explicit joins in XWQL queries

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 12.10.6
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None
    • Difficulty:
      Unknown
    • Similar issues:

      Description

      Since XWIKI-8286 was done and even more things are possible to achieve with joins in Hibernate (e.g. XWIKI-14519), we are currently still very restricted by XWQL from performing any other type of joins other than inner joins (i.e. doc.object(Some.Class) as obj).

      There are many cases where we need to perform (left) outer joins. For example, in a livetable that displays docs with objects of class A and also columns from objects of class B (from a joined document/object), but that would still need to display the objects of type A when an association to the object B does not exist (e.g. the association is broken / document deleted OR the association is missing/empty/null).

      Note: The grammar at https://github.com/xwiki/xwiki-platform/blob/0070aa35c86b7699cce0bcf47b6834a29ce3bee3/xwiki-platform-core/xwiki-platform-query/xwiki-platform-query-jpql-parser/src/main/sablecc/JPQL.grammar#L158-L164 seems to suggest it does support explicit joins (well, at least left inner and outer joins), but I can't come up with an example that does not result in a syntax error or some random NPE during JPQL parsing.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              enygma Eduard Moraru
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: