protected Observable < AsyncN1qlQueryResult > executePrepared ( final N1qlQuery query , PreparedPayload payload , CouchbaseEnvironment env , long timeout , TimeUnit timeUnit ) { PreparedN1qlQuery preparedQuery ; if ( query instanceof ParameterizedN1qlQuery ) { ParameterizedN1qlQuery pq = ( ParameterizedN1qlQuery ) query ; if ( pq . isPositional ( ) ) { preparedQuery = new PreparedN1qlQuery ( payload , ( JsonArray ) pq . statementParameters ( ) , query . params ( ) ) ; } else { preparedQuery = new PreparedN1qlQuery ( payload , ( JsonObject ) pq . statementParameters ( ) , query . params ( ) ) ; } } else { preparedQuery = new PreparedN1qlQuery ( payload , query . params ( ) ) ; } preparedQuery . setEncodedPlanEnabled ( isEncodedPlanEnabled ( ) ) ; return executeQuery ( preparedQuery , env , timeout , timeUnit ) ; }
Issues a proper N1QL EXECUTE detecting if parameters must be added to it .