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

Dynamic join at query time in ObjectSelect

    XMLWordPrintableJSON

Details

    Description

      For complex queries there is a need to join tables that are not directly linked with root via relationship.
      Currently this can be done only in raw SQL queries (like SQLTemplate).

      We can introduce support for that in ObjectSelect.

      API can look something like this (we probably need some improvements in Property API as well):

      StringProperty<String> paintingTitle = PropertyFactory.createString("p.paintingTitle", String.class);
      ObjectSelect
          .columnQuery(Artist.class, Artist.ARTIST_NAME, paintingTitle)
          .join(Painting.class, "p", Artist.ARTIST_NAME.length().eq(paintingTitle.length()))
          .select(context);
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: