/** * 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()); }
method.addLine(queryIdentifier + ".setShouldUseDefaultFetchGroup(false);"); if (readQuery.getFetchGroupName() != null) { method.addLine(queryIdentifier + ".setFetchGroupName(\"" + readQuery.getFetchGroupName() + "\");"); } else if (readQuery.getFetchGroup() != null) { String fetchGroupIdentifier = readQuery.getFetchGroup().getName() + "FetchGroup";
method.addLine(queryIdentifier + ".setShouldUseDefaultFetchGroup(false);"); if (readQuery.getFetchGroupName() != null) { method.addLine(queryIdentifier + ".setFetchGroupName(\"" + readQuery.getFetchGroupName() + "\");"); } else if (readQuery.getFetchGroup() != null) { String fetchGroupIdentifier = readQuery.getFetchGroup().getName() + "FetchGroup";
method.addLine(queryIdentifier + ".setShouldUseDefaultFetchGroup(false);"); if (readQuery.getFetchGroupName() != null) { method.addLine(queryIdentifier + ".setFetchGroupName(\"" + readQuery.getFetchGroupName() + "\");"); } else if (readQuery.getFetchGroup() != null) { String fetchGroupIdentifier = readQuery.getFetchGroup().getName() + "FetchGroup";
if ((!this.descriptor.hasFetchGroupManager()) && ((getFetchGroup() != null) || (getFetchGroupName() != null))) { throw QueryException.fetchGroupValidOnlyIfFetchGroupManagerInDescriptor(this.descriptor.getJavaClassName(), getName());