Link to home
Start Free TrialLog in
Avatar of irodov
irodov

asked on

Java-XML

Hi All,

I have a below XML using 3 DTO objects..

<?xml version="1.0" encoding="UTF-8"?>
<OrderDetails title="OrderDetails">
 <FirmBook>?</FirmBook>
 <BlockAccMnc>T25380</BlockAccMnc>
 <QuantityOnAllocations>11000</QuantityOnAllocations>
 <Date>Mon Jul 17 14:45:11 EDT 2006</Date>
 <TradeType>CA</TradeType>
 <OrderId>*</OrderId>
 <ClientID>65475</ClientID>
 <ProductType>EQ</ProductType>
 <ExecutionPoint>*</ExecutionPoint>
 <Currency>JPY</Currency>
 <BasePrincipalOnAllocations>61000</BasePrincipalOnAllocations>
 <ExecutionChannel>*</ExecutionChannel>
 <ExecutionCountry>JPN</ExecutionCountry>
 <FiI>32216031</FiI>
 <Price>5</Price>
 <GeneralProfile>*</GeneralProfile>
 <Overrides>*</Overrides>
 <Response>*</Response>
 <Quantity>5000</Quantity>
 <AllocationDetailsList>
  <AllocationId value="53187448">
   <SubAccMnc>T20202</SubAccMnc>
   <BasePrincipalOnExecutions>33000</BasePrincipalOnExecutions>
   <QuantityOnExecutions>6000</QuantityOnExecutions>
   <AllocationId>53187448</AllocationId>
   <Price>5</Price>
   <GeneralProfile>*</GeneralProfile>
   <Overrides>*</Overrides>
   <Response>*</Response>
   <Quantity>5000</Quantity>
   <ExecutionDetailsList>
    <ExecutionId value="SBALTSE?5.0">
     <AllocationBP>0</AllocationBP>
     <AllocationID>*</AllocationID>
     <AllocationQuantity>0</AllocationQuantity>
     <ExecutionId>SBALTSE?5.0</ExecutionId>
     <Price>5</Price>
     <GeneralProfile>*</GeneralProfile>
     <Overrides>*</Overrides>
     <Response>*</Response>
     <Quantity>3000</Quantity>
    </ExecutionId>
    <ExecutionId value="SBALOSE?6.0">
     <AllocationBP>0</AllocationBP>
     <AllocationID>*</AllocationID>
     <AllocationQuantity>0</AllocationQuantity>
     <ExecutionId>SBALOSE?6.0</ExecutionId>
     <Price>6</Price>
     <GeneralProfile>*</GeneralProfile>
     <Overrides>*</Overrides>
     <Response>*</Response>
     <Quantity>3000</Quantity>
    </ExecutionId>
   </ExecutionDetailsList>
  </AllocationId>
  <AllocationId value="53187454">
   <SubAccMnc>T20202</SubAccMnc>
   <BasePrincipalOnExecutions>28000</BasePrincipalOnExecutions>
   <QuantityOnExecutions>5000</QuantityOnExecutions>
   <AllocationId>53187454</AllocationId>
   <Price>6</Price>
   <GeneralProfile>*</GeneralProfile>
   <Overrides>*</Overrides>
   <Response>*</Response>
   <Quantity>6000</Quantity>
   <ExecutionDetailsList>
    <ExecutionId value="SBALTSE?5.0">
     <AllocationBP>0</AllocationBP>
     <AllocationID>*</AllocationID>
     <AllocationQuantity>0</AllocationQuantity>
     <ExecutionId>SBALTSE?5.0</ExecutionId>
     <Price>5</Price>
     <GeneralProfile>*</GeneralProfile>
     <Overrides>*</Overrides>
     <Response>*</Response>
     <Quantity>2000</Quantity>
    </ExecutionId>
    <ExecutionId value="SBALOSE?6.0">
     <AllocationBP>0</AllocationBP>
     <AllocationID>*</AllocationID>
     <AllocationQuantity>0</AllocationQuantity>
     <ExecutionId>SBALOSE?6.0</ExecutionId>
     <Price>6</Price>
     <GeneralProfile>*</GeneralProfile>
     <Overrides>*</Overrides>
     <Response>*</Response>
     <Quantity>3000</Quantity>
    </ExecutionId>
   </ExecutionDetailsList>
  </AllocationId>
 </AllocationDetailsList>
</OrderDetails>


In Java, I have a OrderDetails Object with some attributes, AllocationDetails with some attributes and ExecutionDetails with some attributes...

OrderDetails has a list of allocationDetails and allocationDetails has list of executionDetails...


I want to use this XML -- (which comes as a log from client) .. and prepare a java file -- which can automatically populate all the objects and then call other methods...

any ideas on how can I automatically build my object hiearchy based on XML ...

I am okay to use any API's that might have come up doing this-- like hibernate or springs etc..

please help accomplishing this.

regards
ASKER CERTIFIED SOLUTION
Avatar of Ajay-Singh
Ajay-Singh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mayank S
Mayank S
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial