• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

How to use reverse engineering in my eclipse for hibernate program

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

i am using My Eclipse 8.6 and MySql workbench. and making a Hibernate-spring program. Is it possible to use reverse engineering feature in my eclipse with MySql workbench so that DAO and .hbm files can be generate. How can i do this with MySql workbench.
this is a URL of using reverse engineering in my eclipse with Derby.
http://www.myeclipseide.com/documentation/quickstarts/hibernateandspring/
 
Saloon Keeper
Posts: 28321
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you mean "take an existing database, query its schema and generate Hibernate files from it"?

There are some Hibernate tools, but last time I checked, what was available and from where were kind of confusing. Maybe they got it straightened out. For that matter, possibly the Eclipse Hibernate plugin can do what you want. I haven't had much luck with any of the ORM plugins for Eclipse, so I just do it the hard way.

Actually, since there are limits to how hard I want the job to be, what I actually do is use the Apache OpenJPA schema reverse-engineering tools. They can poll a database, create an XML file that represents the schema, and use the information to generate JPA-annotated java source code. And since Hibernate 3 implements JPA, that code can be used in a Hibernate project. With the added benefit that I don't need the ".hbm" files, since the annotations allow the single Java file to both define the ORM class and the HBM info.

As far as DAOs go, I just basically clone them, although I could create an Eclipse template and maybe some snippets.
 
What's brown and sticky? ... a stick. Or a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic