private boolean isGroupBy() { if (query.isSelectStatement()) { return query.getSelectStatement().hasGroupByClause(); } return false; }
/** * Checks for group by. * * @param jpqlExpression * the jpql expression * @return true, if successful */ public static boolean hasGroupBy(JPQLExpression jpqlExpression) { if (isSelectStatement(jpqlExpression)) { return ((SelectStatement) jpqlExpression.getQueryStatement()).hasGroupByClause(); } return false; }
entity = query.getSelectStatement().hasGroupByClause() ? hits.getAt(0).sourceAsMap().get(jpaField) : hits .getAt(0).getFields().get(jpaField).getValue();
query.setAggregated(aggregationCount > 0 || query.getSelectStatement().hasGroupByClause()); int count = 0, aggCounter = 0, resultSize = size + 1 - aggregationCount; if (resultSize == 0)
|| (query.isSelectStatement() && query.getSelectStatement().hasGroupByClause()))
entity = query.getSelectStatement().hasGroupByClause() ? hits.getAt(0).sourceAsMap().get(jpaField) : hits .getAt(0).getFields().get(jpaField).getValue();
hasFollowUpClauses = hasFromClause(expression) || expression.hasWhereClause() || expression.hasGroupByClause(); expression.hasGroupByClause() || expression.hasHavingClause(); hasFollowUpClauses = hasFromClause(expression) || expression.hasWhereClause() || expression.hasGroupByClause() || expression.hasHavingClause() || expression.hasOrderByClause(); hasFollowUpClauses = hasFromClause(expression) || expression.hasWhereClause() || expression.hasGroupByClause(); expression.hasGroupByClause() || expression.hasHavingClause(); hasFollowUpClauses = hasFromClause(expression) || expression.hasWhereClause() || expression.hasGroupByClause() || expression.hasHavingClause() || expression.hasOrderByClause(); hasFollowUpClauses = expression.hasGroupByClause(); hasFollowUpClauses = expression.hasGroupByClause() ||
/** * {@inheritDoc} */ @Override public void visit(IdentificationVariable expression) { // Use ReadAllQuery if the variable of the SELECT clause expression is the base variable // Example: ReadAllQuery = SELECT e FROM Employee e // Example: ReportQuery = SELECT e FROM Department d JOIN d.employees e String variableName = expression.getVariableName(); if (queryContext.isRangeIdentificationVariable(variableName)) { if (selectStatement.hasGroupByClause() || selectStatement.hasHavingClause() || variableName != queryContext.getFirstDeclaration().getVariableName()) { initializeReportQuery(); } else { initializeReadAllQuery(); } } else { initializeReportQuery(); } }
/** * {@inheritDoc} */ @Override public void visit(IdentificationVariable expression) { // Use ReadAllQuery if the variable of the SELECT clause expression is the base variable // Example: ReadAllQuery = SELECT e FROM Employee e // Example: ReportQuery = SELECT e FROM Department d JOIN d.employees e String variableName = expression.getVariableName(); if (queryContext.isRangeIdentificationVariable(variableName)) { if (selectStatement.hasGroupByClause() || selectStatement.hasHavingClause() || variableName != queryContext.getFirstDeclaration().getVariableName()) { initializeReportQuery(); } else { initializeReadAllQuery(); } } else { initializeReportQuery(); } }
|| (query.isSelectStatement() && query.getSelectStatement().hasGroupByClause()))
/** * {@inheritDoc} */ @Override public void visit(SelectStatement expression) { if (expression.hasUnionClauses()) { expression.getUnionClauses().accept(this); } else if (expression.hasOrderByClause()) { expression.getOrderByClause().accept(this); } else if (expression.hasHavingClause()) { expression.getHavingClause().accept(this); } else if (expression.hasGroupByClause()) { expression.getGroupByClause().accept(this); } else if (expression.hasWhereClause()) { expression.getWhereClause().accept(this); } else if (expression.hasFromClause()) { expression.getFromClause().accept(this); } else { expression.getSelectClause().accept(this); } }
else if (expression.hasGroupByClause()) { expression.getGroupByClause().accept(this); if (expression.hasSpaceAfterGroupBy()) {