Debian Codegraph @

xstream-hibernate/src/java/com/thoughtworks/xstream/hibernate/package.html

raw
1 <!--
2 Copyright (C) 2011, 2013 XStream committers.
3 All rights reserved.
4
5 The software in this package is published under the terms of the BSD
6 style license a copy of which has been included with this distribution in
7 the LICENSE.txt file.
8
9 Created on 11. August 2011 by Joerg Schaible
10 -->
11 <body>
12 <p>Support of Hibernate enhanced collections and proxied types and Hibernate's
13 collection proxies from the Envers add-on. To drop the internals of Hibernate
14 when marshalling such objects to XStream, all converters and the mapper have to
15 be registered for the XStream instance:</p>
16 <p><code><pre>final XStream xstream = new XStream() {
17 protected MapperWrapper wrapMapper(final MapperWrapper next) {
18 return new HibernateMapper(next);
19 }
20 };
21 xstream.registerConverter(new HibernateProxyConverter());
22 xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream.getMapper()));
23 xstream.registerConverter(new HibernatePersistentMapConverter(xstream.getMapper()));
24 xstream.registerConverter(new HibernatePersistentSortedMapConverter(xstream.getMapper()));
25 xstream.registerConverter(new HibernatePersistentSortedSetConverter(xstream.getMapper()));
26 </pre></code></p>
27 </body>