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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Brad Clow
Sent: Tuesday, October 01, 2002 5:43 PM
To: [EMAIL PROTECTED]
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



-------------------------------------------------------
This sf.net email is sponsored by: DEDICATED SERVERS only $89!
Linux or FreeBSD, FREE setup, FAST network. Get your own server 
today at http://www.ServePath.com/indexfm.htm
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to