I use Lists everywhere in my code. I'm sure I don't have to explain why. The problem though is everytime I serialize an object as XML that comes out of hibernate that contains a List it gets spit out as total garbage. For instance... an object containing a List of locations results in:
Code:
<locations class="org.hibernate.collection.PersistentBag">
<initialized>false</initialized>
<owner class="zone" reference="../.."/>
<cachedSize>-1</cachedSize>
<role>locations</role>
<key class="long">1</key>
<dirty>false</dirty>
</locations>
This is completely useless for me since it doesn't contain any of the information in the actual list. So, how do I get a REAL list out of hibernate? One that I can actually do something with that won't look like a mess when its serialized? I've searched all over the net for an answer to this one. I find lots of complaints about it but no actual solutions. I'm hoping someone has solved it here.
Thanks for all the help!