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

API to map Object[] result to POJO

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.2.M1
    • Component/s: Core Library
    • Labels:
      None

      Description

      There are several queries that can return Object[] as a result (like ColumnSelect or SQLSelect). It can be much more convenient if we can map this result to some POJO.

      API usage example:

      class MyPojo {
          String name;
          long count;
          MyPojo(Object[] data) {
              this.name = (String)data[0];
              this.count = (Long)data[1];
          }
      }
      
      List<MyPojo> result = ObjectSelect
          .columnQuery(Artist.class, Artist.ARTIST_NAME, Artist.PAINTING_ARRAY.count())
          .mapTo(MyPojo::new)
          .select(context);     
      

        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:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m