From: Anton v. S. <an...@ap...> - 2002-10-01 22:39:53
|
I would find this useful. I rely on toString quite a bit. I assume that printToString could be added somewhere else, but would then require a session object as a parameter? Or would that be very unnatural? Design niceties aside, that would work fine for me. Would adding it to the Hibernate class be any better from a reduced-interface-clutter perspective? Anton -----Original Message----- From: hib...@li... [mailto:hib...@li...]On Behalf Of Brad Clow Sent: Tuesday, October 01, 2002 5:43 PM To: hib...@li... Subject: [Hibernate] writing the properties of a persistent object to a string i often add a toString method (that prints out the values of all properties) to my persistent objects so that i can get detailed logging of an object's state when it is loaded, saved, etc. i have just written a printToString method for the Session interface/SessionImpl class that does this dynamically, taking into account proxy's, lazy collections and PersistentEnum types, so i don't have to write & maintain the toString methods (for this purpose) anymore. i know gavin would rather the Session interface didn't grow anymore :-), but i think this may be useful for others to. comments? brad |