"Steven W. Rock" wrote:
> 
> Hi Everyone,
> 
> I know this question has been posted before, but I just can't find them
> in the mail archive. I've found several postings that ask the same
> question and the answer is to search the archives for previous examples.
> What exact phrase am I searching on? There is no search capability on
> the web site.

There is a search capability available on the "searchable archive",
which
is listed at the top of this page:

http://castor.exolab.org/lists.html

> Can someone please answer this question or direct me to
> the exact posting that has the examples?
> 
> I have children objects in java that have links back to a parent. This
> parent is also a child and can have links back to its parent, up to any
> level. As you can see this multi-referencing object graph can get quite
> large.
> 
> Giving the classic example suppose I have an employee class that has a
> link to a manager, who is also an employee. Let's say 50 employee's have
> the same manager. Instead of marshalling the managers employee fields
> each time for all 50 employees, I want to print the manager as the first
> employee, then all subsequent employees use an identity reference back
> to the manager in the xml document using an href reference.
> 
> I appreciate any help in this matter.


You need to use a combintation of identity and reference in the mapping
file, as such:

<class name="Employee" identity="id"...>

   <field name="id" type="string">
      <bind-xml node="attribute"/>
   </field>

   <field name="manager" type="Employee" reference="true">
     <bind-xml node="attribute"/>
   </field>

</class>


--Keith

> 
> Sincerely,
> 
> Steven W. Rock
> Rock Technologies
> 516-897-7289
> 
> 
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to