/** * {@inheritDoc} */ public boolean hasDelimiterAfterIdentifier(GroupByClause expression) { return expression.hasSpaceAfterGroupBy(); }
/** * {@inheritDoc} */ @Override public void visit(GroupByClauseStateObject stateObject) { if (stateObject.isDecorated()) { toText(stateObject); } else { GroupByClause expression = stateObject.getExpression(); // 'GROUP BY' appendIdentifier((expression != null) ? expression.getActualIdentifier() : GROUP_BY, GROUP_BY); if (shouldOutput(expression) || expression.hasSpaceAfterGroupBy()) { writer.append(SPACE); } // Group by items if (stateObject.hasItems()) { toStringChildren(stateObject, true); } } }
/** * {@inheritDoc} */ @Override public void visit(GroupByClause expression) { // Missing grouping items if (!expression.hasGroupByItems()) { int startPosition = position(expression) + 8 /* GROUP BY */ + (expression.hasSpaceAfterGroupBy() ? 1 : 0); addProblem(expression, startPosition, GroupByClause_GroupByItemMissing); } // Validate the separation of multiple ordering items else { validateCollectionSeparatedByComma( expression.getGroupByItems(), GroupByClause_GroupByItemEndsWithComma, GroupByClause_GroupByItemIsMissingComma ); super.visit(expression); } }
/** * {@inheritDoc} */ @Override public void visit(GroupByClause expression) { // Missing grouping items if (!expression.hasGroupByItems()) { int startPosition = position(expression) + 8 /* GROUP BY */ + (expression.hasSpaceAfterGroupBy() ? 1 : 0); addProblem(expression, startPosition, GroupByClause_GroupByItemMissing); } // Validate the separation of multiple ordering items else { validateCollectionSeparatedByComma( expression.getGroupByItems(), GroupByClause_GroupByItemEndsWithComma, GroupByClause_GroupByItemIsMissingComma ); super.visit(expression); } }