Is there a way to hook up a callback method to be called when an object is deserialized from Hibernate. Similiar to Java's readResolve() method for Java object serialization?
views:
302answers:
1
+2
Q:
How do I restore a transient field in Hibernate like readResolve() for hibernate serialization?
+2
A:
You can map the class with a custom UserType. This gives you full control over serialization and deserialization.
markusk
2009-05-23 07:57:59
Thanks that's definitely the most flexible and best practice solution I'll try that out. I've just been using lazy initialization to try to reconstruct my deserialized hibernate objects (but that's not the clearest/cleanest code)
Dougnukem
2009-05-23 14:09:03