/** * Return true if the attribute is in the fetch group being tracked. */ public boolean _persistence_isAttributeFetched(String attribute) { return this.fetchGroup == null || this.fetchGroup.containsAttribute(attribute); } /**
@Override public boolean containsAttribute(String attributeNameOrPath) { return wrappedFetchGroup.containsAttribute(attributeNameOrPath); }
/** * Return true if the attribute of the object has already been fetched */ public boolean isAttributeFetched(Object object, String attributeName) { FetchGroup fetchgroup = ((FetchGroupTracker)object)._persistence_getFetchGroup(); return (fetchgroup == null) || (fetchgroup.containsAttribute(attributeName)); }
/** * INTERNAL: * Add primary key and version attributes to the passed fetch group. */ public void addMinimalFetchGroup(FetchGroup fetchGroup) { if (this.minimalFetchGroup == null) { return; } Iterator<String> it = this.minimalFetchGroup.getAttributeNames().iterator(); while(it.hasNext()) { String name = it.next(); if(!fetchGroup.containsAttribute(name)) { fetchGroup.addAttribute(name); } } }
/** * INTERNAL: * Add primary key and version attributes to the passed fetch group. */ public void addMinimalFetchGroup(FetchGroup fetchGroup) { if (this.minimalFetchGroup == null) { return; } Iterator<String> it = this.minimalFetchGroup.getAttributeNames().iterator(); while(it.hasNext()) { String name = it.next(); if(!fetchGroup.containsAttribute(name)) { fetchGroup.addAttribute(name); } } }
for(DatabaseMapping mapping : descriptor.getObjectBuilder().getPrimaryKeyMappings()) { String name = mapping.getAttributeName(); if(!nonReferenceFetchGroup.containsAttribute(name)) { nonReferenceFetchGroup.addAttribute(name); if(mapping.isForeignReferenceMapping()) { String name = mapping.getAttributeName(); if(!nonReferenceFetchGroup.containsAttribute(name)) { String lockAttribute = descriptor.getObjectBuilder().getLockAttribute(); if(lockAttribute != null) { if(!nonReferenceFetchGroup.containsAttribute(lockAttribute)) { nonReferenceFetchGroup.addAttribute(lockAttribute);
for(DatabaseMapping mapping : descriptor.getObjectBuilder().getPrimaryKeyMappings()) { String name = mapping.getAttributeName(); if(!nonReferenceFetchGroup.containsAttribute(name)) { nonReferenceFetchGroup.addAttribute(name); if(mapping.isForeignReferenceMapping()) { String name = mapping.getAttributeName(); if(!nonReferenceFetchGroup.containsAttribute(name)) { String lockAttribute = descriptor.getObjectBuilder().getLockAttribute(); if(lockAttribute != null) { if(!nonReferenceFetchGroup.containsAttribute(lockAttribute)) { nonReferenceFetchGroup.addAttribute(lockAttribute);
/** * INTERNAL: * The method adds to the passed input vector the * fields or expressions corresponding to the joins. */ public void addJoinSelectionFields(Vector fields, boolean isCustomSQL) { // executiveFetchGroup is used for warnings only - always null if no warnings logged FetchGroup executionFetchGroup = null; if(session.shouldLog(SessionLog.WARNING, SessionLog.QUERY)) { executionFetchGroup = getExecutionFetchGroup(); } for(Expression expression : getJoinedAttributeManager().getJoinedAttributeExpressions()) { addSelectionFieldsForJoinedExpression(fields, isCustomSQL, expression); // executiveFetchGroup is used for warnings only - always null if no warnings logged if(executionFetchGroup != null) { String nestedAttributeName = ((QueryKeyExpression)expression).getNestedAttributeName(); if(nestedAttributeName != null) { if(!executionFetchGroup.containsAttribute(nestedAttributeName)) { // cuba getSession().log(SessionLog.WARNING, SessionLog.QUERY, "query_has_joined_attribute_outside_fetch_group", new Object[]{toString(), nestedAttributeName}); } } } } for(Expression expression : getJoinedAttributeManager().getJoinedMappingExpressions()) { addSelectionFieldsForJoinedExpression(fields, isCustomSQL, expression); } }