public void testApply() {
RestrictField field = new RestrictFieldBean("groups", GroupBean.class.getName(),
"id;name,1;group1,2;group2");
field.setKeyName("id");
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);