Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.4.2
-
Fix Version/s: 1.4.3
-
Component/s: Compatibility
-
Labels:None
Description
Hibernate 4 moved the Persistent* classes to a different package, breaking XStream's Hibernate module. The fix is simply to change the package. However, this needs to be released as a separate module/artifact (e.g. xstream-hibernate4) to allow for use with both.
Simple use example for the attached:
final XStream xstream = new XStream() { protected MapperWrapper wrapMapper(final MapperWrapper next) { return new Hibernate4Mapper(next); } }; xstream.registerConverter(new HibernateProxyConverter()); xstream.registerConverter(new Hibernate4PersistentCollectionConverter(xstream.getMapper())); xstream.registerConverter(new Hibernate4PersistentMapConverter(xstream.getMapper())); xstream.registerConverter(new Hibernate4PersistentSortedMapConverter(xstream.getMapper())); xstream.registerConverter(new Hibernate4PersistentSortedSetConverter(xstream.getMapper()));
I've added Hibernate 4 support now to the existing module. It detects the Hibernate version it is running with on its own. Hibernate 4 will be used as dependency by default now for Java 6 or higher.