如何解决从休眠映射文件生成DDL语句
我们正在使用hibernate3-maven-plugin
插件从休眠映射文件生成DDL文件。由于休眠5不支持此插件,因此我正在寻找替代方案。有一些使用hibernate-tools ant任务以及使用已合并到hibernate-tools 6.0的第三方hibernate-tools-maven插件生成DDL的教程。所有这些教程的一个问题是它们使用逆向工程从已经存在的数据库中生成DDL语句和hbm文件,但反之则没有。是否可以使用Hibernate 5从hbm文件生成DDL语句?
以下是我们与hibernate3-maven-plugin
一起使用的配置
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<outputDirectory>src/main/config/sql</outputDirectory>
</component>
</components>
<componentProperties>
<implementation>springconfiguration</implementation>
<drop>false</drop>
<create>true</create>
<format>false</format>
<export>false</export>
<console>false</console>
<outputfilename>01_init_schema.sql</outputfilename>
<appcontextlocation>classpath:uiem_persistence_core_without_tracelog_applicationCtx.xml</appcontextlocation>
<sessionfactorybean>coreSessionFactory</sessionfactorybean>
<datasourcebean>coreDataSource</datasourcebean>
</componentProperties>
</configuration>
</plugin>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。