Annotation Type Key

examples

// grouping by 'name'
@Key(group = "name")
// grouping by 'name' and 'sex'
@Key(group = { "name", "sex" })
// grouping by 'name', and sort each record by 'age' in ascending order
@Key(group = "name", order = "age ASC")
// grouping by 'name', and sort each record by 'income' in ascending order and 'age' in descending order
@Key(group = "name", order = { "income ASC", "age DESC" })
// creates the total group, and sort each record by 'count' in descending order
@Key(group = {}, order = "count DESC")

Optional Element Summary

Element Detail

group

The grouping properties.
Specifying property names into this element, this will divide all records into groups for each of the property
values. Or if it is an empty array (group = {}), only a single group will be organized.

order

The sorting properties.
Specifying property names into this element, this will sort the records in each group
by the property values in each ascending order.
Each property name can follow with ASC (ascending order) or DESC (descending order).
For details, each array element must be form of the following Order, where the ID means
the target property name:

Order:
ID
ID 'ASC'
ID 'DESC'

If this element is omitted or an empty array, the sorting order will be undefined.