Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reverse engineering Oracle database using Hibernate Tools in Eclipse

I am using Eclipse Luna and have added the Hibernate Tools. I wanted to Reverse Engineer my Oracle database. I tried the same steps using MySQL and was successful.

I also tried Revese Engineering in Netbeans for my Oracle schema and was successful.

As I would like to develop my applications in the STS environment, I want to go with Eclipse or Spring STS. My tables were designed years before and are related to a legacy application that I would like to upgrade to Spring.

  1. In the Database Connectionsperspective I can see my Oracle database and the schemas.
  2. In the Hibernate perspective, I could generate my hibernate.cfg.xml file as below: http://pastebin.com/RDAmGukq

Here is the tutorial that I followed:
How to generate Hibernate mapping files & annotation with Hibernate Tools.

My problem is that in the Hibernate Configurations view I cannot see my Database. So if I try to proceed to generate the hibernate.reveng.xml it will generate an empty file, with no tables to generate my mapped POJOs.

What I can conclude is that my Hiberbate Configuration is failing.

Please help.

like image 622
yovan786 Avatar asked May 22 '26 14:05

yovan786


1 Answers

The best solution I came across was described in this tutorial:
How to Generate HBM (Hibernate Mapping) files and POJO (Model) Classes in Eclipse.

It worked fine. What I was doing wrong was to use the schema name in lower-case. It must be in upper-case.

like image 189
yovan786 Avatar answered May 25 '26 02:05

yovan786



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!