Class List Method List File List

# Class: VertxSqlClient::Query

Inherits:
  Object
  - Object
  - VertxSqlClient::Query
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/query.rb

## Overview

A query.

## Direct Known Subclasses

PreparedQuery

## Instance Method Summary (collapse)

- - (void) execute { ... }
  Execute the query.
- - (::VertxSqlClient::Query) mapping(mapper = nil) { ... }
  Use the specified mapper for mapping Row to .

## Instance Method Details

### - (`void`) execute { ... }

This method returns an undefined value.

Execute the query.

Yields:

- the handler receiving the response

Raises:

- (`ArgumentError`)

    22
    23
    24
    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/query.rb', line 22

    def execute
      if block_given?
        return @j_del.java_method(:execute, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_T.wrap(ar.result) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling execute()"
    end

### - (`::VertxSqlClient::Query`) mapping(mapper = nil) { ... }

Use the specified `mapper` for mapping Row to ``.

Yields:

Returns:

- (`::VertxSqlClient::Query`)

Raises:

- (`ArgumentError`)

    31
    32
    33
    34
    35
    36
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql-client/query.rb', line 31

    def mapping(mapper=nil)
      if block_given? && mapper == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:mapping, [Java::JavaUtilFunction::Function.java_class]).call((Proc.new { |event| ::Vertx::Util::Utils.to_object(yield(::Vertx::Util::Utils.safe_create(event,::VertxSqlClient::Row))) })),::VertxSqlClient::Query,::VertxSqlClient::RowSet.j_api_type)
      end
      raise ArgumentError, "Invalid arguments when calling mapping(#{mapper})"
    end