views:

638

answers:

2

I've looked at some of the Eclipse and Hibernate tutorials and the ones for Hibernate2 are pretty good, pretty intuitive. Recently I tried to setup Hibernate3, using the Eclipse plugin, and failed to get the Hibernate tools to work, outside of physically moving the jar files from the plugins directory to my lib directory (I shouldn't have to do this!)

+2  A: 

I'm not sure if you are still needing an answer to your question, but our very own stackoverflow website has probably the solution you are looking for.

If that doesn't fully answer your question, then this might do the trick : "Hibernate and Eclipse Integration.

from the linked Hibernate website:

In the MANIFEST.MF file of the Hibernate plugin (which NEEDS the buddy loading), such as org.hibernate.eclipse, add a line:

Eclipse-BuddyPolicy:registered

and in the MANIFEST.MF file of your plugin project or RCP project, add the line:

Eclipse-RegisterBuddy:org.hibernate.eclipse

Important to notice the syntax - our plugin is willing to be seen by the hibernate library, using Eclipse-RegisterBuddy, and Hibernate is registering itself with Eclipse-BuddyPolicy. While this is stated clearly in the Eclipse Help (in retrospect!) it is critical to get the syntax precisely correct.

Finally, if you are using HibernateUtil as your main entry point into Hibernate, then in your plugin start method add the line:

Class.forName("myPlugin.HibernateUtil"); //full class name should go here

This works - assumption is that hibernate.cfg.xml is in the src directory of your plugin and this is in the classpath.

Hope this helps you out.

Sven
It took me a while to get back to this as I was using hibernate in a personal project. Your answer (stackoverflow link w/ solution I was looking for) was exactly what I needed. Thanks.
twokats
A: 

I recommend esyndicat. You'll have the option to add as many custom fields you want. I was just thinking about a business directory today. Good luck

marck_don