Keith Visco wrote:

> Castor will not invoke your IDResolver because it can figure out the ID
> resolving by itself. 
> 
> However if I change the XML to:
> 
> <?xml version="1.0"?>
> <person-list>
>     <person id="35"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:type="manager">
>         <name>Ryan Madden</name>
>     </person>
>     <person manager="37"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> xsi:type="employee">
>         <name>Joe Smith</name>
>     </person>
> </person-list>
> 
> Castor will then invoke your IDResolver to resolve ID "37" because it
> can't resolve it on it's own.
> 
> I just re-ran my test case here and it's working fine for me.
> 
> Here is a copy of the mapping file I used:
> 
> <?xml version="1.0"?>
> <mapping>
> 
>   <class name="Manager" auto-complete="true" identity="id">
>      <field name="id" type="integer">
>         <bind-xml node="attribute"/>
>      </field>
>   </class>
> 
>   <class name="Employee" auto-complete="true">
>       <field name="manager" type="Manager">
>          <bind-xml reference="true" node="attribute"/>
>       </field>
>   </class>
> 
>   <class name="PersonList">
>     <field name="person" type="Person" collection="vector"
>        set-method="addPerson" get-method="getPerson"/>
>   </class>
> 
> </mapping>


And this is not working for me. Questions:
1) I don't have the "Manager" mapping above, since "Manager" in my case 
is an interface. Is that a problem?
2) Should this work with node="element" as well? That would be preferred.

/Rickard
-- 
Rickard �berg
Author of "Mastering RMI"
Chief Architect, TheServerSide.com
   The Middleware Company - We Build Experts!

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

Reply via email to