Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate tool to create basic mappings based on a mysql db

Are there any tools that can look at a database, and generate the basic mapping files?

It would be great if it could take a database, and create the actual model (java classes) with annotations, but not sure if that exists?

like image 842
Blankman Avatar asked Feb 28 '23 10:02

Blankman


1 Answers

Hibernate 3 has a toolset called Hibernate Tools that provides an Eclipse plugin and an Ant task that both support Reverse Engineering:

Reverse Engineering: The most powerful feature of Hibernate Tools is a database reverse engineering tool that can generate domain model classes and Hibernate mapping files, annotated EJB3 entity beans, HTML documentation or even an entire JBoss Seam application in seconds!

...

Ant task: The Hibernate3 tools include a unified Ant task that allows you to run schema generation, mapping generation, or Java code generation as part of your build.

For the Eclipse plugin, have a look at this section of the documentation. For the Ant task, have a look at the section about reverse engineering and optionally how to control it.

Note that other IDEs also provide support for reverse engineering (see Hibernate Reverse Engineering for Netbeans 6.5 and Generating Persistence Mappings from Database Schema for IntelliJ).

like image 176
Pascal Thivent Avatar answered Mar 24 '23 11:03

Pascal Thivent