cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikita Timofeev (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAY-2192) column() and columns() methods in ObjectSelect
Date Wed, 04 Jan 2017 11:45:58 GMT
Nikita Timofeev created CAY-2192:
------------------------------------

             Summary: column() and columns() methods in ObjectSelect
                 Key: CAY-2192
                 URL: https://issues.apache.org/jira/browse/CAY-2192
             Project: Cayenne
          Issue Type: Sub-task
            Reporter: Nikita Timofeev
            Assignee: Nikita Timofeev


{code}           
        // Single column
        long totalCount = ObjectSelect.query(Artist.class)
                            .column(Artist.ARTIST_COUNT)
                            .selectOne(context);
                            
        // Several columns
        List<Object[]> result = ObjectSelect.query(Artist.class)
                                    .columns(artistCount, minSalary, namePart)
                                    .select(context);
        for(Object[] r : result) {
            long count = (long)r[0];
            int min = (int)r[1];
            String namePart = (String)r[2];
        }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message