Class: VertxCassandra::Mapper

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapper.rb

Overview

It is like , but adapted for Vert.x.

Instance Method Summary (collapse)

Instance Method Details

- (void) delete(primaryKey = nil) { ... }

This method returns an undefined value.

Asynchronous delete method based on the column values of the primary key.

Parameters:

  • primaryKey (Array<Object>) (defaults to: nil)
    primary key used to find row to delete

Yields:

  • result handler

Raises:

  • (ArgumentError)

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

def delete(primaryKey=nil)
  if primaryKey.class == Array && block_given?
    return @j_del.java_method(:delete, [Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(primaryKey.map { |element| ::Vertx::Util::Utils.to_object(element) },(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling delete(#{primaryKey})"
end

- (void) get(primaryKey = nil) { ... }

This method returns an undefined value.

Asynchronous get method based on the column values of the primary key.

Parameters:

  • primaryKey (Array<Object>) (defaults to: nil)
    primary key used to retrieve row

Yields:

  • result handler

Raises:

  • (ArgumentError)

41
42
43
44
45
46
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapper.rb', line 41

def get(primaryKey=nil)
  if primaryKey.class == Array && block_given?
    return @j_del.java_method(:get, [Java::JavaUtil::List.java_class,Java::IoVertxCore::Handler.java_class]).call(primaryKey.map { |element| ::Vertx::Util::Utils.to_object(element) },(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 get(#{primaryKey})"
end

- (void) save(entity = nil) { ... }

This method returns an undefined value.

Asynchronous save method.

Parameters:

  • entity (Object) (defaults to: nil)
    object to be stored in database

Yields:

  • result handler

Raises:

  • (ArgumentError)

21
22
23
24
25
26
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-cassandra/mapper.rb', line 21

def save(entity=nil)
  if @j_arg_T.accept?(entity) && block_given?
    return @j_del.java_method(:save, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_T.unwrap(entity),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling save(#{entity})"
end