title: How to Serialize Hibernate Collections Properly?
body: <p>I'm trying to serialize objects from a database that have been retrieved with Hibernate, and I'm only interested in the objects' actual data in its entirety (cycles included).</p>
  
  <p>Now I've been working with <a href="http://xstream.codehaus.org/" rel="nofollow noreferrer">XStream</a>, which seems powerful. The problem with XStream is that it looks all too blindly on the information. It recognizes Hibernate's PersistentCollections as they are, with all the Hibernate metadata included. I don't want to serialize those.</p>
  
  <p>So, is there a reasonable way to extract the original Collection from within a PersistentCollection, and also initialize all referring data the objects might be pointing to. Or can you recommend me to a better approach?</p>
  
  <p>(The results from <a href="http://simple.sourceforge.net/" rel="nofollow noreferrer">Simple</a> seem perfect, but it can't cope with such basic util classes as Calendar. It also accepts only one annotated object at a time)</p>