LoadGroup loadGroup = ((ObjectLevelReadQuery)query).getLoadGroup();
if (loadGroup == null) {
loadGroup = new LoadGroup();
((ObjectLevelReadQuery)query).setLoadGroup(loadGroup);
}
loadGroup.addAttribute((String)valueToApply);
} else {
throw new IllegalArgumentException(ExceptionLocalization.buildMessage("ejb30-wrong-type-for-query-hint",new Object[]{getQueryId(query), name, getPrintValue(valueToApply)}));
}
return query;
}