setWithCreate 機能を使用して、ネストされたビジネス・オブジェクトの単一インスタンスを作成します。
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="Parent"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="child" type="Child"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="Child"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="grandChild" type="GrandChild"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="GrandChild"> <xsd:sequence> <xsd:element name="name" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
DataObject parent = ... DataObject child = parent.createDataObject("child"); DataObject grandchild = child.createDataObject("grandChild"); grandchild.setString("name", "Bob");
DataObject parent = ... parent.setString("child/grandchild/name", "Bob");
中間レベルのビジネス・オブジェクトを参照することなく、下位のビジネス・オブジェクト・データが設定されます。パスが無効な場合は例外が発生します。