Hi All-
Below is my response xml and necessary classes which I am using to get list
of claims
<response>
<person id="p1">
        <address>
                        <state>NY</state>       
        </address>
</person>
<claim id="c1">
 <policy>
                <no>234</no>
                <status>Y</status>      
 </policy>
</claim>
<claim id="c2">
 <policy>
                <no>234</no>
                <status>Y</status>      
 </policy>
</claim>
 <billing id="b1">
        <stmt>
           <stmtdetail ClaimID="c1">
                        <code>code1</code>
                        <Bcode>code11</Bcode>
                </stmtdetail>
        </stmt>
 </billing>
<billing id="b2">
        <stmt>
           <stmtdetail ClaimID="c2">
                        <code>code1</code>
                        <Bcode>code2</Bcode>
                </stmtdetail>
        </stmt>
 </billing>
        </response>

My response class looks like below
Class Response{
Person person;
}
class Person
{
ArrayList<Claim> claims;
}
Class Claim
{
String no;
String status;
}

Issue is i am not able to get list of claims using mapping,i.e. it is null,
Is it due to the fact Claim object is nested?
My mapping to get arraylist,  
<mapping>
<class name="Response">
        <map-to xml="response"/>
        <field name="person" type="Person">
        <bind-xml name="person" location="reponse"/>
</class>
<class name="Person"><map-to xml="person"/>
<field name="claims" type="Claim" collection="arraylist">
<bind-xml="claim" node="element" location="response"/>

Ideally I would like to create is a Map of claim id="c1" as key and value of
'stmtdetail with ClaimID="c1", is it possible?
Any help is appreciated.

Thanks,
Sam
-- 
View this message in context: 
http://old.nabble.com/Issue-regd-list-and-map-tp27566124p27566124.html
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to