h2/src/main/org/h2/command/dml/Query.java
/**
     * Execute the query, writing the result to the target result.
     *
     * @param limit the maximum number of rows to return
     * @param target the target result (null will return the result)
     * @return the result set (if the target is not set).
     */
Execute the query, writing the result to the target result.
@param limit the maximum number of rows to return
@param target the target result (null will return the result)
@return the result set (if the target is not set).
Execute the query writing the result to the target result . @param limit the maximum number of rows to return @param target the target result ( null will return the result ) @return the result set ( if the target is not set ) .
LocalResult query(int limit, ResultTarget target) {
        fireBeforeSelectTriggers();
        if (noCache || !session.getDatabase().getOptimizeReuseResults()) {
            return queryWithoutCache(limit, target);
        }
        Value[] params = getParameterValues();
        long now = session.getDatabase().getModificationDataId();
        if (isEverything(ExpressionVisitor.DETERMINISTIC_VISITOR)) {
            if (lastResult != null && !lastResult.isClosed() && limit == lastLimit) {
                if (sameResultAsLast(session, params, lastParameters, lastEvaluated)) {
                    lastResult = lastResult.createShallowCopy(session);
                    if (lastResult != null) {
                        lastResult.reset();
                        return lastResult;
                    }
                }
            }
        }
        lastParameters = params;
        closeLastResult();
        LocalResult r = queryWithoutCache(limit, target);
        lastResult = r;
        this.lastEvaluated = now;
        lastLimit = limit;
        return r;
    }
LocalResult query ( int limit , ResultTarget target ) { fireBeforeSelectTriggers ( ) ; if ( noCache || ! session . getDatabase ( ) . getOptimizeReuseResults ( ) ) { return queryWithoutCache ( limit , target ) ; } Value [ ] params = getParameterValues ( ) ; long now = session . getDatabase ( ) . getModificationDataId ( ) ; if ( isEverything ( ExpressionVisitor . DETERMINISTIC_VISITOR ) ) { if ( lastResult != null && ! lastResult . isClosed ( ) && limit == lastLimit ) { if ( sameResultAsLast ( session , params , lastParameters , lastEvaluated ) ) { lastResult = lastResult . createShallowCopy ( session ) ; if ( lastResult != null ) { lastResult . reset ( ) ; return lastResult ; } } } } lastParameters = params ; closeLastResult ( ) ; LocalResult r = queryWithoutCache ( limit , target ) ; lastResult = r ; this . lastEvaluated = now ; lastLimit = limit ; return r ; }
Execute the query, writing the result to the target result.
Execute the query writing the result to the target result .