This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate Tools: Reverse engineering behavior . . . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate Tools: Reverse engineering behavior . . ." Watch "Hibernate Tools: Reverse engineering behavior . . ." New topic

Hibernate Tools: Reverse engineering behavior . . .

Dallas Gimpel

Joined: Apr 05, 2006
Posts: 2
After years of JDBC, I've finally been given a chance to take the Hibernate plunge. We have a legacy database that resides on an AS/400 for which I'm generating entity and dao code using the Hibernate Tools plug-in for Eclipse. The following is a snippet of a Subscriber.reveng.xml file I've built:

NOTE: In the xml above, <ttable> is intentionally spelled with two Ts to prevent it from being interpreted as html. In the actual reveng.xml file, it's spelled correctly.

Among others, I used the reverse engineering feature of Hibernate Tools as part of my pro-Hibernate argument. But to my disappointment, the customizations I've added to my Subscriber.reveng.xml file seem to have no effect whatsoever on the source code produced via Hibernate Tools & Eclipse. The class specified in ttable is ignored so that the entity classes produced are Customerdb, CustomerdbHome, and CustomerdbId (with every single field in the table defined as part of a composite key). The customizations I've added for the columns -> properties and the primary key definition are also completely ignored. I realize that I can refactor the names, etc., but according to Java Persistence with Hibernate this should work.

What am I missing???

thanks in advance,
Dallas Gimpel

Joined: Apr 05, 2006
Posts: 2
Happened to come across this today . . . I had also posted my question to the Hibernate forum where it was eventually answered (thanks again, Max) so I thought I'd post a link to the resolution in case anyone else has a similar problem.
It is sorta covered in the JavaRanch Style Guide.
subject: Hibernate Tools: Reverse engineering behavior . . .
Similar Threads
I'm not able to insert record in Derby using Hibernate
Help with mapping set - Hibernate
HibernateTools Generating Wrong Code
Need help with Reverse Engineering to create JAVA objects
Reverse enginerring not creating object into POJO