4

Im using Netbeans 7.3, Windows 7, Postgres 9.2,
I created a Java Web project with Hibernate 3.2.5 (driver = postgresql-9.2-1002.jdbc4)

I added the new project with the postgres database info,
after I created the reverse engineering file with the NetBeans tool
and finally I used the Wizard "Hibernate Mapping Files and POJOS from Database..."
and it doesn't create the classes,
I tested it with MySql and It works prefect.

The problem is when I use Hibernate with Postgres.

2
  • "Hibernate 3.2.5". Um. What? Why use an ancient patch release of an ancient major version of Hibernate rather than the latest in the 3.x series or preferably Hibernate 4? You're missing years of bugfixes. Commented May 13, 2013 at 7:14
  • I updated my hibernate version to the last one and I still have the problem Commented May 14, 2013 at 5:04

4 Answers 4

1

I use this same environment (except for the Hibernate version).

When you go to the Services tab under Databases, does your JDBC connection to Postgres appear? If so, can you successfully connect to it an execute a query?

Under the 'New Hibernate Mapping Files and POJOS from Database' dialog, I assume you have the Code Generation Settings for Domain Code selected as well.

And .. does your hibernate.reveng.xml file have entries for elements? These map 1:1 to tables in your database.

Sign up to request clarification or add additional context in comments.

1 Comment

yes, I'm able to see the JDBC connection and I can execute queries and my hibernate.reveng.xml file have my table entry
0

Uh,in your connect db ,must design database name , like jdbc:mysql://ip:3306/yourdb?useUnicode=true&characterEncoding=utf8 ,when reverse chose table one by one. try

Comments

0

Remember that Hibernate is case sensitive, but Netbeans, when you use the "Hibernate configuration wizard", and the "Hibernate Reverse Engeenering" creates de files with the database name in lowcase. If you change both files (xxxxxxx.cfg.xml and xxxxxxx.reveng.xml) I think it will work fine.

Regards

Comments

0

In the File "hibernate.reveng.xml" delete the match-schema="mybd" clause

  <schema-selection match-catalog="mybd" match-schema="mybd"/>

Tested on netbeans 8.2 linux

src here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.