/** * Return true if the attribute is in the fetch group being tracked. * * @param attribute the attribute * @return true, if successful */ public boolean _persistence_isAttributeFetched(String attribute) { return this.fetchGroup == null || this.fetchGroup.containsAttributeInternal(attribute); }
/** * Return true if the attribute is in the fetch group being tracked. * * @param attribute the attribute * @return true, if successful */ public boolean _persistence_isAttributeFetched(String attribute) { return this.fetchGroup == null || this.fetchGroup.containsAttributeInternal(attribute); }
@Override public boolean containsAttributeInternal(String attributeName) { return wrappedFetchGroup.containsAttributeInternal(attributeName); }
/** * Return true if the attribute of the object has already been fetched */ public boolean isAttributeFetched(Object entity, String attributeName) { FetchGroup fetchGroup = ((FetchGroupTracker) entity)._persistence_getFetchGroup(); if (fetchGroup == null) { return true; } return fetchGroup.containsAttributeInternal(attributeName); }
/** * Return true if the attribute of the object has already been fetched */ public boolean isAttributeFetched(Object entity, String attributeName) { FetchGroup fetchGroup = ((FetchGroupTracker) entity)._persistence_getFetchGroup(); if (fetchGroup == null) { return true; } return fetchGroup.containsAttributeInternal(attributeName); }
protected PropertyLoadedState isLoadedByFetchGroup(Object entity, String property) { if (entity instanceof FetchGroupTracker) { FetchGroup fetchGroup = ((FetchGroupTracker) entity)._persistence_getFetchGroup(); if (fetchGroup != null) { boolean inFetchGroup = fetchGroup.containsAttributeInternal(property); if (!inFetchGroup) { // definitely not loaded return PropertyLoadedState.NO; } else { // requires additional check specific for the tier return PropertyLoadedState.UNKNOWN; } } } return PropertyLoadedState.UNKNOWN; }
/** * Force instantiation to any eager mappings. */ public void instantiateEagerMappings(Object object, AbstractSession session) { // Force instantiation to eager mappings. if (!this.eagerMappings.isEmpty()) { FetchGroup fetchGroup = null; FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { fetchGroup = fetchGroupManager.getObjectFetchGroup(object); } int size = this.eagerMappings.size(); for (int index = 0; index < size; index++) { DatabaseMapping mapping = this.eagerMappings.get(index); if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { mapping.instantiateAttribute(object, session); } } } }
/** * Force instantiation to any eager mappings. */ public void instantiateEagerMappings(Object object, AbstractSession session) { // Force instantiation to eager mappings. if (!this.eagerMappings.isEmpty()) { FetchGroup fetchGroup = null; FetchGroupManager fetchGroupManager = this.descriptor.getFetchGroupManager(); if (fetchGroupManager != null) { fetchGroup = fetchGroupManager.getObjectFetchGroup(object); } int size = this.eagerMappings.size(); for (int index = 0; index < size; index++) { DatabaseMapping mapping = this.eagerMappings.get(index); if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { mapping.instantiateAttribute(object, session); } } } }
/** * INTERNAL: * Check if the mapping is part of the partial attributes. */ public boolean shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup) { String attrName = mapping.getAttributeName(); // bug 3659145 TODO - What is this bug ref? dclarke modified this next // if block if(fetchGroup != null) { return fetchGroup.containsAttributeInternal(mapping.getAttributeName()); } return isPartialAttribute(attrName); }
/** * INTERNAL: * Check if the mapping is part of the partial attributes. */ public boolean shouldReadMapping(DatabaseMapping mapping, FetchGroup fetchGroup) { String attrName = mapping.getAttributeName(); // bug 3659145 TODO - What is this bug ref? dclarke modified this next // if block if(fetchGroup != null) { return fetchGroup.containsAttributeInternal(mapping.getAttributeName()); } return isPartialAttribute(attrName); }
public boolean isSet(String propertyName) throws DynamicException { if (fetchPropertiesManager().contains(propertyName)) { if (_persistence_getFetchGroup() != null && !_persistence_getFetchGroup().containsAttributeInternal(propertyName)) { return false; } PropertyWrapper wrapper = propertiesMap.get(propertyName); if (wrapper == null) { // properties can be added after constructor is called wrapper = new PropertyWrapper(); propertiesMap.put(propertyName, wrapper); } return wrapper.isSet(); } else { throw DynamicException.invalidPropertyName(fetchPropertiesManager().getType(), propertyName); } }
public boolean isSet(String propertyName) throws DynamicException { if (fetchPropertiesManager().contains(propertyName)) { if (_persistence_getFetchGroup() != null && !_persistence_getFetchGroup().containsAttributeInternal(propertyName)) { return false; } PropertyWrapper wrapper = propertiesMap.get(propertyName); if (wrapper == null) { // properties can be added after constructor is called wrapper = new PropertyWrapper(); propertiesMap.put(propertyName, wrapper); } return wrapper.isSet(); } else { throw DynamicException.invalidPropertyName(fetchPropertiesManager().getType(), propertyName); } }
/** * INTERNAL: * Ensure the change set is populated for cache coordination. */ public void ensureChanges() { if (this.isNew && ((this.changes == null) || this.changes.isEmpty())) { AbstractSession unitOfWork = this.unitOfWorkChangeSet.getSession(); // Full change set is only required for cache coordination, not remote. if (!unitOfWork.isRemoteUnitOfWork()) { ClassDescriptor descriptor = getDescriptor(); if ((unitOfWork != null) && (descriptor != null)) { FetchGroup fetchGroup = null; if(descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(this.cloneObject); } List mappings = descriptor.getMappings(); int mappingsSize = mappings.size(); for (int index = 0; index < mappingsSize; index++) { DatabaseMapping mapping = (DatabaseMapping)mappings.get(index); if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { addChange(mapping.compareForChange(this.cloneObject, this.cloneObject, this, unitOfWork)); } } } } } }
/** * Ensure the change set is populated for cache coordination. * * @param session current database session * @param changeSet change set to populate * @param descriptor class (relational) descriptor related to the change set */ private void ensureChanges(final AbstractSession session, final ObjectChangeSet changeSet, final ClassDescriptor descriptor) { FetchGroup fetchGroup = null; if (descriptor.hasFetchGroupManager()) { fetchGroup = descriptor.getFetchGroupManager().getObjectFetchGroup(changeSet.cloneObject); } for (DatabaseMapping mapping : descriptor.getMappings()) { if (fetchGroup == null || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { changeSet.addChange(mapping.compareForChange(changeSet.cloneObject, changeSet.cloneObject, changeSet, session)); } } }
if(fetchGroup == null || fetchGroup.containsAttributeInternal(attributeName)) { ChangeRecord changeRecord = (ChangeRecord)getChangesForAttributeNamed(attributeName); if(changeRecord != null) {
if(fetchGroup == null || fetchGroup.containsAttributeInternal(attributeName)) { ChangeRecord changeRecord = (ChangeRecord)getChangesForAttributeNamed(attributeName); if(changeRecord != null) {
if ((fetchGroup == null) || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { changes.addChange(mapping.compareForChange(clone, backUp, changes, session));
if ((fetchGroup == null) || fetchGroup.containsAttributeInternal(mapping.getAttributeName())) { changes.addChange(mapping.compareForChange(clone, backUp, changes, session));
/** * 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.containsAttributeInternal(nestedAttributeName)) { 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); } }
|| (cascadeOnly && mapping.isForeignReferenceMapping()) || (isTargetCloneOfOriginal && mapping.isCloningRequired())) && (sourceFetchGroup == null || sourceFetchGroup.containsAttributeInternal(mapping.getAttributeName()))) { mapping.mergeIntoObject(target, isUnInitialized, source, mergeManager, targetSession);