-->
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.  [ 12 posts ] 
Author Message
 Post subject: Hibernate Ant Tool (Hibernatetool) no toString/equals/hashco
PostPosted: Tue Jan 03, 2006 8:29 pm 
Newbie

Joined: Sat Oct 15, 2005 5:45 pm
Posts: 18
Hi all,

I've just come back to using Hibernate and need some advice please. The book 'Hibernate a developers notebook' explains how to use hbm2java for version 2 of Hibernate but I've finally sussed I need to use 'hibernatetool' when using version 3.

It has generated my class successfully, BUT, I am missing the toString, equals and hashCode methods. A post on this forum indicates that someone has written a patch to get this working. I've downloaded hibernate3.1, hibernate-extensions-2.1.3 and hibernateTools-3.1.0.beta2. Could you please explain how I add this new patch / functionality?

Also, minor question (hopefully), if the generated classes are re-generated everytime, where is the best place to put business logic?

Hibernate version: 3.1

Mapping documents: not required for explanation

Code between sessionFactory.openSession() and session.close(): not required for explanation

Full stack trace of any exception that occurs: not required for explanation

Name and version of the database you are using: mySQL 14.12 Distrib 5.0.18

The generated SQL (show_sql=true): not required for explanation

Debug level Hibernate log excerpt: not required for explanation


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 6:25 am 
Newbie

Joined: Wed Jan 04, 2006 5:29 am
Posts: 4
could this help ?
http://forum.hibernate.org/viewtopic.ph ... 28#2284328

regards, J.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 6:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
See http://www.hibernate.org/hib_docs/reference/en/html/toolsetguide.html#toolsetguide-s2-2

The Meta data attributes use-in-tostring, implement-equals, use-in-equals are of interest to you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 04, 2006 7:55 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
thanks david.

tomorrow (when I awake from my beauty sleep after 15 hours of travelling) i'll upload the latest docs which includes uptodate descriptions of the meta-attributes. e.g. implement-equals is not required anymore, only use-in-equals.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 1:00 pm 
Newbie

Joined: Sat Oct 15, 2005 5:45 pm
Posts: 18
Thanks everyone, the metadata stuff seems like what I need.

The documentation seems a bit all over the place - or am I just looking in the wrong places?!

Keep up the great work, Hibernate will save me a lot of time - thanks all!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 1:26 pm 
Newbie

Joined: Sat Oct 15, 2005 5:45 pm
Posts: 18
Actually I think I can answer that myself!!

It seems that the contents page is here (http://www.hibernate.org/hib_docs/v3/reference/en/html/) but my feedback would be to make this the page linked from the 'getting started' pages - from there you are currently thrown into chapter 1.

There doesn't seem to be an explanation of all the terms upfront either, so it's difficult to know about the hbm2java v3 equivalent until chapter 20! - It's not obvious that chapter 20 (Toolset Guide) is anything to do with the new hbm2java! Also no overview of Core, Annotations, Entity Manager and Tools - you have to jump around the documentation / website. Is there a glossary anywhere?

Another minor point is that when you go to the "documentation overview" page (http://www.hibernate.org/5.html) you could assume that the 'Hibernate Tools' section is the Tool guide - i.e. you might not notice the Toolset Guide is buried deep inside the Hibernate Core for Java reference documentation.

The documentation appears to be very thorough, for advanced users. Novice users (like me) struggle to know where to look because they do not know what the terminology relates to :-(


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 6:48 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I agree that we need to try and consolidate the documents and have some starting level documents for those not so familiar with the tools.

All help is appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 7:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
here is a preview of what is coming to the cvs (and release) soon...feedback/contributions very welcome ;)

http://tools.hibernate.org/~max/hibernate_tools.pdf (link will not work forever ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 10:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Excellent Max.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 5:30 am 
Newbie

Joined: Sat Oct 15, 2005 5:45 pm
Posts: 18
I'm glad that the Hibernate team have taken my comments onboard. The new documentation looks very useful! I am currently in the early stages of using Hibernate but started going down the line of using ANT builds as per the book "Hibernate - Developers Notebook", it's clear to me that I should be making more use of the Eclipse plugins.

Out of curiosity, is the Jbuilder IDE harder to write plugins for? I use JBuilder Enterprise at work, and Eclipse at home (purely licencing), but I find JBuilder more comfortable at the moment to work with - I'm just wondering why there isn't any plugin support for it. This is general across other APIs - so I think maybe JBuilder do not offer a good plugin API?

Now, I know this is somewhat off topic, but given that the Hibernate API appears to still be changing (improving), is it worth me purchasing a book or sticking to the online documentation? I notice in your banner you have the "Bible of Hibernate", I'm trying to ascertain the best way to

a) design solutions with Hibernate
b) use Hibernate v3 API
c) integrate with Eclipse
d) understand the differences with other persistence models.

By the way, I wouldn't mind a pointer to a comparison article about J2EE beans, JDO, <any others>.

One last thing, I have some documentation that I must write to document my own API, I was wondering what tools to use that enables me to generate HTML pages, PDF and RTF pages - may I ask what you use and whether you like it?

Keep up the great work.
Rob.


Top
 Profile  
 
 Post subject: Documentation feedback...
PostPosted: Sat Jan 14, 2006 6:24 am 
Newbie

Joined: Sat Oct 15, 2005 5:45 pm
Posts: 18
I've now read the documentation and found it informative. There are a couple of places where you say 'for more information refer to xyz', I'm just wondering whether you could summarise the information or provide a sample - otherwise I end up having to load up other documentation and loose my thread?

Technically it all makes perfect sense and now I can configure the Eclipse IDE which I have not been interested in doing until now - admittedly I didn't realise the full power.

I'll post back if I hit any problems during Eclipse setup - but I'm probably not doing anything with Hibernate for a few weeks.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 14, 2006 6:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
any suggestions for improvements to the docs (with some more concrete pointers) should go to our jira - thanks.

Regarding JBuilder and in general why there at not a plugin for every IDE out there:

1. There API are so different that it hurts (any ide vs any other ide)

2. Noone have stepped up willingly to develop and maintain for others IDE's even though the core is completely Eclipse free

_________________
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.  [ 12 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.