HHH-9128 - Correct documentation regarding EnversHibernateToolTask.
This commit is contained in:
parent
35cefeda2f
commit
61e767c4bf
|
@ -809,21 +809,20 @@ Your opinions on the subject are very welcome on the forum! :)
|
||||||
[[envers-generateschema]]
|
[[envers-generateschema]]
|
||||||
=== Generating schema with Ant
|
=== Generating schema with Ant
|
||||||
|
|
||||||
If you like to generate the database schema file with the Hibernate Tools Ant task,
|
If you would like to generate the database schema file with the Hibernate Tools Ant task, you simply need to use the
|
||||||
you'll probably notice that the generated file doesn't contain definitions of audit tables.
|
`org.hibernate.tool.ant.HibernateToolTask` to do so. This task will generate the definitions of all entities, both of
|
||||||
To generate the audit tables, you simply need to use `org.hibernate.tool.ant.EnversHibernateToolTask`, instead of the usual `org.hibernate.tool.ant.HibernateToolTask`.
|
which are audited by Envers and those which are not.
|
||||||
The former class extends the latter, and only adds generation of the version entities, meaning you can use the task just as you are used to.
|
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
[source,xml]
|
[source,xml]
|
||||||
----
|
----
|
||||||
<target name="schemaexport" depends="build-demo"
|
<target name="schemaexport" depends="build-demo" description="Exports a generated schema to DB and file">
|
||||||
description="Exports a generated schema to DB and file">
|
<taskdef
|
||||||
<taskdef name="hibernatetool"
|
name="hibernatetool"
|
||||||
classname="org.hibernate.tool.ant.EnversHibernateToolTask"
|
classname="org.hibernate.tool.ant.HibernateToolTask"
|
||||||
classpathref="build.demo.classpath"/>
|
classpathref="build.demo.classpath"
|
||||||
|
/>
|
||||||
<hibernatetool destdir=".">
|
<hibernatetool destdir=".">
|
||||||
<classpath>
|
<classpath>
|
||||||
<fileset refid="lib.hibernate" />
|
<fileset refid="lib.hibernate" />
|
||||||
|
@ -835,9 +834,10 @@ For example:
|
||||||
drop="false"
|
drop="false"
|
||||||
create="true"
|
create="true"
|
||||||
export="false"
|
export="false"
|
||||||
outputfilename="versioning-ddl.sql"
|
outputfilename="entities-ddl.sql"
|
||||||
delimiter=";"
|
delimiter=";"
|
||||||
format="true"/>
|
format="true"
|
||||||
|
/>
|
||||||
</hibernatetool>
|
</hibernatetool>
|
||||||
</target>
|
</target>
|
||||||
----
|
----
|
||||||
|
|
Loading…
Reference in New Issue