Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2468

Support subqueries in Expression API

    XMLWordPrintableJSON

    Details

      Description

      Currently there is no way to use subqueries in SelectQuery or ObjectSelect.
      So we need a way to do so in Expression API.

      Simple version can be implemented like this:

      ObjectSelect<Painting> subquery = ObjectSelect.query(...);
      long count = ObjectSelect.query(Artist.class)
              .where(ExpressionFactory.exists(subquery))
              .selectCount(context);
      

      Also we need a way to use expressions from top level query in a subquery. Maybe it can be new expression (like Artist.ARTIST_NAME.enclosing())

      In a first iteration this should support EXISTS and IN subqueries.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ntimofeev Nikita Timofeev
                Reporter:
                ntimofeev Nikita Timofeev
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: