Created project-website
[hibernate4-maven-plugin] / src / site / apt / index.apt
1 A simple plugin for generating a database-schema from Hibernate 4 mapping-annotations.
2
3   Hibernate comes with the buildin functionality, to automatically create or
4   update the database schema.
5   This functionality is configured in the session-configuraton via the
6   parameter <hbm2ddl.auto>
7   (see {{{http://docs.jboss.org/hibernate/orm/4.1/manual/en-US/html_single/#configuration-optional} Hibernate Reference Documentation - Chapter 3.4. Optional configuration properties}}).
8   But doing so
9   {{{http://stackoverflow.com/questions/221379/hibernate-hbm2ddl-auto-update-in-production} is not very wise}}, because you can easily corrupt or erase your
10   production database, if this configuration parameter slips through to your
11   production environment.
12   Alternatively, you can
13   {{{http://stackoverflow.com/questions/835961/how-to-creata-database-schema-using-hibernate} run the tools SchemaExport or SchemaUpdate by hand}}.
14   But that is not very comfortable and being used to maven you will quickly
15   long for a plugin, that does that job automatically for you, when you fire
16   up your test cases.
17
18   In the good old times, there was the
19   {{{http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/} Maven Hibernate3 Plugin}}, that does this for you.
20   But unfortunatly, this plugin is not compatible with Hibernate 4.x.
21
22   Since there does not seem to be any successor for the Maven Hibernate3 Plugin
23   and {{{http://www.google.de/search?q=hibernate4+maven+plugin} googeling}}
24   does not help, I decided to write up this simple plugin (inspired by these
25   two articles I found: {{{http://www.tikalk.com/alm/blog/schema-export-hibernate-4-and-maven} Schema Export with Hibernate 4 and Maven}} and
26   {{{http://doingenterprise.blogspot.de/2012/05/schema-generation-with-hibernate-4-jpa.html} Schema generation with Hibernate 4, JPA and Maven}}).