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-2193) having() method in ObjectSelect
Date Wed, 04 Jan 2017 11:47:58 GMT
Nikita Timofeev created CAY-2193:
------------------------------------

             Summary: having() method in ObjectSelect
                 Key: CAY-2193
                 URL: https://issues.apache.org/jira/browse/CAY-2193
             Project: Cayenne
          Issue Type: Sub-task
          Components: Core Library
    Affects Versions: 4.0.M5
            Reporter: Nikita Timofeev
            Assignee: Nikita Timofeev


{code}
       List<Object[]> result = ObjectSelect.query(Artist.class)
                // result
                .columns(artistCount, minSalary, namePart)
                // WHERE clause
                .where(Artist.DATE_OF_BIRTH.lt(new Date())) 
                // additional condition in WHERE clause
                .or(...)                      
                // HAVING clause
                .having(namePart.like("P%"))                
                // additional condition in HAVING clause
                .or(...)                                    
                .select(context);

        for(Object[] r : result) {
            long count = (long)r[0];
            int min = (int)r[1];
            String name = (String)r[2];
        }
{code}



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

Mime
View raw message