Castor can't handle the case when you want only 1 of the fields to be an
idref but all the other ones to be full elements.

The following should work to get your idref to be output, but all
friends will be output as IDREF.

<class name="Person" identity="id">
  <field name="friend" type="Person" reference="true">
     <bind-xml location="friend" name="idref" node="attribute"/>
  </field>
</class>

--Keith
    

Spam Cut wrote:
> 
> Is there anyway to currently deal with cyclic object graphs within Castor XML? For 
> example...
> 
> ...
> Person person = new Person();
> person.addFriend(otherPerson1);
> person.addFriend(otherPerson2);
> 
> // And I'm my own friend...
> person.addFriend(person);
> ...
> 
> <person id="1">
>     <friend id="2">
>         ...
>     </friend>
>     <friend id="3">
>         ...
>     </friend>
>     <friend idref="1"/>
> </person>
> 
> =====
> [EMAIL PROTECTED]
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 
> -----------------------------------------------------------
> 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