@Target(value=PARAMETER) @Retention(value=RUNTIME) @Documented public @interface Key
// 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")
public abstract String[] group
group = {}
), only a single group will be organized.public abstract String[] order
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.Copyright © 2011–2018 Asakusa Framework Team. All rights reserved.