if (query.isObjectLevelReadQuery()) {
if(valueToApply != null) {
if (valueToApply instanceof String){
AttributeGroup eg = activeSession.getAttributeGroups().get(valueToApply);
if (eg != null){
FetchGroup fg = eg.toFetchGroup();
fg.setShouldLoadAll(true);
((ObjectLevelReadQuery)query).setFetchGroup(fg);
}else{
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("no_entity_graph_of_name", new Object[]{valueToApply}));
}