/** Evaluate just the collectionExpr */ SelectResults evaluateCollection(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { return evaluateCollection(context, null); }
/** * (Re)evaluate in the context of the current iterations through the cross-product. If this * iterator is not dependent on the current iteration, then just return the previously evaluated * collection. Otherwise, re-evaluate. Returns null if the collection itself is null or UNDEFINED */ public SelectResults evaluateCollection(ExecutionContext context) throws FunctionDomainException, TypeMismatchException, NameResolutionException, QueryInvocationTargetException { if (this.collection != UNINITIALIZED && !this.cmpIteratorDefn.isDependentOnAnyIteratorOfScopeLessThanItsOwn(context) && this.scopeID != IndexCreationHelper.INDEX_QUERY_SCOPE_ID) { return this.collection; } // limit the scope for evaluation to this RuntimeIterator: // we don't want to use this iterator or subsequent ones in the from clause // to evaluate this collection. this.collection = this.cmpIteratorDefn.evaluateCollection(context, this); if (this.collection == null) { return null; } // if we already have a more specific elementType, set it in the collection if (!this.elementType.equals(TypeUtils.OBJECT_TYPE)) { this.collection.setElementType(elementType); } else { // Asif : The elementType in the Collection obtained is more // specific . So use that type. this.elementType = collection.getCollectionType().getElementType(); } return this.collection; }