Hibernate中的SchemaUpdate和SchemaExport之间的区别
Hibernate中的SchemaUpdate和SchemaExport有什么区别.
What is the difference between SchemaUpdate and SchemaExport in Hibernate.
SchemaExport (又名hbm2ddl)是一种从Hibernate映射生成数据库架构(全部而非部分)的工具.SchemaExport需要知道方言,但不会查询现有数据库.然后可以执行生成的DDL语句和/或将其保存到文件和/或打印机中,以进行标准输出.
SchemaExport (aka hbm2ddl) is tool that generates database schema (whole, not partial) from Hibernate mappings. SchemaExport needs to aware of dialect, but it does not consult existing database. Generated DDL statements can then be executed and/or saved to file and/or printer to standard out.
SchemaUpdate 更新现有架构.在某种程度上,它弄清楚了应该执行哪个DDL语句以使现有数据库与修改后的Hibernate映射相匹配.
SchemaUpdate updates existing schema. To some extent it figures out which DDL statement should be executed to make existing database match to modified Hibernate mappings.
更多详细信息的好来源是休眠核心参考手册-第22章.工具集指南.
Good source for more detailed information is Hibernate Core Reference Manual - Chapter 22. Toolset Guide.