* 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).getFetchGroup();
FetchGroup fetchGroupInTarg = ((FetchGroupTracker)clone).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).shouldRefreshFetchGroup());
}
return false;
}