views:

302

answers:

1

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?

+2  A: 

You can map the class with a custom UserType. This gives you full control over serialization and deserialization.

markusk
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