Class: DbDom::Xerces::TableElement

Inherits:
Object
  • Object
show all
Defined in:
lib/xerces.rb

Instance Method Summary collapse

Constructor Details

#initialize(doc, name) ⇒ TableElement

Returns a new instance of TableElement.



43
44
45
46
47
48
49
# File 'lib/xerces.rb', line 43

def initialize(doc, name)
    super(doc, "table")
    needsSyncChildren(true)
    setAttribute("name", name)
    @name = name
    @updating = false
end

Instance Method Details

#synchronizeChildrenObject



51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/xerces.rb', line 51

def synchronizeChildren
    return if @updating # avoid re-entrancy
    @updating = true
    Java::Jdbc.with_connection(ownerDocument.settings) do |conn|
        rownum = 0
        Java::Jdbc.get_rows(conn, @name) do |column_names, column_values|
            appendChild(construct_row(column_names, column_values, rownum))
            rownum += 1
        end
    end
    super
    @updating = false
end