Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) 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.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!