This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Create Database DTO classes from SQL file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Create Database DTO classes from SQL file" Watch "Create Database DTO classes from SQL file" New topic

Create Database DTO classes from SQL file

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 203

im trying to create Java database DTO bean classes from a SQL file using Maven,

Has anyone recommended Maven tools for doing this or otherwise?

Thanks in Advance,

Bill Gorder

Joined: Mar 07, 2010
Posts: 1632

You would not do it from the SQL file but rather from a running database.

Hibernate tools claims to do this, but I personally have had mixed success with it in the past. It can usually give you a starting point to start tweaking from though:

The Spring Roo project does a much better job of it, but its not as straight forward to use if you are not familiar with Roo. Once again you will still most likely need to tweak a few things but most likely fewer than if you used Hibernate tools as the mappings it generates seems to be more sensible.

[How To Ask Questions][Read before you PM me]
I agree. Here's the link:
subject: Create Database DTO classes from SQL file
Similar Threads
AbstractDTO classes
Hardcoding vs. Flexibility
Discussion about Design approach being used in product companies
Hibernate ORM when using many to one mapping without class attribute
SQL benchmarking with maven