Via*_*lov 4 hibernate hibernate-envers
我将Hibernate更新为4.1.1.Final版本.根据文档 有两种方法可以生成数据库模式:
org.hibernate.tool.ant.EnversHibernateToolTask.org.hibernate.tool.EnversSchemaGenerator从Java 运行.Hibernate-tools不适用于Hibernate-4.1.1.Final.它有一个阻止bug.
我发现只有发行说明和测试用例.那么我如何使用org.hibernate.tool.EnversSchemaGenerator我的persistence.xml和Maven?
更新:
在Hibernate论坛上找到相关的主题.似乎我的问题还没有答案.
Via*_*lov 11
Juplo 为Hibernate 4创建了Maven插件.该插件支持包括Envers的模式导出.工作示例如下.检查官方插件配置文档以获取已使用选项的说明.
该插件在目标上schema.sql的Maven /target目录中生成文件test.或者您可以手动运行hibernate4:export目标来更新文件.
<project>
<build>
<plugins>
<plugin>
<groupId>de.juplo</groupId>
<artifactId>hibernate4-maven-plugin</artifactId>
<version>1.0.3</version>
<executions>
<execution>
<goals>
<goal>export</goal>
</goals>
</execution>
</executions>
<configuration>
<envers>true</envers>
<format>true</format>
<delimiter>;</delimiter>
<force>true</force>
<type>CREATE</type>
<target>SCRIPT</target>
<hibernateDialect>org.hibernate.dialect.PostgreSQL9Dialect</hibernateDialect>
</configuration>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8335 次 |
| 最近记录: |