put("profiles", entityDao.getAll(MenuProfile.class));
}
protected void editSetting(Entity<?> entity) {
put("profiles", entityDao.getAll(MenuProfile.class));
Menu menu = (Menu) entity;
OqlBuilder<Resource> builder = OqlBuilder.from(Resource.class, "r");
if (null != menu.getProfile() && null != menu.getProfile().getId()) {
MenuProfile profile = entityDao.get(MenuProfile.class, menu.getProfile().getId());
builder.where("exists(from r.categories as rc where rc=:category)",
profile.getCategory());
}
List<Resource> resurces = entityDao.search(builder);
Set<Resource> existResources = menu.getResources();
if (null != resurces) {
resurces.removeAll(existResources);
}
put("resources", resurces);
}