Menu

#3 Serialize ArrayList coming from a DAO

open
nobody
None
5
2010-01-06
2010-01-06
kbjones
No

Hello,

How do you serialize/unserialize a list of objects where the top level object is an ArrayList. My example would be calling a Customer DAO and it returning a list of Customers.

I would like to be able to serialize the return list without putting that list in a wrapper class. Here is an example of the output I'm looking for.
<customers>
<customer id="1"> <customerId> 132 </customerId> ... </customer>
<customer id="2"> <customerId> 123 </customerId> ... </customer>
<customer id="3"> <customerId> 321 </customerId> ... </customer>
</customers>

Discussion


Log in to post a comment.

MongoDB Logo MongoDB