field.setPropertyNames("name");
RestrictEntity entity = new RestrictEntityBean("user", User.class);
entity.getFields().add(field);
RestrictPattern pattern = new RestrictPatternBean(entity,
"exists(from {alias}.groups as g where g.group in(:groups))");
Restriction restriction = new UserRestrictionBean(null, pattern);
restriction.setItem(field, "id;name,1;group1");
OqlBuilder<User> builder = OqlBuilder.from(User.class);
restrictionService.apply(builder, CollectUtils.newArrayList(restriction));
Query<User> query = builder.build();
String statement = query.getStatement();
Map<?, ?> params = query.getParams();