/**
* INTERNAL:
* Add mandatory attributes to fetch group, create entityFetchGroup.
*/
public void prepareFetchGroup() throws QueryException {
FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager();
if (fetchGroupManager != null) {
this.entityFetchGroup = null;
if (this.fetchGroup == null) {
if (this.fetchGroupName != null) {
this.fetchGroup = fetchGroupManager.getFetchGroup(this.fetchGroupName);
} else if (this.shouldUseDefaultFetchGroup) {
this.fetchGroup = this.descriptor.getFetchGroupManager().getDefaultFetchGroup();
if (this.fetchGroup != null) {
this.entityFetchGroup = this.descriptor.getFetchGroupManager().getDefaultEntityFetchGroup();
}
}
}
if (this.fetchGroup != null) {
if (hasPartialAttributeExpressions()) {
//fetch group does not work with partial attribute reading
throw QueryException.fetchGroupNotSupportOnPartialAttributeReading();
}
if (this.entityFetchGroup == null) {
this.descriptor.getFetchGroupManager().prepareAndVerify(this.fetchGroup);
this.entityFetchGroup = fetchGroupManager.getEntityFetchGroup(this.fetchGroup);
}
}
} else {
// FetchGroupManager is null
if ((this.fetchGroup != null) || (this.fetchGroupName != null)) {