Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Create Database DTO classes from SQL file

 
Niall Loughnane
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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,

Niall
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:

http://www.wikihow.com/Generate-Hibernate-Pojo-Classes-from-DB-Tables


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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic