I'm assuming you're using Hibernate. I don't know if you'll have issues with
iBatis. My opinion is that you're better off omitting collections from your
toString method. The reason is that if the collections are lazy-loaded, and
you call the toString method outside of the session, you could get a lazy
loading exception if the members of those collections haven't been
initialized.

You don't want something simple like log.info("My foo is: " + foo) to only
work inside of a session.

Jason


On 7/3/07, fadhli <[EMAIL PROTECTED]> wrote:

Hello there,

As we all know in appfuse2, for the persistent model, we extend the base
object and must implement equals, hashcode & toString methods.

I understand the equals and hashcode where the equals/hashCode method
should only include the members corresponding to the business/candidate
keys.

I am using commoneclipse to generate the toString() method and it include
all fields. From my understanding this method returns a concise but
informative representation that is easy for a person to read. But what about
Sets or Collections? Do we have to include it as well or omit it from our
code?

--
/fadhli

Reply via email to