You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Nikita Timofeev (JIRA)" <ji...@apache.org> on 2017/01/04 11:47:58 UTC
[jira] [Created] (CAY-2193) having() method in ObjectSelect
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)