if ((getSelectionCriteria() != null) && (getSelectionKey() == null) && (getSelectionObject() == null)) { ExpressionBuilder builder = getSelectionCriteria().getBuilder(); builder.setSession(unitOfWork.getRootSession(null)); builder.setQueryClass(getReferenceClass()); Object clone = conformIndividualResult(implementation, unitOfWork, databaseRow, getSelectionCriteria(), null, buildDirectlyFromRows); if (clone == null) { return clone;
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query including the translation row. * This is used only for primary key queries, as the descriptor query manager * stores a predefined query for this query to avoid having to re-prepare and allow for customization. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { super.prepareCustomQuery(customQuery); ReadObjectQuery customReadQuery = (ReadObjectQuery)customQuery; customReadQuery.shouldRefreshIdentityMapResult = this.shouldRefreshIdentityMapResult; customReadQuery.cascadePolicy = this.cascadePolicy; customReadQuery.shouldMaintainCache = this.shouldMaintainCache; customReadQuery.shouldUseWrapperPolicy = this.shouldUseWrapperPolicy; // CR... was missing some values, execution could cause infinite loop. customReadQuery.queryId = this.queryId; customReadQuery.executionTime = this.executionTime; customReadQuery.shouldLoadResultIntoSelectionObject = this.shouldLoadResultIntoSelectionObject; AbstractRecord primaryKeyRow; if (this.selectionObject != null) { // CR#... Must also set the selection object as may be loading into the object (refresh) customReadQuery.selectionObject = this.selectionObject; // The translation/primary key row will be set in prepareForExecution. } else if (this.selectionId != null) { customReadQuery.selectionId = this.selectionId; } else { // The primary key row must be used. primaryKeyRow = customQuery.getDescriptor().getObjectBuilder().extractPrimaryKeyRowFromExpression(getSelectionCriteria(), customQuery.getTranslationRow(), customReadQuery.getSession()); customReadQuery.setTranslationRow(primaryKeyRow); } }
/** * INTERNAL: * Set the properties needed to be cascaded into the custom query including the translation row. * This is used only for primary key queries, as the descriptor query manager * stores a predefined query for this query to avoid having to re-prepare and allow for customization. */ protected void prepareCustomQuery(DatabaseQuery customQuery) { super.prepareCustomQuery(customQuery); ReadObjectQuery customReadQuery = (ReadObjectQuery)customQuery; customReadQuery.shouldRefreshIdentityMapResult = this.shouldRefreshIdentityMapResult; customReadQuery.cascadePolicy = this.cascadePolicy; customReadQuery.shouldMaintainCache = this.shouldMaintainCache; customReadQuery.shouldUseWrapperPolicy = this.shouldUseWrapperPolicy; // CR... was missing some values, execution could cause infinite loop. customReadQuery.queryId = this.queryId; customReadQuery.executionTime = this.executionTime; customReadQuery.shouldLoadResultIntoSelectionObject = this.shouldLoadResultIntoSelectionObject; AbstractRecord primaryKeyRow; if (this.selectionObject != null) { // CR#... Must also set the selection object as may be loading into the object (refresh) customReadQuery.selectionObject = this.selectionObject; // The translation/primary key row will be set in prepareForExecution. } else if (this.selectionId != null) { customReadQuery.selectionId = this.selectionId; } else { // The primary key row must be used. primaryKeyRow = customQuery.getDescriptor().getObjectBuilder().extractPrimaryKeyRowFromExpression(getSelectionCriteria(), customQuery.getTranslationRow(), customReadQuery.getSession()); customReadQuery.setTranslationRow(primaryKeyRow); } }
return Boolean.TRUE; } else { Expression selectionCriteria = getSelectionCriteria(); if (selectionCriteria != null) { AbstractRecord primaryKeyRow =
setIsCustomQueryUsed(true); } else { if (getSelectionCriteria() != null) { AbstractRecord primaryKeyRow = this.descriptor.getObjectBuilder().extractPrimaryKeyRowFromExpression(getSelectionCriteria(), translationRow, session);
null, unitOfWork, null, null); Expression selectionCriteria = getSelectionCriteria(); if ((selectionCriteria != null) && (this.selectionId == null) && (this.selectionObject == null)) { ExpressionBuilder builder = selectionCriteria.getBuilder();
null, unitOfWork, null, null); Expression selectionCriteria = getSelectionCriteria(); if ((selectionCriteria != null) && (this.selectionId == null) && (this.selectionObject == null)) { ExpressionBuilder builder = selectionCriteria.getBuilder();
useCustomQuery = Boolean.TRUE; } else { Expression selectionCriteria = getSelectionCriteria(); if (selectionCriteria != null) { AbstractRecord primaryKeyRow = this.descriptor.getObjectBuilder().extractPrimaryKeyRowFromExpression(selectionCriteria, translationRow, session);
setExpressionBuilder(getSelectionCriteria().getBuilder()); extendPessimisticLockScope(); Expression selectionCriteria = getSelectionCriteria(); if (selectionCriteria != null) { if (((this.cacheUsage == CheckCacheByPrimaryKey)
setExpressionBuilder(getSelectionCriteria().getBuilder()); extendPessimisticLockScope(); Expression selectionCriteria = getSelectionCriteria(); if (selectionCriteria != null) { if (((this.cacheUsage == CheckCacheByPrimaryKey)
/** * 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); } }
setExpressionBuilder(getSelectionCriteria().getBuilder()); extendPessimisticLockScope();