Nikita Timofeev created CAY-2527:
------------------------------------

             Summary: API to map Object[] result to POJO
                 Key: CAY-2527
                 URL: https://issues.apache.org/jira/browse/CAY-2527
             Project: Cayenne
          Issue Type: Task
          Components: Core Library
            Reporter: Nikita Timofeev
            Assignee: Nikita Timofeev
             Fix For: 4.2.M1


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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to