Hi Sam,

I have not yet created mapping file for this scenario .. as i am not aware
how this will be achieved.
All the examples i have seen till now are direct one to one map between XML
and object mode.Can you please suggest me how my scenario can be achieved
... as you said "mapping elements to attributes of different objects"



Sam-1234 wrote:
> 
> Hi Pramod-
> I don't see any issue in mapping elements to attributes of different
> objects.
> Would you mind sharing your mapping file?
> 
> Thanks,
> Sam
> 
> 
> ptyagi108 wrote:
>> 
>> We are using castor mappings to convert from xml to Objects , i am having
>> following problem which i do not know how to proceed.
>> I have an object model where a class named BusinessMsgIdentification
>> holds the reference of Account object.But in the XML which i am getting
>> from other source (web service) is as given below.The problem is that
>> some of the elements under the TAG BusinessMsgIdentification in XML
>> actually map to fields in Account Object in the object model.
>> 
>> <BusinessMsgIdentification>
>>         <SID>009733</SPID>
>>         <SPProg>Abcd12345</SPProg>
>>         <MID>009656</IMID>
>>         <Style> </IMStyle>
>>         <AcctNum>0 </AcctNum>
>>         <OrigMsgID>21628755</OrigMsgID>
>>           <RecipMsgID>21618752</RecipMsgID>
>>           </BusinessMsgIdentification>
>>           
>>           
>>          
>> BusinessMsgIdentification.java has following method and fields   like,
>> 
>> 
>>    protected Account mAccount;
>>        protected String mOrigMsgID;
>>     protected String mReceipientMsgId;
>>          
>>              public String getOrigMsgID(){
>>                return mOrigMsgID;    
>>            }
>>            public void setOrigMsgID(String origMsgID){
>>                mOrigMsgID=origMsgID;
>>            }
>>            public String getReceipientMsgId(){
>>                return mReceipientMsgId;    
>>            }
>>            public void setReceipientMsgId(String receipientMsgId){
>>                mReceipientMsgId=receipientMsgId;
>>     }
>>     
>>     
>>         public Account getAccount(){
>>             return mAccount;    
>>         }
>>         public void setAccount(Account account){
>>             mAccount=account;
>>     }
>>     
>>     
>>     
>>     The problem for me is that the elements like SID,MID ,SPProg in xml
>> etc are defined in Account class in  my object model, but in XML they
>> falls within BusinessMsgIdentification TAG.BusinessMsgIdentification
>> holds a reference of Account class.
>>     
>>     Please help me with this as it is very urgent.
>>     
>>     Regards,
>>     Pramod
>> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Problem-Mapping-object-model-with-castor-tp27636855p27637391.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