@Override public boolean isSupersetOf(CoreAttributeGroup anotherGroup) { return wrappedFetchGroup.isSupersetOf(anotherGroup); }
@Override public boolean isSupersetOf(AttributeGroup anotherGroup) { return wrappedFetchGroup.isSupersetOf(anotherGroup); }
/** * INTERNAL: * Return if the cached object data is sufficiently valid against a fetch group */ public boolean isObjectValidForFetchGroup(Object object, FetchGroup fetchGroup) { FetchGroup groupInObject = ((FetchGroupTracker)object)._persistence_getFetchGroup(); return (groupInObject == null) || groupInObject.isSupersetOf(fetchGroup); }
/** * INTERNAL: * Return if the cached object data is sufficiently valid against a fetch group */ public boolean isObjectValidForFetchGroup(Object object, FetchGroup fetchGroup) { FetchGroup groupInObject = ((FetchGroupTracker)object)._persistence_getFetchGroup(); return (groupInObject == null) || groupInObject.isSupersetOf(fetchGroup); }
/** * INTERNAL: * Return if the cached object data is sufficiently valid against a fetch group */ public boolean isObjectValidForFetchGroup(Object object, FetchGroup fetchGroup) { FetchGroup groupInObject = ((FetchGroupTracker)object)._persistence_getFetchGroup(); return (groupInObject == null) || groupInObject.isSupersetOf(fetchGroup); }
/** * INTERNAL: * Union two fetch groups. */ public FetchGroup unionFetchGroups(FetchGroup first, FetchGroup second) { if ((first == null) || (second == null)) { return null; } //return the superset if applied if (first == second || first.isSupersetOf(second)) { return first; } else if (second.isSupersetOf(first)) { return second; } Set<String> unionAttributeNames = new HashSet(); unionAttributeNames.addAll(first.getAttributeNames()); unionAttributeNames.addAll(second.getAttributeNames()); return getEntityFetchGroup(unionAttributeNames); }
/** * INTERNAL: * Union two fetch groups. */ public FetchGroup unionFetchGroups(FetchGroup first, FetchGroup second) { if ((first == null) || (second == null)) { return null; } //return the superset if applied if (first == second || first.isSupersetOf(second)) { return first; } else if (second.isSupersetOf(first)) { return second; } Set<String> unionAttributeNames = new HashSet(); unionAttributeNames.addAll(first.getAttributeNames()); unionAttributeNames.addAll(second.getAttributeNames()); return getEntityFetchGroup(unionAttributeNames); }
/** * INTERNAL: * Return true if the cached object data should be written in clone. * It is used in Fetch Group case when filling in the clone from the cached object. */ public boolean shouldWriteInto(Object cachedObject, Object clone) { FetchGroup fetchGroupInTarg = ((FetchGroupTracker)clone)._persistence_getFetchGroup(); if (fetchGroupInTarg != null) { FetchGroup fetchGroupInSrc = ((FetchGroupTracker)cachedObject)._persistence_getFetchGroup(); //should write if target's fetch group is not a superset of that of the source, //or if refresh is required, should always write (either refresh or revert) data from the cache to the clones. return !fetchGroupInTarg.isSupersetOf(fetchGroupInSrc) || ((FetchGroupTracker) cachedObject)._persistence_shouldRefreshFetchGroup(); } return false; }
/** * INTERNAL: * Union two fetch groups. */ public FetchGroup unionFetchGroups(FetchGroup first, FetchGroup second) { if ((first == null) || (second == null)) { return null; } //return the superset if applied if (first.isSupersetOf(second)) { return first; } else if (second.isSupersetOf(first)) { return second; } //otherwise, union two fetch groups StringBuffer unionGroupName = new StringBuffer(first.getName()); unionGroupName.append("_"); unionGroupName.append(second.getName()); FetchGroup unionFetchGroup = new FetchGroup(unionGroupName.toString()); unionFetchGroup.addAttributes(first.getAttributes()); unionFetchGroup.addAttributes(second.getAttributes()); return unionFetchGroup; }
/** * INTERNAL: * Return true if the cached object data should be written in clone. * It is used in Fetch Group case when filling in the clone from the cached object. */ public boolean shouldWriteInto(Object cachedObject, Object clone) { FetchGroup fetchGroupInTarg = ((FetchGroupTracker)clone)._persistence_getFetchGroup(); if (fetchGroupInTarg != null) { FetchGroup fetchGroupInSrc = ((FetchGroupTracker)cachedObject)._persistence_getFetchGroup(); //should write if target's fetch group is not a superset of that of the source, //or if refresh is required, should always write (either refresh or revert) data from the cache to the clones. return !fetchGroupInTarg.isSupersetOf(fetchGroupInSrc) || ((FetchGroupTracker) cachedObject)._persistence_shouldRefreshFetchGroup(); } return false; }
/** * INTERNAL: * Return true if the cached object data should be written in clone. * It is used in Fetch Group case when filling in the clone from the cached object. */ public boolean shouldWriteInto(Object cachedObject, Object clone) { if (isPartialObject(clone)) { FetchGroup fetchGroupInSrc = ((FetchGroupTracker)cachedObject)._persistence_getFetchGroup(); FetchGroup fetchGroupInTarg = ((FetchGroupTracker)clone)._persistence_getFetchGroup(); //if the target fetch group is not null (i.e. fully fetched object) or if partially fetched, it's not a superset of that of the source, //or if refresh is required, should always write (either refresh or revert) data from the cache to the clones. return (!((fetchGroupInTarg == null) || fetchGroupInTarg.isSupersetOf(fetchGroupInSrc)) || ((FetchGroupTracker)cachedObject)._persistence_shouldRefreshFetchGroup()); } return false; }
FetchGroup targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
FetchGroup targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);
targetFetchGroup = this.descriptor.getFetchGroupManager().getObjectFetchGroup(target); if(targetFetchGroup != null) { if(!targetFetchGroup.isSupersetOf(sourceFetchGroup)) { targetFetchGroup.onUnfetchedAttribute((FetchGroupTracker)target, null);