These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: generate toString()
PostPosted: Fri Aug 18, 2006 11:26 pm 
Regular
Regular

Joined: Fri Mar 26, 2004 11:45 am
Posts: 75
Is there a way to force hbm2java to generate toString() methods in POJOs generated? Is it possible to configure Eclipse Hibernate plugin to do so?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 3:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
put a <meta attribute="use-in-tostring">true</meta> in hbm.xml for the fields you want to use in tostring

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 19, 2006 8:16 pm 
Regular
Regular

Joined: Fri Mar 26, 2004 11:45 am
Posts: 75
Is there a way to configure it in one place and force all fields to be printed out in toString() by default?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 20, 2006 4:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
put in the top of the hbm.xml and it will be "inherited", but do note that having that for *all* properties/collections is not very wise since it will basically load all connections recursively when youdecide to call .toString()

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.