Uploaded image for project: 'JDO'
  1. JDO
  2. JDO-758

What can a subquery return?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • JDO 3.1
    • JDO 3.2
    • specification
    • None

    Description

      The current spec specifies that subqueries should support ordering and grouping, suggesting that subqueries should be able to return collections of results.

      However, a Java Collection (others are not supported in JDOQL) only support size(), isEmpty() and contains(). These three functions all return scalars, furthermore, these could all be implemented easily with an additional term inside the subquery. Since the current reference implementation does not support all these functions, it should be considered whether subqueries should at all be required to return collections of objects.

      A similar argument could be made for returning persistent objects from subqueries (suggested by required support for 'unique'). Persistent objects cannot be used in the parent query, except for accessing their identity, or possibly casting them to a persistent type and access a field.

      Can anyone think of a usecase or other argument why subqueries should be able to return anything else than scalars/boolean (and possibly single persistent objects)?

      Attachments

        Activity

          People

            Unassigned Unassigned
            tilmann Tilmann Zäschke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: