Project

General

Profile

Bug #6503

READ-XML automatically populates fields from NESTED relations

Added by Constantin Asofiei almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
High
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

History

#2 Updated by Constantin Asofiei almost 2 years ago

This test shows that a nested relation automatically allows populating the child table fields, from the parent table:

def temp-table tt1 field f0 as int xml-node-type "attribute" serialize-name "field1".
def temp-table tt2 field f1 as int xml-node-type "hidden" field f2 as char xml-node-type "attribute" serialize-name "field2".

def dataset ds1 for tt1, tt2 
    data-relation for tt1,tt2 
                  relation-fields(f0, f1) nested.

create tt1.
tt1.f0 = 10.
create tt2.
tt2.f1 = 10.
tt2.f2 = "abc".

dataset ds1:write-xml("file", "ds1.xml", true).

dataset ds1:empty-dataset().

dataset ds1:read-xml("file", "ds1.xml", "empty", ?, ?).

find first tt1.
message tt1.f0. // 10
find first tt2.
message tt2.f1 tt2.f2.  // 10 abc

I'm working on a first-pass at fixing this.

#3 Updated by Constantin Asofiei almost 2 years ago

A first pass at the fix is in 6129a/13935 - Ovidiu, please review.

What remains is more tests, like:
  • tests with REPLACE and other READ-XML modes
  • tests with other relation options (foreign-key, etc)

Also available in: Atom PDF