Mapping files and POJOS from the database for post-heating, not working

I am 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 a new project with information about the postgres database,
after creating reverse engineering file using NetBeans tool
and finally I used the wizard "Hibernate Mapping Files and POJOS from the database ..."
and he does not create classes,
I tested it with MySql and it works as a prefect.

The problem is that I am using Hibernate with Postgres.

+4
source share
3 answers

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

When you go to the Services tab in the Databases section, does your JDBC connection with Postgres appear? If so, can you successfully connect to it, do the query?

In the "New Hibernate Mapping Files and POJOS from Database" dialog box, I assume that you also set the code generation options for the domain code.

And .. does your hibernate.reveng.xml file have entries for the elements? These cards are 1: 1 for tables in your database.

+1
source

Uh, in your db connection, should create a database name like jdbc: mysql: // ip: 3306 / yourdb? useUnicode = true & characterEncoding = utf8 when the reverse selects the table one by one. try

0
source

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

Hello

0
source

Source: https://habr.com/ru/post/1480415/


All Articles