---
title: "hibernate通过对象-关系映射文件*.hbm.xml创建数据库教程"
author: "devil13th"
date: "2010-06-10T13:06:57Z"
tags: ["Hibernate", "XML"]
categories: ["企业架构"]
slug: "hibernate-hbm-xml"
draft: false
lastmod: "2010-06-10T13:06:57Z"
id: 688734
url: "https://devil13th.iteye.com/blog/688734"
---

```
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class ExportDB {
public static void main(String[] args) {
Configuration cfg = new Configuration().configure(); 
SchemaExport export = new SchemaExport(cfg); 
export.create(true, true);
}
}
```