final XStream xstream = new XStream() {
protected MapperWrapper wrapMapper(final MapperWrapper next) {
return new HibernateMapper(next);
}
};
// configure XStream for KIE!
xstream = XStreamXML.newXStreamMarshaller(xStream);
xstream.registerConverter(new HibernateProxyConverter());
xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentMapConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentSortedMapConverter(xstream.getMapper()));
xstream.registerConverter(new HibernatePersistentSortedSetConverter(xstream.getMapper()));
Maven:
<dependency>
<groupid>com.thoughtworks.xstream</groupid>
<artifactid>xstream-hibernate</artifactid>
<version>1.4.8</version>
</dependency>