Details
-
Type: New Feature
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.4
-
Component/s: None
-
Labels:None
Description
This is a known problem that objects loaded via hibernate are
heavily proxied by CGLIB, and thus not really serializable.
Since hibernate is de-facto O/R mapping standard, this is pretty common
that such objects have to be sent to remote clients via SOAP or other
means, and somehow this is not working
( See for example: http://www.mojavelinux.com/blog/archives/2006/06/hibernate_get_out_of_my_pojo/ )
I played around with mappers / converters and it seems that I got it working.
Since my knowlege about xstream internals is pretty limited, I would like developers to review
( and maybe make it better ) my solution
Attached file is quick & dirty testcase, adapted from jtec-user
( http://www.sourceforge.net/projects/jtec/ ,
svn:https://jtec.svn.sourceforge.net/svnroot/jtec/jtec-user )
Issue Links
- duplicates
-
XSTR-226 support for Hibernate collections
Do note that if you're sanitizing objects, you're also removing the PersistentBag (implements List) etc implementations.
AFAIK the PersistentBag implements remembers what objects have been deleted.
So when you cascade to a bag(=List), it's probably a performance gain (and even optimistic locking check too?) to come back with the modified detached PersistentBag's instead of a brand new ArrayList.
Nevertheless, sanitizing will probably work.