Module: Sequel::JDBC::Oracle

Defined in:
lib/sequel/adapters/jdbc/oracle.rb

Defined Under Namespace

Modules: DatabaseMethods Classes: Dataset

Constant Summary

JAVA_BIG_DECIMAL_CONSTRUCTOR =
java.math.BigDecimal.java_class.constructor(Java::long).method(:new_instance)

Class Method Summary collapse

Class Method Details

.OracleDecimal(r, i) ⇒ Object



20
21
22
23
24
25
26
27
28
29
# File 'lib/sequel/adapters/jdbc/oracle.rb', line 20

def self.OracleDecimal(r, i)
  if v = r.getBigDecimal(i)
    i = v.long_value
    if v == JAVA_BIG_DECIMAL_CONSTRUCTOR.call(i)
      i
    else
      BigDecimal.new(v.to_string)
    end
  end
end