has anyone else had a problem with references?

i'm wondering if my assumption should be true...
if i marshall an object to XML with has a reference
in it (only an ID to another object), if i unmarshall
that XML to an object will the child object be created
with only that field filled in?

ie.

public class Parent {
	private Integer id = null;
       private String name = null;
       private Child child = null;

       // setters, getters
}

public class Child {
	private Integer id = null;
       private String name = null;
       private Parent parent = null;

       //  setters, getters
}

    <class name="Parent" identity="id" key-generator="seqgen">
        <map-to xml="parent"/>
        <field name="id" type="java.lang.Integer" >
		<xml name="id" node="attribute"/>
      	 </field>
        <field name="name" type="java.lang.String">
   		<xml name="name" node="element"/>
        </field>
        <field name="child" type="Child">
		<xml name="child" node="element" reference="true"/>
        </field>
    </class>

    <class name="Child" identity="id" auto-complete="true">
        <map-to xml="child"/>
        <field name="id" type="java.lang.Integer" >
		<xml name="id" node="attribute"/>
      	 </field>
        <field name="name" type="java.lang.String" required="true">
		<xml name="name" node="element"/>
        </field>
        <field name="parent" type="Parent">
   		<xml name="parent" node="attribute" reference="true"/>
        </field>

    </class>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.427 / Virus Database: 240 - Release Date: 12/6/2002

Reply via email to