Hi,
I'm searching for a tool to generate SQL CREATE TABLE and those statements from Hibernate Mapping files (*.hbm.xml) for a MySQL 5 database.
Are there solutions for that?
Thanks in advance.
Hibernate version: 3
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="de.tfhberlin.eclipsophone.server.beans" auto-import="true">
<class name="User" table="Users">
<id name="id" column="id" type="long" unsaved-value="0">
<generator class="native"/>
</id>
<property name="name" column="name" type="string"/>
<property name="password" column="password" type="string"/>
<set name="subscribed_groups" table="UserGroups" inverse="true">
<key column="user_id"/>
<many-to-many class="Group" column="group_id"/>
</set>
</class>
</hibernate-mapping>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="de.tfhberlin.eclipsophone.server.beans" auto-import="true">
<class name="UserGroup" table="UserGroups">
<id name="id" column="id" type="long" unsaved-value="0">
<generator class="native"/>
</id>
<property name="user_id" column="user_id" type="long"/>
<property name="group_id" column="group_id" type="long"/>
</class>
</hibernate-mapping>