For the complete documentation index, see llms.txt. This page is also available as Markdown.

Group By Mapping

For the GROUP BY clause, grouping fields typically also need to appear in the returned columns. This can be achieved by adding an annotation to the field in the view class to declare it as a grouping column, which will then be appended to the GROUP BY clause during mapping.

Example

When defining a view object, add the @GroupBy annotation to the fields used for grouping:

@GroupBy
private int returnFlag;

@GroupBy
private int lineStatus;

Fields marked with the @GroupBy annotation are mapped as:

SELECT return_flag, line_status, ... FROM ...
GROUP BY return_flag, line_status ...

Last updated