Refer to this URL to know how to use hibernate ANT tasks to create, validate and update your schema using hibernate mappings.
http://www.hibernate.org/hib_docs/refer ... guide-s1-5
Here is the build.xml with hibernate tasks. You can execute any of these tasks. But first time execute export, then validate and update.
<!-- exports all the hbm mappings to the specified database -->
<target name="schemaexport" depends="" description="Exports all hbm.xml files in {res.dir}/hbm">
<echo message="Run the schema export for all hbm.xml files in ${res.dir}/hbm"/>
<taskdef
name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="project.class.path"
>
</taskdef>
<schemaexport
properties="${res.dir}/hibernate.properties"
quiet="no"
text="no"
drop="no"
output="${gen.files.dir}/schema-export.sql">
<fileset dir="${gen.files.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
<!-- exports all the hbm mappings to update the specified database -->
<target name="schemaupdate" depends="" description="Exports all hbm.xml files in {res.dir}/hbm">
<taskdef name="schemaupdate"
classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask"
classpathref="project.class.path"/>
<schemaupdate
properties="${res.dir}/hibernate.properties"
quiet="no"
text="no">
<fileset dir="${gen.files.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaupdate>
</target>
<target name="schemavalidate">
<taskdef name="schemavalidator"
classname="org.hibernate.tool.hbm2ddl.SchemaValidatorTask"
classpathref="project.class.path"/>
<schemavalidator
properties="${res.dir}/hibernate.properties">
<fileset dir="${gen.files.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemavalidator>
</target>