问题
Colleagues, how to combine together projection operator ![expr]
and filter ?[ boolean ]
.
For example I have some entity:
class User {
int age;
String name;
}
I would like select from list of Users only name of user who is elder than 30.
Standalone projection looks like:
#myArray.![name]
Standalone filtering looks like:
#myArray.?[age > 30]
So how to put it together? Thank you in advance!
回答1:
(#myArray.?[age > 30]).![name]
i.e. perform the projection on the results of the selection.
来源:https://stackoverflow.com/questions/11687484/spring-spel-combine-filter-and-projection-operations