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

API to map Object[] result to POJO

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 4.2.M1
    • Core Library
    • 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

              ntimofeev Nikita Timofeev
              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