protected void setTargetFetchGroupIfNull(Object target, FetchGroup sourceFetchGroup, AbstractSession targetSession) { this.descriptor.getFetchGroupManager().setObjectFetchGroup(target, sourceFetchGroup, targetSession); } //cuba end
/** * INTERNAL: * Copy fetch group reference from the source object to the target */ public void copyFetchGroupInto(Object source, Object target, AbstractSession session) { if (isPartialObject(source)) { setObjectFetchGroup(target, ((FetchGroupTracker)source)._persistence_getFetchGroup(), session); } }
/** * INTERNAL: * Copy fetch group reference from the source object to the target */ public void copyFetchGroupInto(Object source, Object target, AbstractSession session) { if (isPartialObject(source)) { setObjectFetchGroup(target, ((FetchGroupTracker)source)._persistence_getFetchGroup(), session); } }
/** * INTERNAL: * Union the fetch group of the domain object with the new fetch group. */ public void unionFetchGroupIntoObject(Object source, FetchGroup newFetchGroup, AbstractSession session) { setObjectFetchGroup(source, unionFetchGroups(((FetchGroupTracker)source)._persistence_getFetchGroup(), newFetchGroup), session); }
/** * INTERNAL: * Union the fetch group of the domain object with the new fetch group. */ public void unionEntityFetchGroupIntoObject(Object source, EntityFetchGroup newEntityFetchGroup, AbstractSession session, boolean shouldClone) { //this order is important as we need to be merging into the target fetchgroup setObjectFetchGroup(source, flatUnionFetchGroups(newEntityFetchGroup, ((FetchGroupTracker)source)._persistence_getFetchGroup(), shouldClone), session); }
/** * INTERNAL: * Union the fetch group of the domain object with the new fetch group. */ public void unionEntityFetchGroupIntoObject(Object source, EntityFetchGroup newEntityFetchGroup, AbstractSession session, boolean shouldClone) { //this order is important as we need to be merging into the target fetchgroup setObjectFetchGroup(source, flatUnionFetchGroups(newEntityFetchGroup, ((FetchGroupTracker)source)._persistence_getFetchGroup(), shouldClone), session); }
/** * INTERNAL: * Copy fetch group reference from the source object to the target */ public void copyFetchGroupInto(Object source, Object target, AbstractSession session) { if (isPartialObject(source)) { setObjectFetchGroup(target, ((FetchGroupTracker)source)._persistence_getFetchGroup(), session); } }
/** * INTERNAL: * Copy fetch group reference from the source object to the target */ public void copyAggregateFetchGroupInto(Object source, Object target, Object rootEntity, AbstractSession session) { if (isPartialObject(source)) { FetchGroup newGroup = ((FetchGroupTracker)source)._persistence_getFetchGroup().clone(); // must clone because original is linked to orig root newGroup.setRootEntity((FetchGroupTracker) rootEntity); setObjectFetchGroup(target, newGroup, session); } }
/** * INTERNAL: * Copy fetch group reference from the source object to the target */ public void copyAggregateFetchGroupInto(Object source, Object target, Object rootEntity, AbstractSession session) { if (isPartialObject(source)) { FetchGroup newGroup = ((FetchGroupTracker)source)._persistence_getFetchGroup().clone(); // must clone because original is linked to orig root newGroup.setRootEntity((FetchGroupTracker) rootEntity); setObjectFetchGroup(target, newGroup, session); } }
setObjectFetchGroup(workingClone, union, uow); if (workingClone != backupClone) { setObjectFetchGroup(backupClone, union, uow);
setObjectFetchGroup(workingClone, union, uow); if (workingClone != backupClone) { setObjectFetchGroup(backupClone, union, uow);
setObjectFetchGroup(workingClone, union, uow); if (workingClone != backupClone) { setObjectFetchGroup(backupClone, union, uow);
(new FetchGroupManager()).setObjectFetchGroup(entity, fetchGroup, null); ((FetchGroupTracker) entity)._persistence_setSession(JpaHelper.getDatabaseSession(getEmf())); } else if (descriptor.hasRelationships()) {
(new FetchGroupManager()).setObjectFetchGroup(entity, fetchGroup, null); ((FetchGroupTracker) entity)._persistence_setSession(JpaHelper.getDatabaseSession(getEmf())); } else if (descriptor.hasRelationships()) {
this.descriptor.getFetchGroupManager().setObjectFetchGroup(target, sourceFetchGroup, targetSession);
this.descriptor.getFetchGroupManager().setObjectFetchGroup(target, sourceFetchGroup, targetSession);
this.descriptor.getFetchGroupManager().setObjectFetchGroup(target, sourceFetchGroup, targetSession);
/** * Clean up the cached object data and only revert the fetch group data back to the cached object. */ private void revertFetchGroupData(Object domainObject, ClassDescriptor concreteDescriptor, CacheKey cacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, AbstractSession session, boolean targetIsProtected) { FetchGroup fetchGroup = query.getExecutionFetchGroup(concreteDescriptor); FetchGroupManager fetchGroupManager = concreteDescriptor.getFetchGroupManager(); //the cached object is either invalidated, or staled as the version is newer, or a refresh is explicitly set on the query. //clean all data of the cache object. fetchGroupManager.reset(domainObject); //set fetch group reference to the cached object fetchGroupManager.setObjectFetchGroup(domainObject, fetchGroupManager.getEntityFetchGroup(fetchGroup), session); // Bug 276362 - set the CacheKey's read time (to re-validate the CacheKey) before buildAttributesIntoObject is called cacheKey.setReadTime(query.getExecutionTime()); //read in the fetch group data only concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject, cacheKey, databaseRow, query, joinManager, fetchGroup, false, session); //set refresh on fetch group fetchGroupManager.setRefreshOnFetchGroupToObject(domainObject, (query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache())); //set query id to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); //register the object into the IM and set the write lock object if applied. if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow, session)); } }
/** * Clean up the cached object data and only revert the fetch group data back to the cached object. */ private void revertFetchGroupData(Object domainObject, ClassDescriptor concreteDescriptor, CacheKey cacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, AbstractSession session, boolean targetIsProtected) { FetchGroup fetchGroup = query.getExecutionFetchGroup(concreteDescriptor); FetchGroupManager fetchGroupManager = concreteDescriptor.getFetchGroupManager(); //the cached object is either invalidated, or staled as the version is newer, or a refresh is explicitly set on the query. //clean all data of the cache object. fetchGroupManager.reset(domainObject); //set fetch group reference to the cached object fetchGroupManager.setObjectFetchGroup(domainObject, fetchGroupManager.getEntityFetchGroup(fetchGroup), session); // Bug 276362 - set the CacheKey's read time (to re-validate the CacheKey) before buildAttributesIntoObject is called cacheKey.setReadTime(query.getExecutionTime()); //read in the fetch group data only concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject, cacheKey, databaseRow, query, joinManager, fetchGroup, false, session); //set refresh on fetch group fetchGroupManager.setRefreshOnFetchGroupToObject(domainObject, (query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache())); //set query id to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); //register the object into the IM and set the write lock object if applied. if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow, session)); } }
/** * Clean up the cached object data and only revert the fetch group data back to the cached object. */ private void revertFetchGroupData(Object domainObject, ClassDescriptor concreteDescriptor, CacheKey cacheKey, ObjectBuildingQuery query, JoinedAttributeManager joinManager, AbstractRecord databaseRow, AbstractSession session) { //the cached object is either invalidated, or staled as the version is newer, or a refresh is explicitly set on the query. //clean all data of the cache object. concreteDescriptor.getFetchGroupManager().reset(domainObject); //set fetch group reference to the cached object concreteDescriptor.getFetchGroupManager().setObjectFetchGroup(domainObject, query.getFetchGroup(), session); // Bug 276362 - set the CacheKey's read time (to re-validate the CacheKey) before buildAttributesIntoObject is called cacheKey.setReadTime(query.getExecutionTime()); //read in the fetch group data only concreteDescriptor.getObjectBuilder().buildAttributesIntoObject(domainObject, databaseRow, query, joinManager, false); //set refresh on fetch group concreteDescriptor.getFetchGroupManager().setRefreshOnFetchGroupToObject(domainObject, (query.shouldRefreshIdentityMapResult() || concreteDescriptor.shouldAlwaysRefreshCache())); //set query id to prevent infinite recursion on refresh object cascade all cacheKey.setLastUpdatedQueryId(query.getQueryId()); //register the object into the IM and set the write lock object if applied. if (concreteDescriptor.usesOptimisticLocking()) { OptimisticLockingPolicy policy = concreteDescriptor.getOptimisticLockingPolicy(); cacheKey.setWriteLockValue(policy.getValueToPutInCache(databaseRow, session)); } }