/** * INTERNAL: * <P> This method is called by the object builder when building an original. * It will cause the original to be cached in the query results if the query * is set to do so. */ public void cacheResult(Object unwrappedOriginal) { Object cachableObject = unwrappedOriginal; if (shouldUseWrapperPolicy()){ cachableObject = getSession().wrapObject(unwrappedOriginal); } setTemporaryCachedQueryResults(cachableObject); }
if (shouldUseWrapperPolicy()) { clone = this.descriptor.getObjectBuilder().wrapObject(clone, unitOfWork);
if (shouldUseWrapperPolicy()) { clone = this.descriptor.getObjectBuilder().wrapObject(clone, unitOfWork);
if (shouldUseWrapperPolicy()) { clone = this.descriptor.getObjectBuilder().wrapObject(clone, unitOfWork);
if (shouldUseWrapperPolicy()) { return this.descriptor.getObjectBuilder().wrapObject(clone, unitOfWork); } else {
if (shouldUseWrapperPolicy()) { return this.descriptor.getObjectBuilder().wrapObject(clone, unitOfWork); } else {
if (shouldUseWrapperPolicy()) { return this.descriptor.getObjectBuilder().wrapObject(clone, unitOfWork); } else {
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query inlucding the translation row. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { ReadObjectQuery customReadQuery = (ReadObjectQuery)customQuery; customReadQuery.setShouldRefreshIdentityMapResult(shouldRefreshIdentityMapResult()); customReadQuery.setCascadePolicy(getCascadePolicy()); customReadQuery.setShouldMaintainCache(shouldMaintainCache()); customReadQuery.setShouldUseWrapperPolicy(shouldUseWrapperPolicy()); // CR... was missing some values, execution could cause infinite loop. customReadQuery.setQueryId(getQueryId()); customReadQuery.setExecutionTime(getExecutionTime()); customReadQuery.setShouldLoadResultIntoSelectionObject(shouldLoadResultIntoSelectionObject()); AbstractRecord primaryKeyRow; if (getSelectionObject() != null) { // CR#... Must also set the selection object as may be loading into the object (refresh) customReadQuery.setSelectionObject(getSelectionObject()); // The translation/primary key row will be set in prepareForExecution. } else if (getSelectionKey() != null) { customReadQuery.setSelectionKey(getSelectionKey()); } else { // The primary key row must be used. primaryKeyRow = customQuery.getDescriptor().getObjectBuilder().extractPrimaryKeyRowFromExpression(getSelectionCriteria(), customQuery.getTranslationRow(), customReadQuery.getSession()); customReadQuery.setTranslationRow(primaryKeyRow); } }
if (shouldUseWrapperPolicy()) { cachedObject = this.descriptor.getObjectBuilder().wrapObject(cachedObject, session);
if (shouldUseWrapperPolicy()) { cachedObject = this.descriptor.getObjectBuilder().wrapObject(cachedObject, session);
if (shouldUseWrapperPolicy()) { cachedObject = this.descriptor.getObjectBuilder().wrapObject(cachedObject, session);