Friday May 26, 2006
Hibernate EntityManager library for Netbeans 5.5 Today, I wanted to use Hibernate EntityManager in one project. I downloaded Hibernate EntityManager from official pages. Then unziped the file and just used all jars in my project. However, I got NoClassDefFoundError when executed my project. I asked on Hibernate forum and got very quick response that Hibernate core is required for using Hibernate EntityManager. Thanks steckemetz for you hint.
Many jars are needed for running Hibernate on your project and it's not simple to find out all jars on Hibernate pages. Therefore, I decided to create Hibernate EntityManager library for NetBeans 5.5 that includes all required jars and JavaDoc as well. You can download NetBeans nbm here.
Install this nbm in NetBeans 5.5 and you can see new library in Tools - Library Manager. Now, let's use it. It's really simple. If you want to develop application that uses Hibernate as O/R framework you can follow same steps as for TopLink that is bundled with NetBeans by default.
Create new application, you can choose J2SE project, web or EJb project and then create new persistence unit. In this wizard choose Hibernate as Persistence Library and generate persistence.xml.

