/** * INTERNAL: * Initialize fetch group */ public void initializeFetchGroup() { if (this.fetchGroup != null) { //fetch group already set. return; } //not explicitly set dynamically fetch group if (this.fetchGroupName != null) {//set pre-defined named group this.fetchGroup = getDescriptor().getFetchGroupManager().getFetchGroup(this.fetchGroupName); if (this.fetchGroup == null) { //named fetch group is not defined in the descriptor throw QueryException.fetchGroupNotDefinedInDescriptor(this.fetchGroupName); } } else {//not set fetch group at all //use the default fetch group if not explicitly turned off if (shouldUseDefaultFetchGroup()) { this.fetchGroup = getDescriptor().getDefaultFetchGroup(); } } }
/** * INTERNAL: * Return true if the query uses default properties. * This is used to determine if this query is cacheable. * i.e. does not use any properties that may conflict with another query * with the same JPQL or selection criteria. */ public boolean isDefaultPropertiesQuery() { return super.isDefaultPropertiesQuery() && (isDefaultLock()) && (!isDistinctComputed()) && (!hasAdditionalFields()) && (!hasPartialAttributeExpressions()) && (!hasNonFetchJoinedAttributeExpressions()) && (!hasFetchGroup()) && (getFetchGroupName() == null) && (shouldUseDefaultFetchGroup()); }
if (!readQuery.shouldUseDefaultFetchGroup()) { method.addLine(queryIdentifier + ".setShouldUseDefaultFetchGroup(false);");
if (!readQuery.shouldUseDefaultFetchGroup()) { method.addLine(queryIdentifier + ".setShouldUseDefaultFetchGroup(false);");
if (!readQuery.shouldUseDefaultFetchGroup()) { method.addLine(queryIdentifier + ".setShouldUseDefaultFetchGroup(false);");