views:

321

answers:

2

Hi All,

I am trying to develop a wicket based web application using hibernate at the model layer with postgres DB.

I created all my tables manually and i am trying to reverse engineer the code from the tables using hibernate code generator tool downloaded from www.hibernate.org.

I have created the hibernate.cfg.xml and hibernate.reveng.xml. Also, i am able to browse the tables from Hibernate perspective.

But, when i run the code generator with exporter settings containing the options to generate Domain as well as hbm files on a specified package.. it generates nothing.

Any help is greatly appreciated.

Environment used:

Eclipse 3.5 (Galileo) Postgres 8.3-604 Wicket 1.3 workbench

~ Jegan

A: 

All,

I have worked-around/resolved the problem myself.

The actual problem was with the Hibernate code generator tool [HibernateTools-3.2.4.GA-R200905070146-H18.zip] that does not generate hbm.xml and pojo's by reverse engg method for PostgreSQL DB.

I believe the tool does not have reverse engg support for postgresql DB.

Workaround/resolution

I changed my DB to MySql and i was able to generate the hbm.xml and pojo. I have tried the same with Eclipse 3.5 Galileo and Eclipse Europa versions.

Tips

I have found a way kind of to understand whether the tool has got support for the DB that you use.

Once a console configuration is created for your application, go to hibernate perspective and expand the DB. if you are able to view the columns of the DB then the tool has got the support to generate the code.

The reason being is that, for postgreSQL it was not listing the column of the tables when browsed from hibernate perspective.

Thanks for all those who viewed my post.

~ Jegan

Jegan
A: 

The resolution is to setup your database with database and table names in lowercase, then autogeneration will work.

Also, when I faced with the same problem, I noticed that when you create database or table by pgAdmin III using query (not by wizards) then all your letters in Uppercase will become automatically in Lowercase.

AVarabei