/** * INTERNAL: * Used to optimize joining by pre-computing the nested join queries for the mappings. */ public void computeBatchReadMappingQueries() { // Cannot prepare the batch queries if using inheritance, as child descriptors can have different mappings. if (hasBatchReadAttributes() && (!getDescriptor().hasInheritance())) { this.batchReadAttributes = new ArrayList(getBatchReadAttributeExpressions().size()); setBatchReadMappingQueries(new HashMap(getBatchReadAttributeExpressions().size())); computeNestedQueriesForBatchReadExpressions(getBatchReadAttributeExpressions()); } }
if (getDescriptor().hasTablePerClassPolicy()) { result = containerPolicy.concatenateContainers(result, getDescriptor().getTablePerClassPolicy().selectAllObjectsUsingMultipleTableSubclassRead(this));
/** * INTERNAL: * Prepare the receiver for execution in a session. */ protected void prepare() throws QueryException { if ((!isReportQuery()) && prepareFromCachedQuery()) { return; } super.prepare(); getContainerPolicy().prepare(this, getSession()); if (getContainerPolicy().overridesRead()) { return; } if (getDescriptor().isDescriptorForInterface()) { return; } prepareSelectAllRows(); computeBatchReadMappingQueries(); }
&& !this.descriptor.getCachePolicy().shouldIsolateObjectsInUnitOfWork() && ! this.descriptor.getCachePolicy().shouldIsolateProtectedObjectsInUnitOfWork()) || (unitOfWork.isClassReadOnly(this.getReferenceClass(), this.getDescriptor())))){ Object[] pkList = new Object[size]; for (int i = 0; i< size; ++i){ pkList[i] = getDescriptor().getObjectBuilder().extractPrimaryKeyFromRow(rows.get(i), session);
&& !this.descriptor.getCachePolicy().shouldIsolateObjectsInUnitOfWork() && ! this.descriptor.getCachePolicy().shouldIsolateProtectedObjectsInUnitOfWork()) || (unitOfWork.isClassReadOnly(this.getReferenceClass(), this.getDescriptor())))){ Object[] pkList = new Object[size]; for (int i = 0; i< size; ++i){ pkList[i] = getDescriptor().getObjectBuilder().extractPrimaryKeyFromRow(rows.get(i), session);
if (query.getDescriptor().getQueryManager().getAdditionalJoinExpression() != null) { twisted = twisted.and(query.getDescriptor().getQueryManager().getAdditionalJoinExpression().rebuildOn(builder));
ClassDescriptor descriptorToUse = query.getDescriptor(); if ((descriptorToUse != getDescriptor()) && (!descriptorToUse.getMappings().contains(this)) && (!getDescriptor().isAggregateDescriptor())) { descriptorToUse = getDescriptor();
if (batchQuery.getDescriptor().hasFetchGroupManager()) { FetchGroup sourceFetchGroup = query.getExecutionFetchGroup(); if (sourceFetchGroup != null) {
if (batchQuery.getDescriptor().hasFetchGroupManager()) { FetchGroup sourceFetchGroup = query.getExecutionFetchGroup(); if (sourceFetchGroup != null) {