views:

107

answers:

1

I am using NetBeans 6.5.1 and Hibernate 3.2.5.

I stepped through this tutorial by using a different, existing database (Oracle 10g XE). The creation of the config file works fine, as well as the creation of the HibernateUtil.java class. The tutorial then wants me to run the reverse engeneering wizard, but this wizard does not exist. Instead I was using the "Hibernate Mapping Files and POJOs from Database".

There I have selected the tables I want to map and enabled "JDK 5 Language Features", "Domain Code" and "Hibernate XML Mappings". After selecting the package and clicking finished the "hibernate.reveng.xml" file is created and that's all.

There are no Java classes and NetBeans does not prompt me a message why nothing is created. What is wrong? Am I missing something and what should I do next?

Add: This tutorial shows how it should work with 6.5 (yeah I know,... beta). The steps to perform are exactly the steps I did, but still no classes are created.

A: 

Did you make a Hibernate.cfg.xml? I suppose so, even though I didn't read the whole tutorial to find out.As from what you are describing you are using a plugin/tool to generate mappings.

Make sure that your hibernate.cfg.xml is configured right. Saves lifetime. installing a logger would also help you point where it goes wrong. (commons-logging or log4j).

If you really want to use hibernate, use maven/ant and generate your mappings, and anything you want with HibernateTools (in maven that would be http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/ ). It will in the end, save you a lot of time and trouble. I'm not sure what netbeans uses to generate these, but I tried it in 6.8 and the results were everything but perfect, compared to what maven gave me.

toomuchcs
It seems that there has been a problem with the configuration file. Therefore I created a new project, configured it correctly and now it does work.
Marcus
Configurations can be a pain in the ass, therefor I do prefer not to be IDE-bound.
toomuchcs