/** * INTERNAL: * Check if the target object is in the cache if possible based on the target key value. * Return null if the target key is not the primary key, or if the query is refreshing. */ @Override protected Object checkCacheForBatchKey(AbstractRecord sourceRow, Object foreignKey, Map batchObjects, ReadQuery batchQuery, ObjectLevelReadQuery originalQuery, AbstractSession session) { if (((ReadAllQuery)batchQuery).shouldRefreshIdentityMapResult() || (!((ReadAllQuery)batchQuery).shouldMaintainCache())) { return null; } // Check the cache using the source row and selection query. Object cachedObject = this.selectionQuery.checkEarlyReturn(session, sourceRow); if ((cachedObject != null) && (batchObjects != null)) { batchObjects.put(foreignKey, cachedObject); } return cachedObject; }
/** * INTERNAL: * Check if the target object is in the cache if possible based on the target key value. * Return null if the target key is not the primary key, or if the query is refreshing. */ @Override protected Object checkCacheForBatchKey(AbstractRecord sourceRow, Object foreignKey, Map batchObjects, ReadQuery batchQuery, ObjectLevelReadQuery originalQuery, AbstractSession session) { if (((ReadAllQuery)batchQuery).shouldRefreshIdentityMapResult() || (!((ReadAllQuery)batchQuery).shouldMaintainCache())) { return null; } // Check the cache using the source row and selection query. Object cachedObject = this.selectionQuery.checkEarlyReturn(session, sourceRow); if ((cachedObject != null) && (batchObjects != null)) { batchObjects.put(foreignKey, cachedObject); } return cachedObject; }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { ReadAllQuery customReadQuery = (ReadAllQuery)customQuery; customReadQuery.setContainerPolicy(getContainerPolicy()); customReadQuery.setCascadePolicy(getCascadePolicy()); customReadQuery.setShouldRefreshIdentityMapResult(shouldRefreshIdentityMapResult()); customReadQuery.setShouldMaintainCache(shouldMaintainCache()); customReadQuery.setShouldUseWrapperPolicy(shouldUseWrapperPolicy()); }
joinManager = query.getJoinedAttributeManager(); if (this.descriptor.getCachePolicy().shouldPrefetchCacheKeys() && query.shouldMaintainCache() && ! query.shouldRetrieveBypassCache()){ Object[] pkList = new Object[size]; for (int i = 0; i< size; ++i){
joinManager = query.getJoinedAttributeManager(); if (this.descriptor.getCachePolicy().shouldPrefetchCacheKeys() && query.shouldMaintainCache() && ! query.shouldRetrieveBypassCache()){ Object[] pkList = new Object[size]; for (int i = 0; i< size; ++i){
boolean quickAdd = (clones instanceof Collection) && !this.descriptor.getObjectBuilder().hasWrapperPolicy(); if (this.descriptor.getCachePolicy().shouldPrefetchCacheKeys() && shouldMaintainCache() && ! shouldRetrieveBypassCache() && ((!(unitOfWork.hasCommitManager() && unitOfWork.getCommitManager().isActive())
boolean quickAdd = (clones instanceof Collection) && !this.descriptor.getObjectBuilder().hasWrapperPolicy(); if (this.descriptor.getCachePolicy().shouldPrefetchCacheKeys() && shouldMaintainCache() && ! shouldRetrieveBypassCache() && ((!(unitOfWork.hasCommitManager() && unitOfWork.getCommitManager().isActive())
batchQuery.setShouldRefreshIdentityMapResult(query.shouldRefreshIdentityMapResult()); batchQuery.setCascadePolicy(query.getCascadePolicy()); batchQuery.setShouldMaintainCache(query.shouldMaintainCache()); if (query.hasAsOfClause()) { batchQuery.setAsOfClause(query.getAsOfClause());